Merge branch 'vw_integration' of github.com:moses-smt/mosesdecoder into vw_integration

This commit is contained in:
Ales Tamchyna 2015-01-06 14:02:21 +01:00
commit d4879855e0
51 changed files with 121 additions and 312 deletions

View File

@ -129,14 +129,9 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown

View File

@ -55,14 +55,9 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
FFState* EvaluateWhenApplied(
const Hypothesis& cur_hypo,

View File

@ -70,14 +70,9 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
FFState* EvaluateWhenApplied(
const Hypothesis& cur_hypo,

View File

@ -26,15 +26,10 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateWhenApplied(const Hypothesis& hypo,
ScoreComponentCollection* accumulator) const
{}

View File

@ -62,14 +62,9 @@ public:
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const;
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
FFState* EvaluateWhenApplied(
const Hypothesis& cur_hypo,

View File

@ -78,12 +78,8 @@ public:
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateInIsolation(const Phrase &source

View File

@ -55,14 +55,9 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase

View File

@ -138,15 +138,10 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateWhenApplied(const Hypothesis& hypo,
ScoreComponentCollection* accumulator) const
{}

View File

@ -64,14 +64,9 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
FFState* EvaluateWhenApplied(
const Hypothesis& cur_hypo,

View File

@ -57,6 +57,7 @@
#include "moses/FF/SkeletonStatelessFF.h"
#include "moses/FF/SkeletonStatefulFF.h"
#include "moses/LM/SkeletonLM.h"
#include "moses/FF/SkeletonTranslationOptionListFeature.h"
#include "moses/LM/BilingualLM.h"
#include "SkeletonChangeInput.h"
#include "moses/TranslationModel/SkeletonPT.h"
@ -228,6 +229,7 @@ FeatureRegistry::FeatureRegistry()
MOSES_FNAME(SkeletonStatefulFF);
MOSES_FNAME(SkeletonLM);
MOSES_FNAME(SkeletonChangeInput);
MOSES_FNAME(SkeletonTranslationOptionListFeature);
MOSES_FNAME(SkeletonPT);
#ifdef HAVE_CMPH

View File

@ -12,7 +12,7 @@ namespace Moses
class Phrase;
class TargetPhrase;
class TargetPhraseCollection;
class TranslationOptionList;
class TranslationOption;
class Hypothesis;
class ChartHypothesis;
@ -140,12 +140,8 @@ public:
// It is guaranteed to be in the same order as the non-terms in the source phrase.
// For pb models, stackvec is NULL.
// No FF should set estimatedFutureScore in both overloads!
virtual void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const = 0;
virtual void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const = 0;
virtual void SetParameter(const std::string& key, const std::string& value);
virtual void ReadParameters();

View File

@ -90,14 +90,9 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
};

View File

@ -98,14 +98,9 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase

View File

@ -32,14 +32,9 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
virtual void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
virtual void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
virtual void EvaluateWhenApplied(const Hypothesis& hypo,
ScoreComponentCollection* accumulator) const

View File

@ -54,14 +54,9 @@ public:
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const;
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateWhenApplied(const Hypothesis& hypo,
ScoreComponentCollection* accumulator) const

View File

@ -62,14 +62,9 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase

View File

@ -27,12 +27,8 @@ public:
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const;
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
virtual void EvaluateWhenApplied(const Hypothesis& hypo,

View File

@ -30,14 +30,9 @@ public:
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const;
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateWhenApplied(const Hypothesis& hypo,
ScoreComponentCollection* accumulator) const;

View File

@ -45,14 +45,9 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase

View File

@ -61,14 +61,9 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown

View File

@ -40,14 +40,9 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
virtual void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown

View File

@ -173,14 +173,9 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{};
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
FFState* EvaluateWhenApplied(
const Hypothesis& cur_hypo,
const FFState* prev_state,

View File

@ -46,14 +46,9 @@ public:
, ScoreComponentCollection &estimatedFutureScore) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase

View File

@ -37,14 +37,9 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void SetParameter(const std::string& key, const std::string& value);
protected:

View File

@ -29,12 +29,8 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
virtual void EvaluateWhenApplied(const Hypothesis& hypo,

View File

@ -27,12 +27,8 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}

View File

@ -27,12 +27,8 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
virtual void EvaluateWhenApplied(const Hypothesis& hypo,

View File

@ -47,12 +47,8 @@ void SkeletonChangeInput::EvaluateWithSourceContext(const InputType &input
}
void SkeletonChangeInput::EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore) const
void SkeletonChangeInput::EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void SkeletonChangeInput::EvaluateWhenApplied(const Hypothesis& hypo,

View File

@ -29,12 +29,8 @@ public:
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const;
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const;
void EvaluateWhenApplied(const Hypothesis& hypo,
ScoreComponentCollection* accumulator) const;

View File

@ -37,12 +37,8 @@ void SkeletonStatefulFF::EvaluateWithSourceContext(const InputType &input
, ScoreComponentCollection *estimatedFutureScore) const
{}
void SkeletonStatefulFF::EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore) const
void SkeletonStatefulFF::EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
FFState* SkeletonStatefulFF::EvaluateWhenApplied(

View File

@ -41,12 +41,8 @@ public:
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const;
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const;
FFState* EvaluateWhenApplied(
const Hypothesis& cur_hypo,

View File

@ -43,12 +43,9 @@ void SkeletonStatelessFF::EvaluateWithSourceContext(const InputType &input
}
}
void SkeletonStatelessFF::EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore) const
void SkeletonStatelessFF::EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void SkeletonStatelessFF::EvaluateWhenApplied(const Hypothesis& hypo,

View File

@ -26,12 +26,8 @@ public:
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const;
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const;
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const;
void EvaluateWhenApplied(const Hypothesis& hypo,
ScoreComponentCollection* accumulator) const;

View File

@ -33,12 +33,8 @@ public:
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const {};
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateWhenApplied(const Hypothesis& hypo,

View File

@ -44,12 +44,8 @@ public:
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const;
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}

View File

@ -29,12 +29,8 @@ public:
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const;
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}

View File

@ -40,12 +40,8 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}

View File

@ -26,12 +26,8 @@ public:
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const;
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}

View File

@ -44,12 +44,8 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
virtual void EvaluateWhenApplied(const Hypothesis& hypo,

View File

@ -26,12 +26,8 @@ public:
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const;
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateWhenApplied(const Hypothesis& hypo,

View File

@ -60,12 +60,8 @@ public:
, ScoreComponentCollection &estimatedFutureScore) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void SetParameter(const std::string& key, const std::string& value);

View File

@ -200,12 +200,8 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateInIsolation(const Phrase &source

View File

@ -46,12 +46,8 @@ public:
ScoreComponentCollection* accumulator) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void ComputeFeatures(const Phrase &source,

View File

@ -63,12 +63,8 @@ public:
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const {};
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}

View File

@ -48,12 +48,8 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateInIsolation(const Phrase &source

View File

@ -48,12 +48,8 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}

View File

@ -69,12 +69,8 @@ public:
ScoreComponentCollection* accumulator) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}

View File

@ -91,6 +91,7 @@ public:
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection &estimatedFutureScore) const;
void EvaluateWithSourceContext(const InputType &input
, const InputPath &inputPath
, const TargetPhrase &targetPhrase
@ -99,15 +100,10 @@ public:
, ScoreComponentCollection *estimatedFutureScore = NULL) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
};
}

