|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.ie.crf.CRFCliqueTree
public class CRFCliqueTree
Builds a CliqueTree (an array of FactorTable) and does message passing inference along it.
Method Summary | |
---|---|
int |
backgroundIndex()
|
String |
backgroundSymbol()
|
Index |
classIndex()
|
double |
condLogProbGivenNext(int position,
int label,
int[] nextLabels)
|
double |
condLogProbGivenNext(int position,
Object label,
Object[] nextLabels)
|
double |
condLogProbGivenPrevious(int position,
int label,
int[] prevLabels)
Gives the probability of a tag at a single position conditioned on a sequence of previous labels. |
double |
condLogProbGivenPrevious(int position,
Object label,
Object[] prevLabels)
|
ClassicCounter |
condLogProbsGivenNext(int position,
int[] nextlabels)
|
ClassicCounter |
condLogProbsGivenNext(int position,
Object[] nextlabels)
|
ClassicCounter |
condLogProbsGivenPrevious(int position,
int[] prevlabels)
|
ClassicCounter |
condLogProbsGivenPrevious(int position,
Object[] prevlabels)
|
double |
condProbGivenNext(int position,
int label,
int[] nextLabels)
|
double |
condProbGivenNext(int position,
Object label,
Object[] nextLabels)
|
double |
condProbGivenPrevious(int position,
int label,
int[] prevLabels)
|
double |
condProbGivenPrevious(int position,
Object label,
Object[] prevLabels)
|
static CRFCliqueTree |
getCalibratedCliqueTree(double[][] weights,
int[][][] data,
Index[] labelIndices,
int numClasses,
Index classIndex,
String backgroundSymbol)
|
static CRFCliqueTree |
getCalibratedCliqueTree(double[] weights,
double wscale,
int[][] weightIndices,
int[][][] data,
Index[] labelIndices,
int numClasses,
Index classIndex,
String backgroundSymbol)
|
double[] |
getConditionalDistribution(int[] sequence,
int position)
Computes the 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. |
int |
getNumClasses()
|
int |
getNumValues()
|
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()
|
double |
logProb(int position,
int label)
|
double |
logProb(int position,
int[] labels)
returns the log probability for the given labels (indexed using classIndex), where the last label corresponds to the label at the specified position. |
double |
logProb(int position,
Object label)
|
double |
logProb(int position,
Object[] labels)
returns the log probability for the given labels, where the last label corresponds to the label at the specified position. |
ClassicCounter |
logProbs(int position)
|
GeneralizedCounter |
logProbs(int position,
int window)
|
double |
prob(int position,
int label)
|
double |
prob(int position,
int[] labels)
Returns the probability for the given labels (indexed using classIndex), where the last label corresponds to the label at the specified position. |
double |
prob(int position,
Object label)
|
double |
prob(int position,
Object[] labels)
returns the probability for the given labels, where the last label corresponds to the label at the specified position. |
ClassicCounter |
probs(int position)
|
GeneralizedCounter |
probs(int position,
int window)
|
int |
rightWindow()
How many positions to the right a position is dependent on. |
double |
scoreOf(int[] sequence)
Returns the log probability of this sequence given the CRF. |
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[] sequence)
Informs this sequence model that the value of the whole sequence is initialized to sequence |
double |
totalMass()
|
void |
updateSequenceElement(int[] sequence,
int pos,
int oldVal)
Informs this sequence model that the value of the element at position pos has changed. |
int |
window()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public Index classIndex()
public int length()
length
in interface SequenceModel
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 double[] scoresOf(int[] sequence, int position)
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 double scoreOf(int[] sequence)
scoreOf
in interface SequenceModel
sequence
- the sequence to compute a score for
public int window()
public int getNumClasses()
public double totalMass()
public int backgroundIndex()
public String backgroundSymbol()
public double logProb(int position, int label)
public double prob(int position, int label)
public double logProb(int position, Object label)
public double prob(int position, Object label)
public ClassicCounter probs(int position)
public ClassicCounter logProbs(int position)
public double logProb(int position, int[] labels)
public double prob(int position, int[] labels)
public double logProb(int position, Object[] labels)
public double prob(int position, Object[] labels)
public GeneralizedCounter logProbs(int position, int window)
public GeneralizedCounter probs(int position, int window)
public double condLogProbGivenPrevious(int position, int label, int[] prevLabels)
position
- Index in sequencelabel
- Label of item at indexprevLabels
-
public double condLogProbGivenPrevious(int position, Object label, Object[] prevLabels)
public double condProbGivenPrevious(int position, int label, int[] prevLabels)
public double condProbGivenPrevious(int position, Object label, Object[] prevLabels)
public ClassicCounter condLogProbsGivenPrevious(int position, int[] prevlabels)
public ClassicCounter condLogProbsGivenPrevious(int position, Object[] prevlabels)
public double condLogProbGivenNext(int position, int label, int[] nextLabels)
public double condLogProbGivenNext(int position, Object label, Object[] nextLabels)
public double condProbGivenNext(int position, int label, int[] nextLabels)
public double condProbGivenNext(int position, Object label, Object[] nextLabels)
public ClassicCounter condLogProbsGivenNext(int position, int[] nextlabels)
public ClassicCounter condLogProbsGivenNext(int position, Object[] nextlabels)
public static CRFCliqueTree getCalibratedCliqueTree(double[][] weights, int[][][] data, Index[] labelIndices, int numClasses, Index classIndex, String backgroundSymbol)
public static CRFCliqueTree getCalibratedCliqueTree(double[] weights, double wscale, int[][] weightIndices, int[][][] data, Index[] labelIndices, int numClasses, Index classIndex, String backgroundSymbol)
public double[] getConditionalDistribution(int[] sequence, int position)
sequence
- the sequence containing the rest of the values to condition onposition
- the position of the element to give a distribution for
public void updateSequenceElement(int[] sequence, int pos, int oldVal)
updateSequenceElement
in interface SequenceListener
public void setInitialSequence(int[] sequence)
setInitialSequence
in interface SequenceListener
public int getNumValues()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |