|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.stanford.nlp.ie.UniformPrior<IN>
public class UniformPrior<IN extends CoreMap>
Uniform prior to be used for generic Gibbs inference in the ie.crf.CRFClassifier
| Field Summary | |
|---|---|
protected int |
backgroundSymbol
|
protected Index<java.lang.String> |
classIndex
|
protected java.util.List<IN> |
doc
|
protected int |
numClasses
|
protected int[] |
possibleValues
|
protected int[] |
sequence
|
| Constructor Summary | |
|---|---|
UniformPrior(java.lang.String backgroundSymbol,
Index<java.lang.String> classIndex,
java.util.List<IN> doc)
|
|
| Method Summary | |
|---|---|
int[] |
getPossibleValues(int position)
0...leftWindow-1 etc are null, leftWindow...length+leftWindow-1 are words, length+leftWindow...length+leftWindow+rightWindow-1 are null; |
int |
leftWindow()
How many positions to the left a position is dependent on. |
int |
length()
|
int |
rightWindow()
How many positions to the right a position is dependent on. |
double |
scoreOf(int[] sequence)
Computes the score assigned by this model to the whole sequence. |
double |
scoreOf(int[] sequence,
int position)
Computes the unnormalized log conditional distribution over values of the element at position pos 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 unnormalized log conditional distribution over values of the element at position pos in the sequence, conditioned on the values of the elements in 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int[] sequence
protected int backgroundSymbol
protected int numClasses
protected int[] possibleValues
protected Index<java.lang.String> classIndex
protected java.util.List<IN extends CoreMap> doc
| Constructor Detail |
|---|
public UniformPrior(java.lang.String backgroundSymbol,
Index<java.lang.String> classIndex,
java.util.List<IN> doc)
| Method Detail |
|---|
public double scoreOf(int[] sequence)
SequenceModel
scoreOf in interface SequenceModelsequence - the sequence to compute a score for
public double[] scoresOf(int[] sequence,
int position)
SequenceModel
scoresOf in interface SequenceModelsequence - the sequence containing the rest of the values to condition onposition - the position of the element to give a distribution for
public int[] getPossibleValues(int position)
SequenceModel
getPossibleValues in interface SequenceModelposition - the position
public int leftWindow()
SequenceModel
leftWindow in interface SequenceModelpublic int length()
length in interface SequenceModelpublic int rightWindow()
SequenceModel
rightWindow in interface SequenceModel
public double scoreOf(int[] sequence,
int position)
SequenceModel
scoreOf in interface SequenceModelsequence - the sequence containing the rest of the values to condition onposition - the position of the element to give a distribution for
public void setInitialSequence(int[] sequence)
SequenceListener
setInitialSequence in interface SequenceListener
public void updateSequenceElement(int[] sequence,
int pos,
int oldVal)
SequenceListener
updateSequenceElement in interface SequenceListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||