|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.ie.EntityCachingAbstractSequencePrior<IN>
public abstract class EntityCachingAbstractSequencePrior<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<String> |
classIndex
|
protected List<IN> |
doc
|
protected int |
numClasses
|
protected int[] |
possibleValues
|
protected int[] |
sequence
|
Constructor Summary | |
---|---|
EntityCachingAbstractSequencePrior(String backgroundSymbol,
Index<String> classIndex,
List<IN> doc)
|
Method Summary | |
---|---|
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)
0...leftWindow-1 etc are null, leftWindow...length+leftWindow-1 are words, length+leftWindow...length+leftWindow+rightWindow-1 are null; |
boolean |
joiningTwoEntities(int[] sequence,
int position)
|
int |
leftWindow()
How many positions to the left a position is dependent on. |
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 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 |
boolean |
splittingTwoEntities(int[] sequence,
int position)
|
static int[] |
toArray(List<Integer> list)
|
String |
toString()
|
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<String> classIndex
protected List<IN extends CoreMap> doc
Constructor Detail |
---|
public EntityCachingAbstractSequencePrior(String backgroundSymbol, Index<String> classIndex, 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.Entity extractEntity(int[] sequence, int position)
public int[] otherOccurrences(edu.stanford.nlp.ie.Entity entity)
public static int[] toArray(List<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 String toString()
toString
in class Object
public String toString(int pos)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |