diff options
author | Eva Hasler <ehasler@saxnot.inf.ed.ac.uk> | 2012-06-01 04:49:42 +0400 |
---|---|---|
committer | Eva Hasler <ehasler@saxnot.inf.ed.ac.uk> | 2012-06-01 04:49:42 +0400 |
commit | 6a6a35c65eaeb42b3f1aa44237332dd6f1bc652c (patch) | |
tree | 8a02d798832fe36e9efb60f8a2e30d9368728a13 /moses/src/TargetPhrase.cpp | |
parent | 62d10a2af3f9509bf7680b8549ff1ffd9774dd83 (diff) |
fix start weights in experiment.perl, add hypothesis queue for picking hope and fear translations, add variations to 1slack formulation
Diffstat (limited to 'moses/src/TargetPhrase.cpp')
-rw-r--r--[-rwxr-xr-x] | moses/src/TargetPhrase.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/moses/src/TargetPhrase.cpp b/moses/src/TargetPhrase.cpp index c79b844f8..2783a7604 100755..100644 --- a/moses/src/TargetPhrase.cpp +++ b/moses/src/TargetPhrase.cpp @@ -142,12 +142,7 @@ void TargetPhrase::SetScore(const ScoreProducer* translationScoreProducer, CHECK(weightT.size() == scoreVector.size()); // calc average score if non-best - const TranslationSystem& system = StaticData::Instance().GetTranslationSystem(TranslationSystem::DEFAULT); - std::vector<float> weightsT = system.GetTranslationWeights(); - weightWP = system.GetWeightWordPenalty(); - - //m_transScore = std::inner_product(scoreVector.begin(), scoreVector.end(), weightT.begin(), 0.0f); - m_transScore = std::inner_product(scoreVector.begin(), scoreVector.end(), weightsT.begin(), 0.0f); + m_transScore = std::inner_product(scoreVector.begin(), scoreVector.end(), weightT.begin(), 0.0f); m_scoreBreakdown.PlusEquals(translationScoreProducer, scoreVector); m_scoreBreakdown.PlusEquals(sparseScoreVector); @@ -197,15 +192,10 @@ void TargetPhrase::SetScoreChart(const ScoreProducer* translationScoreProducer, ,const LMList &languageModels ,const WordPenaltyProducer* wpProducer) { - CHECK(weightT.size() == scoreVector.size()); - - const TranslationSystem& system = StaticData::Instance().GetTranslationSystem(TranslationSystem::DEFAULT); - std::vector<float> weightsT = system.GetTranslationWeights(); // calc average score if non-best - //m_transScore = std::inner_product(scoreVector.begin(), scoreVector.end(), weightT.begin(), 0.0f); - m_transScore = std::inner_product(scoreVector.begin(), scoreVector.end(), weightsT.begin(), 0.0f); + m_transScore = std::inner_product(scoreVector.begin(), scoreVector.end(), weightT.begin(), 0.0f); m_scoreBreakdown.PlusEquals(translationScoreProducer, scoreVector); // Replicated from TranslationOptions.cpp @@ -269,11 +259,7 @@ void TargetPhrase::SetWeights(const ScoreProducer* translationScoreProducer, con addition to the usual phrase translation scaling factors) the input weight factor as last element */ - - const TranslationSystem& system = StaticData::Instance().GetTranslationSystem(TranslationSystem::DEFAULT); - std::vector<float> weightsT = system.GetTranslationWeights(); - //m_transScore = m_scoreBreakdown.PartialInnerProduct(translationScoreProducer, weightT); - m_transScore = m_scoreBreakdown.PartialInnerProduct(translationScoreProducer, weightsT); + m_transScore = m_scoreBreakdown.PartialInnerProduct(translationScoreProducer, weightT); } void TargetPhrase::ResetScore() |