public class UniformPrior<IN extends CoreMap> extends Object implements SequenceModel, SequenceListener
| Modifier and Type | Field and Description |
|---|---|
protected int |
backgroundSymbol |
protected Index<String> |
classIndex |
protected List<IN> |
doc |
protected int |
numClasses |
protected int[] |
possibleValues |
protected int[] |
sequence |
| Constructor and Description |
|---|
UniformPrior(String backgroundSymbol,
Index<String> classIndex,
List<IN> doc) |
| Modifier and Type | Method and Description |
|---|---|
int[] |
getPossibleValues(int position)
Return the valid sequence labels (as integer indices) for a particular
position in the sequence.
|
int |
leftWindow()
How many label positions to the left influence the label assignment
at a particular position.
|
int |
length() |
int |
rightWindow()
How many label positions to the right influence the label assignment
at a particular position.
|
double |
scoreOf(int[] sequence)
Computes the score assigned by this model to the whole sequence.
|
double |
scoreOf(int[] sequence,
int position)
Computes the score of the element at the given position in the sequence,
conditioned on the values of the elements in all other positions of the
provided sequence.
|
double[] |
scoresOf(int[] sequence,
int position)
Computes the scores of labels for the element at the given position in
the sequence, conditioned on the values of the labels at all other
positions of the provided sequence.
|
void |
setInitialSequence(int[] sequence)
Informs this sequence listener that the value of the whole sequence is initialized to sequence
|
void |
updateSequenceElement(int[] sequence,
int pos,
int oldVal)
Informs this sequence listener that the value of the element at position pos has changed.
|
protected int[] sequence
protected int backgroundSymbol
protected int numClasses
protected int[] possibleValues
public double scoreOf(int[] sequence)
SequenceModelscoreOf in interface SequenceModelsequence - The sequence of labels to compute a score forpublic double[] scoresOf(int[] sequence,
int position)
SequenceModelscoresOf in interface SequenceModelsequence - The sequence containing the rest of the values to condition onposition - The position of the element to give a distribution forpublic int[] getPossibleValues(int position)
SequenceModelgetPossibleValues in interface SequenceModelposition - The positionpublic int leftWindow()
SequenceModelleftWindow in interface SequenceModelpublic int length()
length in interface SequenceModelpublic int rightWindow()
SequenceModelrightWindow in interface SequenceModelpublic double scoreOf(int[] sequence,
int position)
SequenceModelscoreOf in interface SequenceModelsequence - The sequence containing the prediction and the rest of the
labels to condition onposition - The position of the element to give a score forpublic void setInitialSequence(int[] sequence)
SequenceListenersetInitialSequence in interface SequenceListenerpublic void updateSequenceElement(int[] sequence,
int pos,
int oldVal)
SequenceListenerupdateSequenceElement in interface SequenceListener