Search in sources :

Example 1 with BestSequenceFinder

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();
}
Also used : ExactBestSequenceFinder(edu.stanford.nlp.sequences.ExactBestSequenceFinder) BestSequenceFinder(edu.stanford.nlp.sequences.BestSequenceFinder) ExactBestSequenceFinder(edu.stanford.nlp.sequences.ExactBestSequenceFinder)

Aggregations

BestSequenceFinder (edu.stanford.nlp.sequences.BestSequenceFinder)1 ExactBestSequenceFinder (edu.stanford.nlp.sequences.ExactBestSequenceFinder)1