#include <Base.h>
Public Member Functions | |
virtual | ~LanguageModel () |
bool | OOVFeatureEnabled () const |
virtual void | SetParameter (const std::string &key, const std::string &value) |
virtual const FFState * | EmptyHypothesisState (const InputType &input) const =0 |
return the state associated with the empty hypothesis for a given sentence | |
virtual void | CalcScore (const Phrase &phrase, float &fullScore, float &ngramScore, std::size_t &oovCount) const =0 |
virtual void | CalcScoreFromCache (const Phrase &phrase, float &fullScore, float &ngramScore, std::size_t &oovCount) const |
virtual void | IssueRequestsFor (Hypothesis &hypo, const FFState *input_state) |
virtual void | sync () |
virtual void | SetFFStateIdx (int state_idx) |
virtual void | IncrementalCallback (Incremental::Manager &manager) const |
virtual void | ReportHistoryOrder (std::ostream &out, const Phrase &phrase) const |
virtual void | EvaluateInIsolation (const Phrase &source, const TargetPhrase &targetPhrase, ScoreComponentCollection &scoreBreakdown, ScoreComponentCollection &estimatedScores) const |
Static Public Member Functions | |
static const LanguageModel & | GetFirstLM () |
Protected Member Functions | |
LanguageModel (const std::string &line) | |
Protected Attributes | |
bool | m_enableOOVFeature |
Definition at line 44 of file Base.h.
Moses::LanguageModel::LanguageModel | ( | const std::string & | line | ) | [protected] |
Definition at line 36 of file Base.cpp.
References m_enableOOVFeature, Moses::FeatureFunction::m_numScoreComponents, and Moses::FeatureFunction::m_numTuneableComponents.
virtual void Moses::LanguageModel::CalcScore | ( | const Phrase & | phrase, | |
float & | fullScore, | |||
float & | ngramScore, | |||
std::size_t & | oovCount | |||
) | const [pure virtual] |
Implemented in Moses::InMemoryPerSentenceOnDemandLM.
Referenced by EvaluateInIsolation(), and Moses::Incremental::PhraseAndFeatures().
virtual void Moses::LanguageModel::CalcScoreFromCache | ( | const Phrase & | phrase, | |
float & | fullScore, | |||
float & | ngramScore, | |||
std::size_t & | oovCount | |||
) | const [inline, virtual] |
Reimplemented in Moses::InMemoryPerSentenceOnDemandLM.
Definition at line 73 of file Base.h.
Referenced by Moses::InMemoryPerSentenceOnDemandLM::CalcScoreFromCache().
virtual const FFState* Moses::LanguageModel::EmptyHypothesisState | ( | const InputType & | input | ) | const [pure virtual] |
return the state associated with the empty hypothesis for a given sentence
Implements Moses::StatefulFeatureFunction.
Implemented in Moses::BackwardLanguageModel< Model >, Moses::LanguageModelDALM, Moses::LanguageModelImplementation, Moses::InMemoryPerSentenceOnDemandLM, Moses::LanguageModelIRST, Moses::LanguageModelKen< Model >, Moses::BackwardLanguageModel< lm::ngram::ProbingModel >, Moses::LanguageModelKen< Model >, and Moses::LanguageModelKen< lm::ngram::ProbingModel >.
void Moses::LanguageModel::EvaluateInIsolation | ( | const Phrase & | source, | |
const TargetPhrase & | targetPhrase, | |||
ScoreComponentCollection & | scoreBreakdown, | |||
ScoreComponentCollection & | estimatedScores | |||
) | const [virtual] |
Reimplemented from Moses::StatefulFeatureFunction.
Reimplemented in Moses::InMemoryPerSentenceOnDemandLM.
Definition at line 62 of file Base.cpp.
References Moses::ScoreComponentCollection::Assign(), CalcScore(), and m_enableOOVFeature.
Referenced by Moses::InMemoryPerSentenceOnDemandLM::EvaluateInIsolation().
const LanguageModel & Moses::LanguageModel::GetFirstLM | ( | ) | [static] |
Definition at line 89 of file Base.cpp.
References Moses::StatefulFeatureFunction::GetStatefulFeatureFunctions(), and NULL.
Referenced by Moses::Incremental::Manager::Decode(), and Moses::Incremental::PhraseAndFeatures().
void Moses::LanguageModel::IncrementalCallback | ( | Incremental::Manager & | manager | ) | const [virtual] |
Reimplemented in Moses::InMemoryPerSentenceOnDemandLM, Moses::LanguageModelKen< Model >, Moses::LanguageModelKen< Model >, and Moses::LanguageModelKen< lm::ngram::ProbingModel >.
Definition at line 50 of file Base.cpp.
References UTIL_THROW.
Referenced by Moses::Incremental::Manager::Decode().
virtual void Moses::LanguageModel::IssueRequestsFor | ( | Hypothesis & | hypo, | |
const FFState * | input_state | |||
) | [inline, virtual] |
Reimplemented in Moses::InMemoryPerSentenceOnDemandLM.
Definition at line 76 of file Base.h.
Referenced by Moses::InMemoryPerSentenceOnDemandLM::IssueRequestsFor().
bool Moses::LanguageModel::OOVFeatureEnabled | ( | ) | const [inline] |
Definition at line 56 of file Base.h.
References m_enableOOVFeature.
Referenced by Moses::LanguageModelKen< Model >::EvaluateWhenApplied(), Moses::LanguageModelImplementation::EvaluateWhenApplied(), and Moses::LanguageModelDALM::EvaluateWhenApplied().
void Moses::LanguageModel::ReportHistoryOrder | ( | std::ostream & | out, | |
const Phrase & | phrase | |||
) | const [virtual] |
virtual void Moses::LanguageModel::SetFFStateIdx | ( | int | state_idx | ) | [inline, virtual] |
Reimplemented in Moses::InMemoryPerSentenceOnDemandLM.
Definition at line 81 of file Base.h.
Referenced by Moses::InMemoryPerSentenceOnDemandLM::SetFFStateIdx().
void Moses::LanguageModel::SetParameter | ( | const std::string & | key, | |
const std::string & | value | |||
) | [virtual] |
Reimplemented from Moses::FeatureFunction.
Reimplemented in Moses::LanguageModelDALM, Moses::LanguageModelImplementation, Moses::InMemoryPerSentenceOnDemandLM, Moses::LanguageModelIRST, Moses::OxLM< Model >, and Moses::LanguageModelSingleFactor.
Definition at line 112 of file Base.cpp.
References m_enableOOVFeature, Moses::FeatureFunction::m_numScoreComponents, Moses::FeatureFunction::m_numTuneableComponents, and Moses::Scan< bool >().
Referenced by Moses::InMemoryPerSentenceOnDemandLM::SetParameter().
virtual void Moses::LanguageModel::sync | ( | ) | [inline, virtual] |
Reimplemented in Moses::InMemoryPerSentenceOnDemandLM.
Definition at line 79 of file Base.h.
Referenced by Moses::InMemoryPerSentenceOnDemandLM::sync().
bool Moses::LanguageModel::m_enableOOVFeature [protected] |
Definition at line 49 of file Base.h.
Referenced by EvaluateInIsolation(), LanguageModel(), OOVFeatureEnabled(), and SetParameter().