calhoun.analysis.crf.solver
Class Viterbi

java.lang.Object
  extended by calhoun.analysis.crf.solver.Viterbi
All Implemented Interfaces:
CRFInference

public class Viterbi
extends java.lang.Object
implements CRFInference


Nested Class Summary
 
Nested classes/interfaces inherited from interface calhoun.analysis.crf.CRFInference
CRFInference.InferenceResult
 
Constructor Summary
Viterbi()
           
 
Method Summary
 int[] getBackPointers()
           
 double[] getBestScore()
           
 boolean isAllPaths()
          true if all paths (valid and invalid) are to be evaluated during the viterbi search.
 CRFInference.InferenceResult predict(ModelManager fm, InputSequence<?> seq, double[] lambda)
          Return the labelling that maximizes the conditional probability P(y|x).
 void setAllPaths(boolean allPaths)
          sets whether all paths (valid and invalid) are to be evaluated during the viterbi search.
 void setBackPointers(int[] backPointers)
           
 void setBestScore(double[] bestScore)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Viterbi

public Viterbi()
Method Detail

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 training
seq - input sequence to label
lambda - 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)