Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
joshua.decoder.ff.FeatureFunction Interface Reference
Inheritance diagram for joshua.decoder.ff.FeatureFunction:
[legend]

List of all members.

Public Member Functions

void setFeatureID (int id)
int getFeatureID ()
void setWeight (double weight)
double getWeight ()
boolean isStateful ()
void setStateID (int stateID)
int getStateID ()
double estimateLogP (Rule rule, int sentID)
double estimateFutureLogP (Rule rule, DPState curDPState, int sentID)
double transitionLogP (Rule rule, List< HGNode > antNodes, int spanStart, int spanEnd, SourcePath srcPath, int sentID)
double transitionLogP (HyperEdge edge, int spanStart, int spanEnd, int sentID)
double finalTransitionLogP (HGNode antNode, int spanStart, int spanEnd, SourcePath srcPath, int sentID)
double finalTransitionLogP (HyperEdge edge, int spanStart, int spanEnd, int sentID)

Detailed Description

This interface provide ways to calculate logP based on rule and state information. In order to implement a new feature function you must (1) implement this FeatureFunction interface, and (2) implement the FFTransitionResult and FFDPState interfaces. BUG: the distinction between those latter two interfaces is unclear.

Author:
wren ng thornton wren@.nosp@m.user.nosp@m.s.sou.nosp@m.rcef.nosp@m.orge..nosp@m.net
Zhifei Li, zhife.nosp@m.i.wo.nosp@m.rk@gm.nosp@m.ail..nosp@m.com
Version:
$LastChangedDate$

Member Function Documentation

double joshua.decoder.ff.FeatureFunction.estimateFutureLogP ( Rule  rule,
DPState  curDPState,
int  sentID 
)

estimate future logP, e.g., the logPs of partial n-grams asscociated with the left-edge ngram state

Implemented in joshua.decoder.ff.lm.LanguageModelFF, joshua.decoder.ff.DefaultStatelessFF, and joshua.decoder.ff.similarity.EdgePhraseSimilarityFF.

double joshua.decoder.ff.FeatureFunction.estimateLogP ( Rule  rule,
int  sentID 
)

sentID might be useful for sentence-specific features (e.g., oralce model) It is used when initializing translation grammars (for pruning purpose, and to get stateless logP for each rule). This is also required to sort the rules (required by Cube-pruning).

Implemented in joshua.decoder.ff.lm.LanguageModelFF, and joshua.decoder.ff.similarity.EdgePhraseSimilarityFF.

Here is the caller graph for this function:

double joshua.decoder.ff.FeatureFunction.finalTransitionLogP ( HGNode  antNode,
int  spanStart,
int  spanEnd,
SourcePath  srcPath,
int  sentID 
)

Edges calling finalTransition do not have concret rules associated with them.

Implemented in joshua.decoder.ff.similarity.EdgePhraseSimilarityFF, joshua.decoder.ff.lm.LanguageModelFF, and joshua.decoder.ff.DefaultStatelessFF.

double joshua.decoder.ff.FeatureFunction.finalTransitionLogP ( HyperEdge  edge,
int  spanStart,
int  spanEnd,
int  sentID 
)

It is essential to make sure the feature ID is unique for each feature.

double joshua.decoder.ff.FeatureFunction.transitionLogP ( HyperEdge  edge,
int  spanStart,
int  spanEnd,
int  sentID 
)