mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-08-17 07:20:48 +03:00
figure out which feature function to apply at which decode step. Book-keeping
This commit is contained in:
parent
9c81696143
commit
d9bd7dc818
@ -84,10 +84,9 @@ void DecodeStepTranslation::Process(const TranslationOption &inputPartialTranslO
|
||||
continue;
|
||||
}
|
||||
|
||||
outPhrase.GetScoreBreakdown().PlusEquals(transScores);
|
||||
outPhrase.Evaluate(src); // need to do this as all non-transcores would be screwed up
|
||||
outPhrase.Merge(targetPhrase, m_newOutputFactors);
|
||||
outPhrase.Evaluate(src, m_featuresToApply); // need to do this as all non-transcores would be screwed up
|
||||
|
||||
outPhrase.MergeFactors(targetPhrase, m_newOutputFactors);
|
||||
|
||||
TranslationOption *newTransOpt = new TranslationOption(sourceWordsRange, outPhrase);
|
||||
assert(newTransOpt != NULL);
|
||||
|
@ -123,10 +123,8 @@ void TargetPhrase::Evaluate(const Phrase &source, const std::vector<FeatureFunct
|
||||
}
|
||||
|
||||
float weightedScore = m_scoreBreakdown.GetWeightedScore();
|
||||
//m_futureScore += futureScoreBreakdown.GetWeightedScore();
|
||||
//m_fullScore = weightedScore + m_futureScore;
|
||||
float futureScore = futureScoreBreakdown.GetWeightedScore();
|
||||
m_fullScore = weightedScore + futureScore;
|
||||
m_futureScore += futureScoreBreakdown.GetWeightedScore();
|
||||
m_fullScore = weightedScore + m_futureScore;
|
||||
|
||||
}
|
||||
}
|
||||
@ -153,8 +151,6 @@ void TargetPhrase::SetXMLScore(float score)
|
||||
|
||||
void TargetPhrase::SetInputScore(const Scores &scoreVector)
|
||||
{
|
||||
cerr << scoreVector.size() << endl;
|
||||
|
||||
//we use an existing score producer to figure out information for score setting (number of scores and weights)
|
||||
const StaticData &staticData = StaticData::Instance();
|
||||
const FeatureFunction* prod = staticData.GetPhraseDictionaries()[0];
|
||||
@ -215,6 +211,8 @@ void TargetPhrase::Merge(const TargetPhrase ©, const std::vector<FactorType>
|
||||
{
|
||||
Phrase::MergeFactors(copy, factorVec);
|
||||
m_scoreBreakdown.Merge(copy.GetScoreBreakdown());
|
||||
m_futureScore += copy.m_futureScore;
|
||||
m_fullScore += copy.m_fullScore;
|
||||
}
|
||||
|
||||
TO_STRING_BODY(TargetPhrase);
|
||||
|
Loading…
Reference in New Issue
Block a user