#include <StatefulFeatureFunction.h>
Public Member Functions | |
StatefulFeatureFunction (const std::string &line, bool registerNow) | |
StatefulFeatureFunction (size_t numScoreComponents, const std::string &line) | |
virtual FFState * | EvaluateWhenApplied (const Hypothesis &cur_hypo, const FFState *prev_state, ScoreComponentCollection *accumulator) const =0 |
This interface should be implemented. Notes: When evaluating the value of this feature function, you should avoid calling hypo.GetPrevHypo(). If you need something from the "previous" hypothesis, you should store it in an FFState object which will be passed in as prev_state. If you don't do this, you will get in trouble. | |
virtual FFState * | EvaluateWhenApplied (const ChartHypothesis &, int, ScoreComponentCollection *accumulator) const =0 |
virtual FFState * | EvaluateWhenApplied (const Syntax::SHyperedge &, int, ScoreComponentCollection *accumulator) const |
virtual const FFState * | EmptyHypothesisState (const InputType &input) const =0 |
return the state associated with the empty hypothesis for a given sentence | |
bool | IsStateless () const |
virtual void | EvaluateInIsolation (Phrase const &source, TargetPhrase const &targetPhrase, ScoreComponentCollection &scoreBreakdown, ScoreComponentCollection &estimatedScores) const |
virtual void | EvaluateWithSourceContext (InputType const &input, InputPath const &inputPath, TargetPhrase const &targetPhrase, StackVec const *stackVec, ScoreComponentCollection &scoreBreakdown, ScoreComponentCollection *estimatedFutureScore=NULL) const |
virtual void | EvaluateTranslationOptionListWithSourceContext (const InputType &input, const TranslationOptionList &translationOptionList) const |
Static Public Member Functions | |
static const std::vector < const StatefulFeatureFunction * > & | GetStatefulFeatureFunctions () |
Definition at line 19 of file StatefulFeatureFunction.h.
Moses::StatefulFeatureFunction::StatefulFeatureFunction | ( | const std::string & | line, | |
bool | registerNow | |||
) |
Definition at line 9 of file StatefulFeatureFunction.cpp.
Moses::StatefulFeatureFunction::StatefulFeatureFunction | ( | size_t | numScoreComponents, | |
const std::string & | line | |||
) |
Definition at line 16 of file StatefulFeatureFunction.cpp.
virtual const FFState* Moses::StatefulFeatureFunction::EmptyHypothesisState | ( | const InputType & | input | ) | const [pure virtual] |
return the state associated with the empty hypothesis for a given sentence
Implemented in Moses::BleuScoreFeature, Moses::ConstrainedDecoding, Moses::ControlRecombination, Moses::CoveredReferenceFeature, Moses::DistortionScoreProducer, Moses::DesegModel, Moses::ExampleStatefulFF, Moses::LexicalReordering, Moses::OpSequenceModel, Moses::PhraseBoundaryFeature, Moses::PhraseOrientationFeature, Moses::TargetBigramFeature, Moses::TargetConstituentAdjacencyFeature, Moses::TargetNgramFeature, Moses::TargetPreferencesFeature, Moses::TreeStructureFeature, Moses::VW, Moses::BackwardLanguageModel< Model >, Moses::LanguageModel, Moses::BilingualLM, Moses::LanguageModelDALM, Moses::LanguageModelImplementation, Moses::InMemoryPerSentenceOnDemandLM, Moses::LanguageModelIRST, Moses::LanguageModelKen< Model >, Moses::RDLM, Moses::SyntacticLanguageModel, Moses::BackwardLanguageModel< lm::ngram::ProbingModel >, Moses::LanguageModelKen< Model >, and Moses::LanguageModelKen< lm::ngram::ProbingModel >.
virtual void Moses::StatefulFeatureFunction::EvaluateInIsolation | ( | Phrase const & | source, | |
TargetPhrase const & | targetPhrase, | |||
ScoreComponentCollection & | scoreBreakdown, | |||
ScoreComponentCollection & | estimatedScores | |||
) | const [inline, virtual] |
Implements Moses::FeatureFunction.
Reimplemented in Moses::DesegModel, Moses::ExampleStatefulFF, Moses::OpSequenceModel, Moses::PhraseOrientationFeature, Moses::TargetConstituentAdjacencyFeature, Moses::TargetPreferencesFeature, Moses::VW, Moses::LanguageModel, and Moses::InMemoryPerSentenceOnDemandLM.
Definition at line 76 of file StatefulFeatureFunction.h.
virtual void Moses::StatefulFeatureFunction::EvaluateTranslationOptionListWithSourceContext | ( | const InputType & | input, | |
const TranslationOptionList & | translationOptionList | |||
) | const [inline, virtual] |
Implements Moses::FeatureFunction.
Reimplemented in Moses::ExampleStatefulFF, Moses::TargetConstituentAdjacencyFeature, Moses::TargetPreferencesFeature, and Moses::VW.
Definition at line 88 of file StatefulFeatureFunction.h.
virtual FFState* Moses::StatefulFeatureFunction::EvaluateWhenApplied | ( | const Syntax::SHyperedge & | , | |
int | , | |||
ScoreComponentCollection * | accumulator | |||
) | const [inline, virtual] |
Reimplemented in Moses::InMemoryPerSentenceOnDemandLM, Moses::LanguageModelKen< Model >, Moses::LanguageModelKen< Model >, and Moses::LanguageModelKen< lm::ngram::ProbingModel >.
Definition at line 58 of file StatefulFeatureFunction.h.
virtual FFState* Moses::StatefulFeatureFunction::EvaluateWhenApplied | ( | const ChartHypothesis & | , | |
int | , | |||
ScoreComponentCollection * | accumulator | |||
) | const [pure virtual] |
Implemented in Moses::BleuScoreFeature, Moses::ConstrainedDecoding, Moses::ControlRecombination, Moses::CoveredReferenceFeature, Moses::DistortionScoreProducer, Moses::DesegModel, Moses::ExampleStatefulFF, Moses::LexicalReordering, Moses::OpSequenceModel, Moses::PhraseBoundaryFeature, Moses::PhraseOrientationFeature, Moses::TargetBigramFeature, Moses::TargetConstituentAdjacencyFeature, Moses::TargetNgramFeature, Moses::TargetPreferencesFeature, Moses::TreeStructureFeature, Moses::VW, Moses::BilingualLM, Moses::LanguageModelDALM, Moses::LanguageModelImplementation, Moses::InMemoryPerSentenceOnDemandLM, Moses::LanguageModelKen< Model >, Moses::RDLM, Moses::SyntacticLanguageModel, Moses::LanguageModelKen< Model >, and Moses::LanguageModelKen< lm::ngram::ProbingModel >.
virtual FFState* Moses::StatefulFeatureFunction::EvaluateWhenApplied | ( | const Hypothesis & | cur_hypo, | |
const FFState * | prev_state, | |||
ScoreComponentCollection * | accumulator | |||
) | const [pure virtual] |
This interface should be implemented. Notes: When evaluating the value of this feature function, you should avoid calling hypo.GetPrevHypo(). If you need something from the "previous" hypothesis, you should store it in an FFState object which will be passed in as prev_state. If you don't do this, you will get in trouble.
Implemented in Moses::BleuScoreFeature, Moses::ConstrainedDecoding, Moses::ControlRecombination, Moses::CoveredReferenceFeature, Moses::DistortionScoreProducer, Moses::DesegModel, Moses::ExampleStatefulFF, Moses::LexicalReordering, Moses::OpSequenceModel, Moses::PhraseBoundaryFeature, Moses::PhraseOrientationFeature, Moses::TargetBigramFeature, Moses::TargetConstituentAdjacencyFeature, Moses::TargetNgramFeature, Moses::TargetPreferencesFeature, Moses::TreeStructureFeature, Moses::VW, Moses::BilingualLM, Moses::LanguageModelDALM, Moses::LanguageModelImplementation, Moses::InMemoryPerSentenceOnDemandLM, Moses::LanguageModelIRST, Moses::LanguageModelKen< Model >, Moses::RDLM, Moses::LanguageModelKen< Model >, and Moses::LanguageModelKen< lm::ngram::ProbingModel >.
Referenced by Moses::Hypothesis::EvaluateWhenApplied().
virtual void Moses::StatefulFeatureFunction::EvaluateWithSourceContext | ( | InputType const & | input, | |
InputPath const & | inputPath, | |||
TargetPhrase const & | targetPhrase, | |||
StackVec const * | stackVec, | |||
ScoreComponentCollection & | scoreBreakdown, | |||
ScoreComponentCollection * | estimatedFutureScore = NULL | |||
) | const [inline, virtual] |
Implements Moses::FeatureFunction.
Reimplemented in Moses::CoveredReferenceFeature, Moses::ExampleStatefulFF, Moses::TargetConstituentAdjacencyFeature, Moses::TargetPreferencesFeature, and Moses::VW.
Definition at line 82 of file StatefulFeatureFunction.h.
static const std::vector<const StatefulFeatureFunction*>& Moses::StatefulFeatureFunction::GetStatefulFeatureFunctions | ( | ) | [inline, static] |
Definition at line 26 of file StatefulFeatureFunction.h.
Referenced by Moses::Hypothesis::EvaluateWhenApplied(), Moses::ChartHypothesis::EvaluateWhenApplied(), Moses::LanguageModel::GetFirstLM(), Moses::Manager::GetOutputLanguageModelOrder(), Moses::Hypothesis::Hypothesis(), Moses::ScoreComponentCollection::OutputAllFeatureScores(), Moses::ChartManager::OutputDetailedTreeFragmentsTranslationReport(), Moses::Manager::OutputWordGraph(), and Moses::ShowWeights().
bool Moses::StatefulFeatureFunction::IsStateless | ( | ) | const [inline, virtual] |