public class DeletedInterpolationContextualSmoother extends AbstractContextualSmoother implements ContextualSmoother
A contextual smoother which a weighted combination of unigram and bigram probabilities (for a bigram tagger) or unigram bigram, and trigram probabilities (for a trigram tagger).
Modifier and Type | Field and Description |
---|---|
protected double[] |
bigramWeights
Bigram weights for lexical smoothing.
|
protected double[] |
trigramWeights
Trigram weights for lexical smoothing.
|
cachedContextualProbabilities, logger, partOfSpeechTagger
Constructor and Description |
---|
DeletedInterpolationContextualSmoother()
Create a deleted interpolation contextual smoother.
|
Modifier and Type | Method and Description |
---|---|
Probability |
contextualProbability(java.lang.String tag,
java.lang.String previousTag)
Compute contextual probability of a tag given the previous tag.
|
Probability |
contextualProbability(java.lang.String tag,
java.lang.String previousTag,
java.lang.String previousPreviousTag)
Compute contextual probability of a tag given the previous tags.
|
java.lang.String |
toString()
Description of this smoother for display.
|
cachedProbabilitiesCount, clearCachedProbabilities, getLogger, setLogger, setPartOfSpeechTagger
close
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
cachedProbabilitiesCount, clearCachedProbabilities, setPartOfSpeechTagger
protected double[] bigramWeights
protected double[] trigramWeights
public DeletedInterpolationContextualSmoother()
public Probability contextualProbability(java.lang.String tag, java.lang.String previousTag)
contextualProbability
in interface ContextualSmoother
contextualProbability
in class AbstractContextualSmoother
tag
- The current tag.previousTag
- The previous tag.We compute the contextual probability p( tag | previousTag ) using weights determined by deleted interpolation. The smoothed contextual probability is given by:
p*( tag | previousTag ) = l1 * p( tag ) + l2 * p( previousTag , tag )
where l1 and l2 are the unigram and bigram weights respectively.
public Probability contextualProbability(java.lang.String tag, java.lang.String previousTag, java.lang.String previousPreviousTag)
contextualProbability
in interface ContextualSmoother
tag
- The current tag.previousTag
- The previous tag.previousPreviousTag
- The previous tag of the previous tag.We compute the contextual probability p( tag | previousPreviousTag , previousTag ) using weights determined by deleted interpolation. The smoothed contextual probability is given by:
p*( tag | previousPreviousTag , previousTag ) = l1 * p( tag ) + l2 * p( previousTag , tag ) + l3 * o( previousPreviousTag , previousTag , tag )
where l1, l2, and l3 are the unigram, bigram, and trigram weights respectively.
public java.lang.String toString()
toString
in class java.lang.Object