私の次のプログラムから検出された日付は、2つの別々の言及に分割されますが、CoreNLP demoのNER出力で検出された日付は、これを修正するには、私のプログラムで何を編集すべきですか?このプログラムからなぜ私のNamedEntityAnnotatorの日付の記述はCoreNLPのデモの出力と異なるのですか?
Properties props = new Properties();
props.setProperty("annotators", "tokenize, ssplit, pos, lemma, ner, entitymentions");
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
String text = "This software was released on Februrary 5, 2015.";
Annotation document = new Annotation(text);
pipeline.annotate(document);
List<CoreMap> sentences = document.get(SentencesAnnotation.class);
for(CoreMap sentence: sentences) {
List<CoreMap> mentions = sentence.get(MentionsAnnotation.class);
if (mentions != null) {
for (CoreMap mention : mentions) {
System.out.println("== Token=" + mention.get(TextAnnotation.class));
System.out.println("NER=" + mention.get(NamedEntityTagAnnotation.class));
System.out.println("Normalized NER=" + mention.get(NormalizedNamedEntityTagAnnotation.class));
}
}
}
出力:CoreNLPオンラインデモから
== Token=Februrary 5,
NER=DATE
Normalized NER=****0205
== Token=2015
NER=DATE
Normalized NER=2015
出力:オンラインデモが属しているのと同じNERタグを持つ連続したトークンの任意のシーケンスを示していることを
ご使用のCoreNLPのバージョンは?オンラインデモではプロジェクトのGit HEADをかなり緊密に追跡しています。出力の違いは修正されたばかりのバグである可能性があります。 –
マインは[ここ](http://stanfordnlp.github.io/CoreNLP/#download)からv3.6.0です。 – crackjack