edu.umn.cs.nlp.mt.chiang2007
Class BilingualTranslationRule
java.lang.Object
edu.umn.cs.nlp.mt.TranslationRule
edu.umn.cs.nlp.mt.chiang2007.BilingualTranslationRule
- All Implemented Interfaces:
- Scorable, Comparable<TranslationRule>
public class BilingualTranslationRule
- extends TranslationRule
The left-hand side of a Chiang-style translation rule, including associated rule features.
- Version:
- $LastChangedDate: 2007-07-24 16:48:53 -0500 (Tue, 24 Jul 2007) $
- Author:
- Lane Schwartz
- See Also:
- "A Hierarchical Phrase-Based Model for Statistical Machine Translation" by David Chiang (ACL, 2005)
Constructor Summary |
BilingualTranslationRule(String targetLanguageRHS)
Construct a bilingual translation rule with default values for the log-linear features. |
BilingualTranslationRule(String targetLanguageRHS,
double lexLogProbSourceGivenTarget,
double lexLogProbTargetGivenSource,
double ruleLogProbSourceGivenTarget,
double ruleLogProbTargetGivenSource)
Construct a bilingual translation rule with the specified log-linear feature values. |
BilingualTranslationRule
public BilingualTranslationRule(String targetLanguageRHS,
double lexLogProbSourceGivenTarget,
double lexLogProbTargetGivenSource,
double ruleLogProbSourceGivenTarget,
double ruleLogProbTargetGivenSource)
- Construct a bilingual translation rule with the specified log-linear feature values.
- Parameters:
targetLanguageRHS
- Target language right-hand side of the rulelexLogProbSourceGivenTarget
- Log-linear feature representing the log probabilibity of the source language words given the target language wordslexLogProbTargetGivenSource
- Log-linear feature representing the log probabilibity of the target language words given the source language wordsruleLogProbSourceGivenTarget
- Log-linear feature representing the log probabilibity of the source language phrase given the target language phraseruleLogProbTargetGivenSource
- Log-linear feature representing the log probabilibity of the target language phrase given the source language phrase
BilingualTranslationRule
public BilingualTranslationRule(String targetLanguageRHS)
- Construct a bilingual translation rule with default values for the log-linear features.
- Parameters:
targetLanguageRHS
- Target language right-hand side of the rule
getTargetLanguageRHS
public String getTargetLanguageRHS()
- Get the target language right-hand side of the rule
- Specified by:
getTargetLanguageRHS
in class TranslationRule
- Returns:
- Target language right-hand side of the rule
getLexLogProbSourceGivenTarget
public double getLexLogProbSourceGivenTarget()
- Returns:
- the lexLogProbSourceGivenTarget
getLexLogProbTargetGivenSource
public double getLexLogProbTargetGivenSource()
- Returns:
- the lexLogProbTargetGivenSource
getRuleLogProbSourceGivenTarget
public double getRuleLogProbSourceGivenTarget()
- Returns:
- the ruleLogProbSourceGivenTarget
getRuleLogProbTargetGivenSource
public double getRuleLogProbTargetGivenSource()
- Returns:
- the ruleLogProbTargetGivenSource
getSymbol
public String getSymbol()
- Specified by:
getSymbol
in class TranslationRule
getFeatures
public LoglinearTranslationFeatures getFeatures()
- Specified by:
getFeatures
in class TranslationRule
getScore
public double getScore()
- Description copied from interface:
Scorable
- Get score
- Specified by:
getScore
in interface Scorable
- Specified by:
getScore
in class TranslationRule
- Returns:
- score
toString
public String toString()
- Overrides:
toString
in class Object
getNumberOfTargetWords
public int getNumberOfTargetWords()
- Specified by:
getNumberOfTargetWords
in class TranslationRule