Interface NgramLanguageModel<W>

Type Parameters:
W -
All Known Subinterfaces:
ArrayEncodedNgramLanguageModel<W>, ContextEncodedNgramLanguageModel<W>
All Known Implementing Classes:
AbstractArrayEncodedNgramLanguageModel, AbstractContextEncodedNgramLanguageModel, AbstractNgramLanguageModel, ArrayEncodedCachingLmWrapper, ArrayEncodedProbBackoffLm, ContextEncodedCachingLmWrapper, ContextEncodedProbBackoffLm, KneserNeyLmReaderCallback, StupidBackoffLm

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.
Author:
adampauls
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Maximum size of n-grams stored by the model.
    float
    getLogProb(List<W> ngram)
    Scores an n-gram.
    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.