|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
W
- public interface NgramLanguageModel<W>
Base interface for an n-gram language model, which exposes only inefficient
convenience methods. See ContextEncodedNgramLanguageModel
and
ArrayEncodedNgramLanguageModel
for more efficient accessors.
Nested Class Summary | |
---|---|
static class |
NgramLanguageModel.StaticMethods
|
Method Summary | |
---|---|
int |
getLmOrder()
Maximum size of n-grams stored by the model. |
float |
getLogProb(List<W> ngram)
Scores an n-gram. |
WordIndexer<W> |
getWordIndexer()
Each LM must have a WordIndexer which assigns integer IDs to each word W in the language. |
float |
scoreSentence(List<W> sentence)
Scores a complete sentence, taking appropriate care with the start- and end-of-sentence symbols. |
void |
setOovWordLogProb(float logProb)
Sets the (log) probability for an OOV word. |
Method Detail |
---|
int getLmOrder()
WordIndexer<W> getWordIndexer()
float scoreSentence(List<W> sentence)
float getLogProb(List<W> ngram)
ArrayEncodedNgramLanguageModel.getLogProb(int[], int, int)
and
ContextEncodedNgramLanguageModel.getLogProb(long, int, int, edu.berkeley.nlp.lm.ContextEncodedNgramLanguageModel.LmContextInfo)
.
void setOovWordLogProb(float logProb)
unk
tag probability.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |