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

List of all members.

Public Member Functions

 AbstractLM (int order)
final double sentenceLogProbability (List< Integer > sentence, int order, int startIndex)
final double ngramLogProbability (int[] ngram)
final double ngramLogProbability (int[] ngram, int order)
final double logProbOfBackoffState (List< Integer > ngram, int order, int qtyAdditionalBackoffWeight)
final double logProbabilityOfBackoffState (int[] ngram, int order, int qtyAdditionalBackoffWeight)
int[] leftEquivalentState (int[] originalState, int order, double[] cost)
int[] rightEquivalentState (int[] originalState, int order)

Protected Member Functions

abstract double ngramLogProbability_helper (int[] ngram, int order)
abstract double logProbabilityOfBackoffState_helper (int[] ngram, int order, int qtyAdditionalBackoffWeight)

Detailed Description

This class implements NGramLanguageModel by creating wrappers around the necessary functions to capture common errors. Most methods are declared final, in an attempt to limit what subclasses may be defined.

Author:
Zhifei Li, zhife.nosp@m.i.wo.nosp@m.rk@gm.nosp@m.ail..nosp@m.com
Version:
$LastChangedDate$

Constructor & Destructor Documentation


Member Function Documentation

int [] joshua.decoder.ff.lm.AbstractLM.leftEquivalentState ( int[]  originalState,
int  order,
double[]  cost 
)
final double joshua.decoder.ff.lm.AbstractLM.logProbabilityOfBackoffState ( int[]  ngram,
int  order,
int  qtyAdditionalBackoffWeight 
)

Will never be called, because BACKOFF_LEFT_LM_STATE_SYM_ID token will never exist. However, were it to be called, it should return a probability of 1 (logprob of 0).

Reimplemented from joshua.decoder.ff.lm.DefaultNGramLanguageModel.

Here is the call graph for this function:

Here is the caller graph for this function:

abstract double joshua.decoder.ff.lm.AbstractLM.logProbabilityOfBackoffState_helper ( int[]  ngram,
int  order,
int  qtyAdditionalBackoffWeight 
) [protected, pure virtual]

Implemented in joshua.decoder.ff.lm.bloomfilter_lm.BloomFilterLanguageModel, joshua.decoder.ff.lm.buildin_lm.LMGrammarJAVA, and joshua.decoder.ff.lm.berkeley_lm.LMGrammarBerkeley.

Here is the caller graph for this function:

final double joshua.decoder.ff.lm.AbstractLM.logProbOfBackoffState ( List< Integer >  ngram,
int  order,
int  qtyAdditionalBackoffWeight 
)
Deprecated:
this function is much slower than the int[] version

Reimplemented from joshua.decoder.ff.lm.DefaultNGramLanguageModel.

Here is the call graph for this function:

Reimplemented from joshua.decoder.ff.lm.DefaultNGramLanguageModel.

Here is the caller graph for this function:

final double joshua.decoder.ff.lm.AbstractLM.ngramLogProbability ( int[]  ngram,
int  order 
) [virtual]

Implements joshua.decoder.ff.lm.DefaultNGramLanguageModel.

Here is the call graph for this function:

abstract double joshua.decoder.ff.lm.AbstractLM.ngramLogProbability_helper ( int[]  ngram,
int  order 
) [protected, pure virtual]

Implemented in joshua.decoder.ff.lm.bloomfilter_lm.BloomFilterLanguageModel, joshua.decoder.ff.lm.buildin_lm.LMGrammarJAVA, and joshua.decoder.ff.lm.berkeley_lm.LMGrammarBerkeley.

Here is the caller graph for this function:

final double joshua.decoder.ff.lm.AbstractLM.sentenceLogProbability ( List< Integer >  sentence,
int  order,
int  startIndex 
)
Parameters:
sentencethe sentence to be scored
orderthe order of N-grams for the LM
startIndexthe index of first event-word we want to get its probability; if we want to get the prob for the whole sentence, then startIndex should be 1
Returns:
the LogP of the whole sentence

Reimplemented from joshua.decoder.ff.lm.DefaultNGramLanguageModel.