|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.ie.EntityCachingAbstractSequencePriorBIO<IN>
public abstract class EntityCachingAbstractSequencePriorBIO<IN extends CoreMap>
This class keeps track of all labeled entities and updates the its list whenever the label at a point gets changed. This allows you to not have to regereate the list everytime, which can be quite inefficient.
Field Summary | |
---|---|
protected int |
backgroundSymbol
|
protected Index<java.lang.String> |
classIndex
|
protected int |
numClasses
|
protected int[] |
possibleValues
|
protected int[] |
sequence
|
protected Index<java.lang.String> |
tagIndex
|
Constructor Summary | |
---|---|
EntityCachingAbstractSequencePriorBIO(java.lang.String backgroundSymbol,
Index<java.lang.String> classIndex,
Index<java.lang.String> tagIndex,
java.util.List<IN> doc)
|
Method Summary | |
---|---|
edu.stanford.nlp.ie.EntityBIO |
extractEntity(int[] sequence,
int position,
java.lang.String tag)
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)
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()
|
boolean |
matches(edu.stanford.nlp.ie.EntityBIO entity,
int position)
|
int[] |
otherOccurrences(edu.stanford.nlp.ie.EntityBIO entity)
finds other locations in the sequence where the sequence of words in this entity occurs. |
int |
rightWindow()
How many positions to the right a position is dependent on. |
double |
scoreOf(int[] sequence,
int pos)
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[] initialSequence)
Informs this sequence listener that the value of the whole sequence is initialized to sequence |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface edu.stanford.nlp.sequences.SequenceModel |
---|
scoreOf |
Field Detail |
---|
protected int[] sequence
protected int backgroundSymbol
protected int numClasses
protected int[] possibleValues
protected Index<java.lang.String> classIndex
protected Index<java.lang.String> tagIndex
Constructor Detail |
---|
public EntityCachingAbstractSequencePriorBIO(java.lang.String backgroundSymbol, Index<java.lang.String> classIndex, Index<java.lang.String> tagIndex, java.util.List<IN> doc)
Method Detail |
---|
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 position
public double scoreOf(int[] sequence, int pos)
SequenceModel
scoreOf
in interface SequenceModel
sequence
- the sequence containing the rest of the values to condition onpos
- the position of the element to give a distribution for
public 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 for
public void setInitialSequence(int[] initialSequence)
SequenceListener
setInitialSequence
in interface SequenceListener
public edu.stanford.nlp.ie.EntityBIO extractEntity(int[] sequence, int position, java.lang.String tag)
public int[] otherOccurrences(edu.stanford.nlp.ie.EntityBIO entity)
public static int[] toArray(java.util.List<java.lang.Integer> list)
public boolean matches(edu.stanford.nlp.ie.EntityBIO entity, 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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |