public class TestSequenceModel extends Object implements SequenceModel
Constructor and Description |
---|
TestSequenceModel(CRFCliqueTree<? extends CharSequence> cliqueTree) |
TestSequenceModel(CRFCliqueTree<? extends CharSequence> cliqueTree,
LabelDictionary labelDictionary,
List<? extends CoreMap> document) |
Modifier and Type | Method and Description |
---|---|
int[] |
getPossibleValues(int pos)
Return the valid sequence labels (as integer indices) for a particular
position in the sequence.
|
int |
leftWindow()
How many label positions to the left influence the label assignment
at a particular position.
|
int |
length() |
int |
rightWindow()
How many label positions to the right influence the label assignment
at a particular position.
|
double |
scoreOf(int[] sequence)
Computes the score assigned by this model to the whole sequence.
|
double |
scoreOf(int[] tags,
int pos)
Return the score of the proposed tags for position given.
|
double[] |
scoresOf(int[] tags,
int pos)
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.
|
public TestSequenceModel(CRFCliqueTree<? extends CharSequence> cliqueTree)
public TestSequenceModel(CRFCliqueTree<? extends CharSequence> cliqueTree, LabelDictionary labelDictionary, List<? extends CoreMap> document)
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 pos)
SequenceModel
getPossibleValues
in interface SequenceModel
pos
- The positionpublic double scoreOf(int[] tags, int pos)
scoreOf
in interface SequenceModel
tags
- is an array indicating the assignment of labels to score.pos
- is the position to return a score for.public double[] scoresOf(int[] tags, int pos)
SequenceModel
scoresOf
in interface SequenceModel
tags
- The sequence containing the rest of the values to condition onpos
- The position of the element to give a distribution forpublic double scoreOf(int[] sequence)
SequenceModel
scoreOf
in interface SequenceModel
sequence
- The sequence of labels to compute a score for