|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umn.cs.nlp.mt.huangchiang2005.Hyperarc<ChartCellEntry,Translation>
edu.umn.cs.nlp.mt.chiang2007.RuleApplication
public class RuleApplication
Represents an application of a context-free rule in a CKY+ parse chart.
The k-best extraction technique used in Huang & Chiang (2005) requires that a parse chart be viewed as a hypergraph. In that context, a RuleApplication serves as a hyperarc in a hypergraph.
Field Summary | |
---|---|
static String |
ELIDE_STAR
A constant holding a special placeholder symbol used when eliding a target language string. |
Fields inherited from class edu.umn.cs.nlp.mt.huangchiang2005.Hyperarc |
---|
head, tail |
Constructor Summary | |
---|---|
RuleApplication(ChartCellEntry terminalEntry)
|
|
RuleApplication(TranslationRule rule,
LanguageModel languageModel,
ChartCellEntry head,
List<ChartCellEntry> tail)
Construct a RuleApplication. |
Method Summary | |
---|---|
int |
compareTo(RuleApplication r)
|
protected static String |
elide(String targetLanguagePhrase)
Implements the q function from Chiang (2007) |
Translation |
getDerivation(List<Translation> children)
|
String |
getElidedTargetLanguagePhrase()
|
LoglinearTranslationFeatures |
getFeatures()
|
protected static double |
getLanguageModelScore(LanguageModel languageModel,
String[] words)
Implements the p function from Chiang (2007) |
static int |
getNGramOrder()
|
double |
getRawScore()
Get the score for this item, without the pruning heuristic. |
LoglinearTranslationFeatures |
getRuleFeatures()
|
double |
getScore()
Get the score for this item, with the pruning heuristic added in. |
double |
getWeight()
|
boolean |
isTerminal()
|
static void |
main(String[] args)
|
static void |
setNGramOrder(int order)
|
String |
toString()
|
String |
toString(List<Derivation> derivations)
|
Methods inherited from class edu.umn.cs.nlp.mt.huangchiang2005.Hyperarc |
---|
arity, isSourceVertex, naiveMult, tail |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ELIDE_STAR
5.3.2 of "Hierarchical Phrase-Based Translation" by David Chiang (Computational Linguistics, 2007)
,
Constant Field ValuesConstructor Detail |
---|
public RuleApplication(TranslationRule rule, LanguageModel languageModel, ChartCellEntry head, List<ChartCellEntry> tail)
rule
- languageModel
- head
- tail
- public RuleApplication(ChartCellEntry terminalEntry)
Method Detail |
---|
public static void setNGramOrder(int order)
public static int getNGramOrder()
public boolean isTerminal()
public int compareTo(RuleApplication r)
compareTo
in interface Comparable<RuleApplication>
public Translation getDerivation(List<Translation> children)
getDerivation
in class Hyperarc<ChartCellEntry,Translation>
public LoglinearTranslationFeatures getRuleFeatures()
public LoglinearTranslationFeatures getFeatures()
public double getWeight()
getWeight
in class Hyperarc<ChartCellEntry,Translation>
public double getScore()
getScore
in interface Scorable
public double getRawScore()
public String toString()
toString
in class Object
public String toString(List<Derivation> derivations)
public String getElidedTargetLanguagePhrase()
protected static String elide(String targetLanguagePhrase)
protected static double getLanguageModelScore(LanguageModel languageModel, String[] words)
languageModel
- The language model to use in scoringwords
- The possibly elided phrase to scorepublic static void main(String[] args) throws FileNotFoundException
FileNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |