コード例 #1
0
void WordPenaltyProducer::Evaluate(
    const PhraseBasedFeatureContext& context,
    ScoreComponentCollection* out) const
{
	const TargetPhrase& tp = context.GetTargetPhrase();
  out->PlusEquals(this, -static_cast<float>(tp.GetSize()));
}
コード例 #2
0
void SourceWordDeletionFeature::Evaluate(
            const PhraseBasedFeatureContext& context,
            ScoreComponentCollection* accumulator) const
{
	const TargetPhrase& targetPhrase = context.GetTargetPhrase();
	const AlignmentInfo &alignmentInfo = targetPhrase.GetAlignTerm();
	ComputeFeatures(targetPhrase, accumulator, alignmentInfo);
}
コード例 #3
0
void TargetWordInsertionFeature::Evaluate(
                      const PhraseBasedFeatureContext& context,
                      ScoreComponentCollection* accumulator) const
{
	const TargetPhrase& targetPhrase = context.GetTargetPhrase();
	const AlignmentInfo &alignmentInfo = targetPhrase.GetAlignmentInfo();
	const AlignmentInfo::CollType &alignment = alignmentInfo.GetAlignments();
	ComputeFeatures(targetPhrase, accumulator, alignment);
}
コード例 #4
0
	void CacheBasedLanguageModel::Evaluate(const PhraseBasedFeatureContext& context, ScoreComponentCollection* accumulator) const
	{
		const TargetPhrase& tp = context.GetTargetPhrase();
		Evaluate(tp, accumulator);
	}
コード例 #5
0
  void HyperParameterAsWeight::Evaluate(const PhraseBasedFeatureContext& context, ScoreComponentCollection* accumulator) const {
	  const TargetPhrase& tp = context.GetTargetPhrase();
	  Evaluate(tp, accumulator);
  }