Fix the evaluate method for GLM. GLM should evaluate transopts after

initializing the input
This commit is contained in:
Prashant Mathur 2016-05-03 12:01:43 +02:00
parent 1c365788dc
commit ef3199de3e
2 changed files with 7 additions and 5 deletions

View File

@ -173,10 +173,12 @@ float GlobalLexicalModel::GetFromCacheOrScorePhrase( const TargetPhrase& targetP
return score; return score;
} }
void GlobalLexicalModel::EvaluateInIsolation(const Phrase &source void GlobalLexicalModel::EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase , const TargetPhrase &targetPhrase
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown , ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScores) const , ScoreComponentCollection *estimatedScores) const
{ {
scoreBreakdown.PlusEquals( this, GetFromCacheOrScorePhrase(targetPhrase) ); scoreBreakdown.PlusEquals( this, GetFromCacheOrScorePhrase(targetPhrase) );
} }

View File

@ -75,7 +75,8 @@ public:
void EvaluateInIsolation(const Phrase &source void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase , const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown , ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedScores) const; , ScoreComponentCollection &estimatedScores) const {
}
void EvaluateWhenApplied(const Hypothesis& hypo, void EvaluateWhenApplied(const Hypothesis& hypo,
ScoreComponentCollection* accumulator) const { ScoreComponentCollection* accumulator) const {
@ -89,8 +90,7 @@ public:
, const TargetPhrase &targetPhrase , const TargetPhrase &targetPhrase
, const StackVec *stackVec , const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown , ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedScores = NULL) const { , ScoreComponentCollection *estimatedScores = NULL) const;
}
void EvaluateTranslationOptionListWithSourceContext(const InputType &input void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const { , const TranslationOptionList &translationOptionList) const {