MosesTuning::StatisticsBasedScorer Class Reference

#include <StatisticsBasedScorer.h>

Inheritance diagram for MosesTuning::StatisticsBasedScorer:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 StatisticsBasedScorer (const std::string &name, const std::string &config)
virtual ~StatisticsBasedScorer ()
virtual void score (const candidates_t &candidates, const diffs_t &diffs, statscores_t &scores) const

Protected Types

enum  RegularisationType { NONE, AVERAGE, MINIMUM }

Protected Member Functions

virtual statscore_t calculateScore (const std::vector< ScoreStatsType > &totals) const =0
virtual float getReferenceLength (const std::vector< ScoreStatsType > &totals) const

Protected Attributes

RegularisationType m_regularization_type
std::size_t m_regularization_window

Friends

class HopeFearDecoder


Detailed Description

Abstract base class for Scorers that work by adding statistics across all outout sentences, then apply some formula, e.g., BLEU, PER.

Definition at line 24 of file StatisticsBasedScorer.h.


Member Enumeration Documentation

Enumerator:
NONE 
AVERAGE 
MINIMUM 

Definition at line 36 of file StatisticsBasedScorer.h.


Constructor & Destructor Documentation

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

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

Definition at line 30 of file StatisticsBasedScorer.h.


Member Function Documentation

virtual statscore_t MosesTuning::StatisticsBasedScorer::calculateScore ( const std::vector< ScoreStatsType > &  totals  )  const [protected, pure virtual]

virtual float MosesTuning::StatisticsBasedScorer::getReferenceLength ( const std::vector< ScoreStatsType > &  totals  )  const [inline, protected, virtual]

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

Implements MosesTuning::Scorer.

Reimplemented in MosesTuning::BleuScorer, MosesTuning::HwcmScorer, MosesTuning::M2Scorer, and MosesTuning::MeteorScorer.

Definition at line 47 of file StatisticsBasedScorer.h.

References UTIL_THROW.

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

Score using each of the candidate index, then go through the diffs applying each in turn, and calculating a new score each time.

Implements MosesTuning::Scorer.

Definition at line 56 of file StatisticsBasedScorer.cpp.

References AVERAGE, calculateScore(), end, MosesTuning::ScoreArray::get(), MosesTuning::ScoreStats::get(), MosesTuning::ScoreData::get(), k, m_regularization_type, m_regularization_window, MosesTuning::Scorer::m_score_data, NONE, sid, MosesTuning::ScoreStats::size(), MosesTuning::ScoreArray::size(), MosesTuning::ScoreData::size(), and Moses::stats.

Here is the call graph for this function:


Friends And Related Function Documentation

friend class HopeFearDecoder [friend]

Definition at line 26 of file StatisticsBasedScorer.h.


Member Data Documentation

Definition at line 53 of file StatisticsBasedScorer.h.

Referenced by score().

Definition at line 54 of file StatisticsBasedScorer.h.

Referenced by score().


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

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