Joshua
open source statistical hierarchical phrase-based machine translation system
|
Public Member Functions | |
boolean | equals (Object obj) |
int | hashCode () |
String | toString () |
Candidate (List< Hypothesis > hypotheses, TargetPhrases phrases, Span span, float delta) | |
Candidate (List< Hypothesis > hypotheses, TargetPhrases phrases, Span span, float delta, int[] ranks) | |
Candidate[] | extend () |
Candidate | extendHypothesis () |
Candidate | extendPhrase () |
int | compareTo (Candidate other) |
Span | getSpan () |
Hypothesis | getHypothesis () |
Rule | getRule () |
List< HGNode > | getTailNodes () |
Coverage | getCoverage () |
void | setResult (ComputeNodeResult result) |
float | score () |
float | getFutureEstimate () |
List< DPState > | getStates () |
ComputeNodeResult | getResult () |
Public Attributes | |
Span | span |
Package Attributes | |
float | future_delta |
Private Attributes | |
List< Hypothesis > | hypotheses |
TargetPhrases | phrases |
int[] | ranks |
ComputeNodeResult | result |
joshua.decoder.phrase.Candidate.Candidate | ( | List< Hypothesis > | hypotheses, |
TargetPhrases | phrases, | ||
Span | span, | ||
float | delta | ||
) |
joshua.decoder.phrase.Candidate.Candidate | ( | List< Hypothesis > | hypotheses, |
TargetPhrases | phrases, | ||
Span | span, | ||
float | delta, | ||
int[] | ranks | ||
) |
int joshua.decoder.phrase.Candidate.compareTo | ( | Candidate | other | ) |
boolean joshua.decoder.phrase.Candidate.equals | ( | Object | obj | ) |
When candidate objects are extended, the new one is initialized with the same underlying "phrases" and "hypotheses" and "span" objects. So these all have to be equal, as well as the ranks.
This is used to prevent cube pruning from adding the same candidate twice, having reached a point in the cube via different paths.
Extends the cube pruning dot in both directions and returns the resulting set. Either of the results can be null if the end of their respective lists is reached.
Extends the cube pruning dot along the dimension of existing hypotheses.
Extends the cube pruning dot along the dimension of candidate target sides.
Returns the bit vector of this hypothesis. The bit vector is computed by ORing the coverage vector of the tail node (hypothesis) and the source span of phrases in this candidate.
A candidate is a (hypothesis, target phrase) pairing. The hypothesis and target phrase are drawn from a list that is indexed by (ranks[0], ranks[1]), respectively. This is a shortcut to return the hypothesis of the candidate pair.
Returns the input span from which the phrases for this candidates were gathered.
The hypotheses list is a list of tail pointers. This function returns the tail pointer currently selected by the value in ranks.
float joshua.decoder.phrase.Candidate.score | ( | ) |
This returns the sum of two costs: the HypoState cost + the transition cost. The HypoState cost is in turn the sum of two costs: the Viterbi cost of the underlying hypothesis, and the adjustment to the future score incurred by translating the words under the source phrase being added. The transition cost is the sum of new features incurred along the transition (mostly, the language model costs).
The Future Cost item should probably just be implemented as another kind of feature function, but it would require some reworking of that interface, which isn't worth it.
void joshua.decoder.phrase.Candidate.setResult | ( | ComputeNodeResult | result | ) |
Sets the result of a candidate (should just be moved to the constructor).
result |
String joshua.decoder.phrase.Candidate.toString | ( | ) |
float joshua.decoder.phrase.Candidate.future_delta [package] |
List<Hypothesis> joshua.decoder.phrase.Candidate.hypotheses [private] |
int [] joshua.decoder.phrase.Candidate.ranks [private] |