diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-11-03 08:55:26 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-11-03 08:55:26 +0300 |
commit | ee5b190d43719752a58de6280266b2c2f497e35c (patch) | |
tree | 50a63ff9c400fca794e66a057bd391acfb36818a /moses/TargetPhrase.cpp | |
parent | ad009e575f5f565be7cb6abb5545b4dfc27f9831 (diff) |
consistent naming of future scores, estimated scores
Diffstat (limited to 'moses/TargetPhrase.cpp')
-rw-r--r-- | moses/TargetPhrase.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/moses/TargetPhrase.cpp b/moses/TargetPhrase.cpp index fe114f164..8cab537d4 100644 --- a/moses/TargetPhrase.cpp +++ b/moses/TargetPhrase.cpp @@ -41,8 +41,8 @@ namespace Moses { TargetPhrase::TargetPhrase( std::string out_string, const PhraseDictionary *pt) :Phrase(0) - , m_fullScore(0.0) , m_futureScore(0.0) + , m_estimatedScore(0.0) , m_alignTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) , m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) , m_lhsTarget(NULL) @@ -59,8 +59,8 @@ TargetPhrase::TargetPhrase( std::string out_string, const PhraseDictionary *pt) TargetPhrase::TargetPhrase(ttasksptr& ttask, std::string out_string, const PhraseDictionary *pt) :Phrase(0) - , m_fullScore(0.0) , m_futureScore(0.0) + , m_estimatedScore(0.0) , m_alignTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) , m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) , m_lhsTarget(NULL) @@ -79,8 +79,8 @@ TargetPhrase::TargetPhrase(ttasksptr& ttask, std::string out_string, const Phras TargetPhrase::TargetPhrase(ttasksptr& ttask, const PhraseDictionary *pt) : Phrase() - , m_fullScore(0.0) , m_futureScore(0.0) + , m_estimatedScore(0.0) , m_alignTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) , m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) , m_lhsTarget(NULL) @@ -92,8 +92,8 @@ TargetPhrase::TargetPhrase(ttasksptr& ttask, const PhraseDictionary *pt) TargetPhrase::TargetPhrase(ttasksptr& ttask, const Phrase &phrase, const PhraseDictionary *pt) : Phrase(phrase) - , m_fullScore(0.0) , m_futureScore(0.0) + , m_estimatedScore(0.0) , m_alignTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) , m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) , m_lhsTarget(NULL) @@ -105,8 +105,8 @@ TargetPhrase::TargetPhrase(ttasksptr& ttask, const Phrase &phrase, const PhraseD TargetPhrase::TargetPhrase(const PhraseDictionary *pt) :Phrase() - , m_fullScore(0.0) , m_futureScore(0.0) + , m_estimatedScore(0.0) , m_alignTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) , m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) , m_lhsTarget(NULL) @@ -117,8 +117,8 @@ TargetPhrase::TargetPhrase(const PhraseDictionary *pt) TargetPhrase::TargetPhrase(const Phrase &phrase, const PhraseDictionary *pt) : Phrase(phrase) - , m_fullScore(0.0) , m_futureScore(0.0) + , m_estimatedScore(0.0) , m_alignTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) , m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo()) , m_lhsTarget(NULL) @@ -130,8 +130,8 @@ TargetPhrase::TargetPhrase(const Phrase &phrase, const PhraseDictionary *pt) TargetPhrase::TargetPhrase(const TargetPhrase ©) : Phrase(copy) , m_cached_scores(copy.m_cached_scores) - , m_fullScore(copy.m_fullScore) , m_futureScore(copy.m_futureScore) + , m_estimatedScore(copy.m_estimatedScore) , m_scoreBreakdown(copy.m_scoreBreakdown) , m_alignTerm(copy.m_alignTerm) , m_alignNonTerm(copy.m_alignNonTerm) @@ -189,17 +189,17 @@ void TargetPhrase::EvaluateInIsolation(const Phrase &source, const std::vector<F { if (ffs.size()) { const StaticData &staticData = StaticData::Instance(); - ScoreComponentCollection futureScoreBreakdown; + ScoreComponentCollection estimatedFutureScore; for (size_t i = 0; i < ffs.size(); ++i) { const FeatureFunction &ff = *ffs[i]; if (! staticData.IsFeatureFunctionIgnored( ff )) { - ff.EvaluateInIsolation(source, *this, m_scoreBreakdown, futureScoreBreakdown); + ff.EvaluateInIsolation(source, *this, m_scoreBreakdown, estimatedFutureScore); } } float weightedScore = m_scoreBreakdown.GetWeightedScore(); - m_futureScore += futureScoreBreakdown.GetWeightedScore(); - m_fullScore = weightedScore + m_futureScore; + m_estimatedScore += estimatedFutureScore.GetWeightedScore(); + m_futureScore = weightedScore + m_estimatedScore; } } @@ -215,16 +215,16 @@ void TargetPhrase::EvaluateWithSourceContext(const InputType &input, const Input } } float weightedScore = m_scoreBreakdown.GetWeightedScore(); - m_futureScore += futureScoreBreakdown.GetWeightedScore(); - m_fullScore = weightedScore + m_futureScore; + m_estimatedScore += futureScoreBreakdown.GetWeightedScore(); + m_futureScore = weightedScore + m_estimatedScore; } void TargetPhrase::UpdateScore(ScoreComponentCollection* futureScoreBreakdown) { float weightedScore = m_scoreBreakdown.GetWeightedScore(); if(futureScoreBreakdown) - m_futureScore += futureScoreBreakdown->GetWeightedScore(); - m_fullScore = weightedScore + m_futureScore; + m_estimatedScore += futureScoreBreakdown->GetWeightedScore(); + m_futureScore = weightedScore + m_estimatedScore; } void TargetPhrase::SetXMLScore(float score) @@ -303,8 +303,8 @@ Merge(const TargetPhrase ©, const std::vector<FactorType>& factorVec) { Phrase::MergeFactors(copy, factorVec); m_scoreBreakdown.Merge(copy.GetScoreBreakdown()); + m_estimatedScore += copy.m_estimatedScore; m_futureScore += copy.m_futureScore; - m_fullScore += copy.m_fullScore; typedef ScoreCache_t::iterator iter; typedef ScoreCache_t::value_type item; BOOST_FOREACH(item const& s, copy.m_cached_scores) { @@ -390,8 +390,8 @@ void TargetPhrase::SetRuleSource(const Phrase &ruleSource) const void swap(TargetPhrase &first, TargetPhrase &second) { first.SwapWords(second); - std::swap(first.m_fullScore, second.m_fullScore); std::swap(first.m_futureScore, second.m_futureScore); + std::swap(first.m_estimatedScore, second.m_estimatedScore); swap(first.m_scoreBreakdown, second.m_scoreBreakdown); std::swap(first.m_alignTerm, second.m_alignTerm); std::swap(first.m_alignNonTerm, second.m_alignNonTerm); @@ -411,7 +411,7 @@ std::ostream& operator<<(std::ostream& os, const TargetPhrase& tp) os << tp.GetAlignNonTerm() << flush; os << ": term=" << tp.GetAlignTerm() << flush; os << ": nonterm=" << tp.GetAlignNonTerm() << flush; - os << ": c=" << tp.m_fullScore << flush; + os << ": c=" << tp.m_futureScore << flush; os << " " << tp.m_scoreBreakdown << flush; const Phrase *sourcePhrase = tp.GetRuleSource(); |