calhoun.analysis.crf.solver
Class Viterbi
java.lang.Object
calhoun.analysis.crf.solver.Viterbi
- All Implemented Interfaces:
- CRFInference
public class Viterbi
- extends java.lang.Object
- implements CRFInference
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Viterbi
public Viterbi()
isAllPaths
public boolean isAllPaths()
- true if all paths (valid and invalid) are to be evaluated during the viterbi search. Defaults to false.
- Returns:
- true if all paths are to be examined
setAllPaths
public void setAllPaths(boolean allPaths)
- sets whether all paths (valid and invalid) are to be evaluated during the viterbi search. Defaults to false.
- Parameters:
allPaths - allPath true if all paths are to be examined
predict
public CRFInference.InferenceResult predict(ModelManager fm,
InputSequence<?> seq,
double[] lambda)
- Description copied from interface:
CRFInference
- Return the labelling that maximizes the conditional probability P(y|x).
- Specified by:
predict in interface CRFInference
- Parameters:
fm - model to use for trainingseq - input sequence to labellambda - array of feature weights. Usually these will be derived from a training pass.
- Returns:
- inference result containing the hidden states which are predicted and the score outputs.
getBackPointers
public int[] getBackPointers()
setBackPointers
public void setBackPointers(int[] backPointers)
getBestScore
public double[] getBestScore()
setBestScore
public void setBestScore(double[] bestScore)