MosesTuning::InterpolatedScorer Class Reference

#include <InterpolatedScorer.h>

Inheritance diagram for MosesTuning::InterpolatedScorer:

Inheritance graph
[legend]
Collaboration diagram for MosesTuning::InterpolatedScorer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 InterpolatedScorer (const std::string &name, const std::string &config)
virtual ~InterpolatedScorer ()
virtual void score (const candidates_t &candidates, const diffs_t &diffs, statscores_t &scores) const
virtual void setReferenceFiles (const std::vector< std::string > &referenceFiles)
virtual void prepareStats (std::size_t sid, const std::string &text, ScoreStats &entry)
virtual std::size_t NumberOfScores () const
virtual void setScoreData (ScoreData *data)
virtual float calculateScore (const std::vector< ScoreStatsType > &totals) const
virtual float getReferenceLength (const std::vector< ScoreStatsType > &totals) const
virtual void setFactors (const std::string &factors)
virtual void setFilter (const std::string &filterCommand)
bool useAlignment () const

Protected Attributes

ScopedVector< Scorerm_scorers
ScopedVector< ScoreDatam_scorers_score_data
std::vector< float > m_scorer_weights


Detailed Description

Class that includes other scorers eg. Interpolated HAMMING and BLEU scorer

Definition at line 18 of file InterpolatedScorer.h.


Constructor & Destructor Documentation

MosesTuning::InterpolatedScorer::InterpolatedScorer ( const std::string &  name,
const std::string &  config 
)

virtual MosesTuning::InterpolatedScorer::~InterpolatedScorer (  )  [inline, virtual]

Definition at line 23 of file InterpolatedScorer.h.


Member Function Documentation

float MosesTuning::InterpolatedScorer::calculateScore ( const std::vector< ScoreStatsType > &  totals  )  const [virtual]

Interpolated scorer gets a vector of sufficient statistics, calls all scorers with corresponding statistics, and combines them with weights

Implements MosesTuning::Scorer.

Definition at line 158 of file InterpolatedScorer.cpp.

References MosesTuning::ScopedVector< T >::begin(), MosesTuning::ScopedVector< T >::end(), m_scorer_weights, m_scorers, and score().

Here is the call graph for this function:

float MosesTuning::InterpolatedScorer::getReferenceLength ( const std::vector< ScoreStatsType > &  totals  )  const [virtual]

Based on vector of sufficient statistics, return length of reference.

Implements MosesTuning::Scorer.

Definition at line 175 of file InterpolatedScorer.cpp.

References MosesTuning::ScopedVector< T >::begin(), MosesTuning::ScopedVector< T >::end(), m_scorer_weights, and m_scorers.

Here is the call graph for this function:

virtual std::size_t MosesTuning::InterpolatedScorer::NumberOfScores (  )  const [inline, virtual]

Return the number of statistics needed for the computation of the score.

Implements MosesTuning::Scorer.

Definition at line 31 of file InterpolatedScorer.h.

References MosesTuning::ScopedVector< T >::begin(), MosesTuning::ScopedVector< T >::end(), and m_scorers.

Here is the call graph for this function:

virtual void MosesTuning::InterpolatedScorer::prepareStats ( std::size_t  sindex,
const std::string &  text,
ScoreStats entry 
) [virtual]

Process the given guessed text, corresponding to the given reference sindex and add the appropriate statistics to the entry.

Reimplemented from MosesTuning::Scorer.

void MosesTuning::InterpolatedScorer::score ( const candidates_t candidates,
const diffs_t diffs,
statscores_t scores 
) const [virtual]

The interpolated scorer calls a vector of scorers and combines them with weights

Implements MosesTuning::Scorer.

Definition at line 122 of file InterpolatedScorer.cpp.

References MosesTuning::ScopedVector< T >::begin(), MosesTuning::ScopedVector< T >::end(), m_scorer_weights, and m_scorers.

Referenced by calculateScore(), and setScoreData().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void MosesTuning::InterpolatedScorer::setFactors ( const std::string &  factors  )  [virtual]

Set the factors, which should be used for this metric

Reimplemented from MosesTuning::Scorer.

virtual void MosesTuning::InterpolatedScorer::setFilter ( const std::string &  filterCommand  )  [virtual]

Set unix filter, which will be used to preprocess the sentences

Reimplemented from MosesTuning::Scorer.

virtual void MosesTuning::InterpolatedScorer::setReferenceFiles ( const std::vector< std::string > &  referenceFiles  )  [virtual]

Set the reference files. This must be called before prepareStats().

Reimplemented from MosesTuning::Scorer.

void MosesTuning::InterpolatedScorer::setScoreData ( ScoreData data  )  [virtual]

bool MosesTuning::InterpolatedScorer::useAlignment (  )  const [virtual]

The scorer returns if it uses the reference alignment data for permutation distance scores

Reimplemented from MosesTuning::Scorer.

Definition at line 69 of file InterpolatedScorer.cpp.

References MosesTuning::ScopedVector< T >::begin(), MosesTuning::ScopedVector< T >::end(), and m_scorers.

Here is the call graph for this function:


Member Data Documentation

std::vector<float> MosesTuning::InterpolatedScorer::m_scorer_weights [protected]

Definition at line 62 of file InterpolatedScorer.h.

Referenced by calculateScore(), getReferenceLength(), and score().

Definition at line 60 of file InterpolatedScorer.h.

Referenced by setScoreData().


The documentation for this class was generated from the following files:

Generated on Thu Jul 6 00:34:17 2017 for Moses by  doxygen 1.5.9