Stanford nlp stanfordcore NLP中的多个NER模型

Stanford nlp stanfordcore NLP中的多个NER模型,stanford-nlp,ner,Stanford Nlp,Ner,我试图检测一个句子是否有人名。我正在使用standford core NLP java库 Properties props = new Properties(); props.setProperty("annotators", "tokenize, ssplit, pos, lemma, ner, parse, dcoref"); props.setProperty("ner.model","edu/stanford/nlp/models/ner/chinese.misc.distsim.crf

我试图检测一个句子是否有人名。我正在使用standford core NLP java库

Properties props = new Properties();
props.setProperty("annotators", "tokenize, ssplit, pos, lemma, ner, parse, dcoref");
props.setProperty("ner.model","edu/stanford/nlp/models/ner/chinese.misc.distsim.crf.ser.gz,edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz,edu/stanford/nlp/models/ner/german.conll.germeval2014.hgc_175m_600.crf.ser.gz,edu/stanford/nlp/models/ner/spanish.ancora.distsim.s512.crf.ser.gz");
standfordNERpipeline = new StanfordCoreNLP(props);
CoreDocument document = new CoreDocument(line.getText());
getStanfordPipeline.annotate(document);
CoreSentence sentence = document.sentences().get(0);
List<String> nerTags = sentence.nerTags();
Properties=newproperties();
props.setProperty(“注释器”、“标记化、ssplit、pos、引理、ner、解析、dcoref”);
props.setProperty(“ner.model”、“edu/stanford/nlp/models/ner/chinese.misc.distsim.crf.ser.gz、edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz、edu/stanford/nlp/models/ner/german.conll.germeval2014.hg_175; 600.crf.ser.gz、edu/stanford/nlp/models/ner/spanish.ancora.distsim.s512.crf.ser.gz”);
StanfordnerPipeline=新的StanfordCoreNLP(道具);
CoreDocument文档=新的CoreDocument(line.getText());
getStanfordPipeline.annotate(文档);
CoreStation=document.句子().get(0);
List nerTags=句子.nerTags();
因为我不知道这个人可能是什么种族,所以我想使用所有可用的NER模型。我正在使用道具文件中的所有4个NER模型,用逗号分隔。但它似乎总是使用第一个模型(中文)进行分类


如何在一句话中使用所有4个NER模型

我不确定在英文文本中使用外语
ner
模型是否是个好主意

但如果您将此添加到代码中,它将解决您的问题:

props.setProperty(“ner.combinationMode”、“HIGH\u RECALL”)


这样,所有标签将允许所有4个型号的输出。

文本可以是任何语言。