Nlp Stanford-NER中的置信度预测

Nlp Stanford-NER中的置信度预测,nlp,stanford-nlp,named-entity-recognition,Nlp,Stanford Nlp,Named Entity Recognition,Stanford-NER-Tagger序列预测的置信水平。有可能吗?给定预测序列的置信度。这里有一些代码,可以打印出k(在示例10中)最可能的序列,并将打印出序列概率 import edu.stanford.nlp.ie.AbstractSequenceClassifier; import edu.stanford.nlp.ie.crf.*; import edu.stanford.nlp.io.IOUtils; import edu.stanford.nlp.ling.CoreLabel; i

Stanford-NER-Tagger序列预测的置信水平。有可能吗?给定预测序列的置信度。

这里有一些代码,可以打印出k(在示例10中)最可能的序列,并将打印出序列概率

import edu.stanford.nlp.ie.AbstractSequenceClassifier;
import edu.stanford.nlp.ie.crf.*;
import edu.stanford.nlp.io.IOUtils;
import edu.stanford.nlp.ling.CoreLabel;
import edu.stanford.nlp.ling.CoreAnnotations;
import edu.stanford.nlp.sequences.DocumentReaderAndWriter;
import edu.stanford.nlp.util.Triple;

import java.io.*;
import java.util.List;


public class GetCRFProbsDemo {

    public static void main(String[] args)  throws ClassNotFoundException, IOException {
        String serializedClassifier = "edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz";
        AbstractSequenceClassifier<CoreLabel> classifier = CRFClassifier.getClassifier(serializedClassifier);
        System.out.println("---");
        System.out.println("Ten best entity labelings");
        DocumentReaderAndWriter<CoreLabel> readerAndWriter = classifier.makePlainTextReaderAndWriter();
        classifier.classifyAndWriteAnswersKBest(args[0], 10, readerAndWriter);
    }

}
导入edu.stanford.nlp.ie.AbstractSequenceClassifier;
导入edu.stanford.nlp.ie.crf.*;
导入edu.stanford.nlp.io.IOUtils;
导入edu.stanford.nlp.ling.corelab;
导入edu.stanford.nlp.ling.core注释;
导入edu.stanford.nlp.sequences.DocumentReaderAndWriter;
导入edu.stanford.nlp.util.Triple;
导入java.io.*;
导入java.util.List;
公共类GetCRFProbsDemo{
公共静态void main(字符串[]args)抛出ClassNotFoundException、IOException{
字符串serializedClassifier=“edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz”;
AbstractSequenceClassifier=crfclassizer.getClassifier(serializedClassifier);
System.out.println(“--”);
System.out.println(“十大最佳实体标签”);
DocumentReaderAndWriter readerAndWriter=分类器。makePlainTextReaderAndWriter();
classifier.classifyAndWriteAnswersKBest(args[0],10,readerAndWriter);
}
}