#include <StatisticsBasedScorer.h>
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 |
Definition at line 24 of file StatisticsBasedScorer.h.
enum MosesTuning::StatisticsBasedScorer::RegularisationType [protected] |
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.
virtual statscore_t MosesTuning::StatisticsBasedScorer::calculateScore | ( | const std::vector< ScoreStatsType > & | totals | ) | const [protected, pure virtual] |
Calculate the actual score.
Implements MosesTuning::Scorer.
Implemented in MosesTuning::BleuScorer, MosesTuning::CderScorer, MosesTuning::HwcmScorer, MosesTuning::M2Scorer, MosesTuning::MeteorScorer, MosesTuning::PermutationScorer, MosesTuning::PerScorer, MosesTuning::SemposScorer, and MosesTuning::TerScorer.
Referenced by score().
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.
friend class HopeFearDecoder [friend] |
Definition at line 26 of file StatisticsBasedScorer.h.
std::size_t MosesTuning::StatisticsBasedScorer::m_regularization_window [protected] |