public abstract class EntityCachingAbstractSequencePrior<IN extends CoreMap> extends java.lang.Object implements ListeningSequenceModel
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
EntityCachingAbstractSequencePrior(java.lang.String backgroundSymbol,
Index<java.lang.String> classIndex,
java.util.List<IN> doc) |
Modifier and Type | Method and Description |
---|---|
boolean |
addingSingletonEntity(int[] sequence,
int position) |
boolean |
appendingEntity(int[] sequence,
int position) |
edu.stanford.nlp.ie.Entity |
extractEntity(int[] sequence,
int position)
extracts the entity starting at the given position
and adds it to the entity list.
|
double[] |
getConditionalDistribution(int[] sequence,
int position) |
int |
getNumClasses()
get the number of classes in the sequence model.
|
int[] |
getPossibleValues(int position)
Return the valid sequence labels (as integer indices) for a particular
position in the sequence.
|
boolean |
joiningTwoEntities(int[] sequence,
int position) |
int |
leftWindow()
How many label positions to the left influence the label assignment
at a particular position.
|
int |
length() |
boolean |
matches(edu.stanford.nlp.ie.Entity entity,
int position) |
boolean |
noChange(int[] sequence,
int position) |
int[] |
otherOccurrences(edu.stanford.nlp.ie.Entity entity)
finds other locations in the sequence where the sequence of
words in this entity occurs.
|
boolean |
prependingEntity(int[] sequence,
int position) |
boolean |
removingBeginningOfEntity(int[] sequence,
int position) |
boolean |
removingEndOfEntity(int[] sequence,
int position) |
int |
rightWindow()
How many label positions to the right influence the label assignment
at a particular position.
|
double |
scoreOf(int[] sequence,
int pos)
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[] initialSequence)
Informs this sequence listener that the value of the whole sequence is initialized to sequence.
|
boolean |
splittingTwoEntities(int[] sequence,
int position) |
static int[] |
toArray(java.util.List<java.lang.Integer> list) |
java.lang.String |
toString() |
java.lang.String |
toString(int pos) |
void |
updateSequenceElement(int[] sequence,
int position,
int oldVal)
Informs this sequence listener that the value of the element at position pos has changed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
scoreOf
protected int[] sequence
protected final int backgroundSymbol
protected final int numClasses
protected final int[] possibleValues
protected final Index<java.lang.String> classIndex
public int leftWindow()
SequenceModel
leftWindow
in interface SequenceModel
public int rightWindow()
SequenceModel
rightWindow
in interface SequenceModel
public int[] getPossibleValues(int position)
SequenceModel
getPossibleValues
in interface SequenceModel
position
- The positionpublic double scoreOf(int[] sequence, int pos)
SequenceModel
scoreOf
in interface SequenceModel
sequence
- The sequence containing the prediction and the rest of the
labels to condition onpos
- The position of the element to give a score forpublic int length()
length
in interface SequenceModel
public int getNumClasses()
public double[] getConditionalDistribution(int[] sequence, int position)
public double[] scoresOf(int[] sequence, int position)
SequenceModel
scoresOf
in interface SequenceModel
sequence
- The sequence containing the rest of the values to condition onposition
- The position of the element to give a distribution forpublic void setInitialSequence(int[] initialSequence)
SequenceListener
setInitialSequence
in interface SequenceListener
public edu.stanford.nlp.ie.Entity extractEntity(int[] sequence, int position)
public int[] otherOccurrences(edu.stanford.nlp.ie.Entity entity)
public static int[] toArray(java.util.List<java.lang.Integer> list)
public boolean matches(edu.stanford.nlp.ie.Entity entity, int position)
public boolean joiningTwoEntities(int[] sequence, int position)
public boolean splittingTwoEntities(int[] sequence, int position)
public boolean appendingEntity(int[] sequence, int position)
public boolean prependingEntity(int[] sequence, int position)
public boolean addingSingletonEntity(int[] sequence, int position)
public boolean removingEndOfEntity(int[] sequence, int position)
public boolean removingBeginningOfEntity(int[] sequence, int position)
public boolean noChange(int[] sequence, int position)
public void updateSequenceElement(int[] sequence, int position, int oldVal)
SequenceListener
updateSequenceElement
in interface SequenceListener
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int pos)