edu.stanford.nlp.sequences
Class SequenceSampler
java.lang.Object
edu.stanford.nlp.sequences.SequenceSampler
- All Implemented Interfaces:
- BestSequenceFinder
public class SequenceSampler
- extends Object
- implements BestSequenceFinder
This class will sample an output from a sequence model. It
assumes that the scores are (unnormalized) log-probabilities. It works by sampling
each variable in order, conditioned on the previous variables.
- Author:
- Jenny Finkel
Method Summary |
int[] |
bestSequence(SequenceModel ts)
Runs the Viterbi algorithm on the sequence model given by the TagScorer
in order to find the best sequence. |
static void |
main(String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SequenceSampler
public SequenceSampler()
main
public static void main(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
- Returns:
- an array containing the int tags of the best sequence
Stanford NLP Group