View File

@ -44,14 +44,9 @@ public:
, ScoreComponentCollection *estimatedFutureScore) const
{}
void EvaluateWithSourceContextCollection(const InputType &input
, const InputPath &inputPath
, const TargetPhraseCollection &targetPhraseCollection
, const StackVec *stackVec
, ScoreComponentCollection &scoreBreakdown
, ScoreComponentCollection *estimatedFutureScore = NULL) const
void EvaluateTranslationOptionListWithSourceContext(const InputType &input
, const TranslationOptionList &translationOptionList) const
{}
void EvaluateInIsolation(const Phrase &source
, const TargetPhrase &targetPhrase
, ScoreComponentCollection &scoreBreakdown

View File

@ -555,6 +555,7 @@ void TranslationOptionCollection::SetInputScore(const InputPath &inputPath, Part
void TranslationOptionCollection::EvaluateWithSourceContext()
{
const size_t size = m_source.GetSize();
for (size_t startPos = 0 ; startPos < size ; ++startPos) {
size_t maxSize = m_source.GetSize() - startPos;
size_t maxSizePhrase = StaticData::Instance().GetMaxPhraseLength();
@ -568,10 +569,26 @@ void TranslationOptionCollection::EvaluateWithSourceContext()
TranslationOption &transOpt = **iterTransOpt;
transOpt.EvaluateWithSourceContext(m_source);
}
EvaluateTranslatonOptionListWithSourceContext(transOptList);
}
}
}
void TranslationOptionCollection::EvaluateTranslatonOptionListWithSourceContext(
TranslationOptionList &translationOptionList) {
const std::vector<FeatureFunction*> &ffs = FeatureFunction::GetFeatureFunctions();
const StaticData &staticData = StaticData::Instance();
for (size_t i = 0; i < ffs.size(); ++i) {
const FeatureFunction &ff = *ffs[i];
if (! staticData.IsFeatureFunctionIgnored(ff)) {
ff.EvaluateTranslationOptionListWithSourceContext(m_source, translationOptionList);
}
}
}
void TranslationOptionCollection::Sort()
{
size_t size = m_source.GetSize();

View File

@ -81,7 +81,7 @@ protected:
void ProcessUnknownWord();
//! special handling of ONE unknown words.
virtual void ProcessOneUnknownWord(const InputPath &inputPath, size_t sourcePos, size_t length = 1, const ScorePair *inputScores = NULL);
//! pruning: only keep the top n (m_maxNoTransOptPerCoverage) elements */
void Prune();
@ -98,6 +98,8 @@ protected:
void EvaluateWithSourceContext();
void EvaluateTranslatonOptionListWithSourceContext(TranslationOptionList&);
void CacheLexReordering();
void GetTargetPhraseCollectionBatch();