public abstract class AbstractNgramLanguageModel<W> extends java.lang.Object implements NgramLanguageModel<W>, java.io.Serializable
NgramLanguageModel.StaticMethods
Modifier and Type | Field and Description |
---|---|
protected int |
lmOrder |
protected float |
oovWordLogProb
Fixed constant returned when computing the log probability for an n-gram
whose last word is not in the vocabulary.
|
Constructor and Description |
---|
AbstractNgramLanguageModel(int lmOrder,
WordIndexer<W> wordIndexer,
float oovWordLogProb) |
Modifier and Type | Method and Description |
---|---|
int |
getLmOrder()
Maximum size of n-grams stored by the model.
|
WordIndexer<W> |
getWordIndexer()
Each LM must have a WordIndexer which assigns integer IDs to each word W
in the language.
|
void |
setOovWordLogProb(float oovWordLogProb)
Sets the (log) probability for an OOV word.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLogProb, scoreSentence
protected final int lmOrder
protected float oovWordLogProb
unk
tag probability.public AbstractNgramLanguageModel(int lmOrder, WordIndexer<W> wordIndexer, float oovWordLogProb)
public int getLmOrder()
NgramLanguageModel
getLmOrder
in interface NgramLanguageModel<W>
public WordIndexer<W> getWordIndexer()
NgramLanguageModel
getWordIndexer
in interface NgramLanguageModel<W>
public void setOovWordLogProb(float oovWordLogProb)
NgramLanguageModel
unk
tag probability.setOovWordLogProb
in interface NgramLanguageModel<W>