public static interface LanguageModel.Conditional extends LanguageModel
LanguageModel.Conditional is a language model
that implements conditional estimates of characters given
previous characters. A conditional model should also be marked
as either a LanguageModel.Process or LanguageModel.Sequence model.
A conditional language model should have conditional estimates that are appropriate for the joint estimates. For a process language model:
log2Estimate(cs,start,end)
=
Σstart < i <= end
log2ConditionalEstimate(cs,start,i)
For a sequence language model, the situation is more complex.
The joint estimate includes an estimate of the end-of-stream or
a length estimate in addition to the per-character conditional
log estimate.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 cSeq)
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.
|
char[] |
observedCharacters()
Returns the array of characters that have been observed
for this model.
|
log2Estimate, log2Estimatedouble log2ConditionalEstimate(char[] cs,
int start,
int end)
cs - Underlying array of characters.start - Index of first character in slice.end - One plus the index of the last character in the slice.IndexOutOfBoundsException - If the start and end
minus one points are outside of the bounds of the character
array.double log2ConditionalEstimate(CharSequence cSeq)
cSeq - Character sequence to estimate.IndexOutOfBoundsException - If the character sequence is
length zero.char[] observedCharacters()
Copyright © 2019 Alias-i, Inc.. All rights reserved.