edu.stanford.nlp.sequences
Class ExactBestSequenceFinder
java.lang.Object
edu.stanford.nlp.sequences.ExactBestSequenceFinder
- All Implemented Interfaces:
- BestSequenceFinder
public class ExactBestSequenceFinder
- extends java.lang.Object
- implements BestSequenceFinder
A class capable of computing the best sequence given a SequenceModel.
Uses the Viterbi algorithm.
- Author:
- Dan Klein, Teg Grenager (grenager@stanford.edu)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExactBestSequenceFinder
public ExactBestSequenceFinder()
main
public static void main(java.lang.String[] args)
bestSequence
public int[] bestSequence(SequenceModel ts)
- Runs the Viterbi algorithm on the sequence model given by the TagScorer
in order to find the best sequence.
- Specified by:
bestSequence
in interface BestSequenceFinder
- Parameters:
ts
- The SequenceModel to be used for scoring
- Returns:
- An array containing the int tags of the best sequence
bestSequenceWithLinearConstraints
public static Pair<int[],java.lang.Double> bestSequenceWithLinearConstraints(SequenceModel ts,
double[][] linearConstraints)
Stanford NLP Group