use of edu.stanford.nlp.sequences.BestSequenceFinder in project CoreNLP by stanfordnlp.
the class TestSentence method runTagInference.
private void runTagInference() {
this.initializeScorer();
if (Thread.interrupted()) {
// Allow interrupting
throw new RuntimeInterruptedException();
}
BestSequenceFinder ti = new ExactBestSequenceFinder();
//new BeamBestSequenceFinder(50);
//new KBestSequenceFinder()
int[] bestTags = ti.bestSequence(this);
finalTags = new String[bestTags.length];
for (int j = 0; j < size; j++) {
finalTags[j] = maxentTagger.tags.getTag(bestTags[j + leftWindow()]);
}
if (Thread.interrupted()) {
// Allow interrupting
throw new RuntimeInterruptedException();
}
cleanUpScorer();
}
Aggregations