public class CompiledNGramBoundaryLM extends Object implements LanguageModel.Sequence, LanguageModel.Conditional, Model<CharSequence>
CompiledNGramBoundaryLM is constructed by reading
the serialized form of an instance of NGramBoundaryLM.
The serialization format is the boundary character followed by the serialization of an n-gram process language model.
LanguageModel.Conditional, LanguageModel.Dynamic, LanguageModel.Process, LanguageModel.Sequence, LanguageModel.Tokenized| Modifier and Type | Method and Description |
|---|---|
double |
log2ConditionalEstimate(char[] cs,
int start,
int end)
Returns the log (base 2) of the probability estimate for the
conditional probability of the last character in the specified
slice given the previous characters.
|
double |
log2ConditionalEstimate(CharSequence cs)
Returns the log (base 2) of the probabilty estimate for the
conditional probability of the last character in the specified
character sequence given the previous characters.
|
double |
log2Estimate(char[] cs,
int start,
int end)
Returns an estimate of the log (base 2) probability of the
specified character slice.
|
double |
log2Estimate(CharSequence cs)
Returns an estimate of the log (base 2) probability of the
specified character sequence.
|
double |
log2Prob(CharSequence cSeq)
This method is a convenience impelementation of the
Model interface which delegates the call to log2Estimate(CharSequence). |
char[] |
observedCharacters()
Returns the characters that have been observed for this
language model, including the special boundary character.
|
double |
prob(CharSequence cSeq)
This method is a convenience implementation of the
Model
interface which returns the result of raising 2.0 to the
power of the result of a call to log2Estimate(CharSequence). |
public char[] observedCharacters()
observedCharacters in interface LanguageModel.Conditionalpublic double log2ConditionalEstimate(CharSequence cs)
LanguageModel.Conditionallog2ConditionalEstimate in interface LanguageModel.Conditionalcs - Character sequence to estimate.public double log2ConditionalEstimate(char[] cs,
int start,
int end)
LanguageModel.Conditionallog2ConditionalEstimate in interface LanguageModel.Conditionalcs - Underlying array of characters.start - Index of first character in slice.end - One plus the index of the last character in the slice.public double log2Estimate(CharSequence cs)
LanguageModellog2Estimate in interface LanguageModelcs - Character sequence to estimate.public double log2Estimate(char[] cs,
int start,
int end)
LanguageModellog2Estimate in interface LanguageModelcs - Underlying array of characters.start - Index of first character in slice.end - One plus index of last character in slice.public double log2Prob(CharSequence cSeq)
Model interface which delegates the call to log2Estimate(CharSequence).log2Prob in interface Model<CharSequence>cSeq - Character sequence whose probability is returned.public double prob(CharSequence cSeq)
Model
interface which returns the result of raising 2.0 to the
power of the result of a call to log2Estimate(CharSequence).prob in interface Model<CharSequence>cSeq - Character sequence whose probability is returned.Copyright © 2019 Alias-i, Inc.. All rights reserved.