CoreNLP の Gitによると、NER がチェンジ ノートの変更されたモジュールの 1 つとしてリストされているため、この問題は CoreNLP の一部のバージョン (おそらく 3.5.1) で修正されています。ただし、3.5.x では Java 1.8 への移行が必要であり、現時点ではその準備ができていません。
また、免責事項として、その問題にも投稿しましたが、問題が解決されたため、表示されていない可能性があります。SO は CoreNLP をサポートするための公式フォーラムであるため、ここで質問します。
だから私は尋ねています、これを修正するための変更は何ですか? それは実際に現在のバージョンに存在しますか、それとも他に何かする必要がありますか。現在使用している 3.4.1 からアップグレードせずに、これを修正する必要があります。
記録として、以下の文字列は 2009 年 12 月 3 日 10:00 を表すと想定されています (この文字列には秒が指定されていないため、00 も想定しています)。
これがスタックトレースです。
java.lang.NumberFormatException: For input string: "200912031000"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:583)
at java.lang.Integer.valueOf(Integer.java:766)
at edu.stanford.nlp.ie.pascal.ISODateInstance.extractDay(ISODateInstance.java:1107)
at edu.stanford.nlp.ie.pascal.ISODateInstance.extractFields(ISODateInstance.java:398)
at edu.stanford.nlp.ie.pascal.ISODateInstance.<init>(ISODateInstance.java:82)
at edu.stanford.nlp.ie.QuantifiableEntityNormalizer.normalizedDateString(QuantifiableEntityNormalizer.java:363)
at edu.stanford.nlp.ie.QuantifiableEntityNormalizer.normalizedDateString(QuantifiableEntityNormalizer.java:338)
at edu.stanford.nlp.ie.QuantifiableEntityNormalizer.processEntity(QuantifiableEntityNormalizer.java:1018)
at edu.stanford.nlp.ie.QuantifiableEntityNormalizer.addNormalizedQuantitiesToEntities(QuantifiableEntityNormalizer.java:1320)
at edu.stanford.nlp.ie.NERClassifierCombiner.classifyWithGlobalInformation(NERClassifierCombiner.java:145)
at edu.stanford.nlp.ie.AbstractSequenceClassifier.classifySentenceWithGlobalInformation(AbstractSequenceClassifier.java:322)
at edu.stanford.nlp.pipeline.NERCombinerAnnotator.doOneSentence(NERCombinerAnnotator.java:148)
at edu.stanford.nlp.pipeline.SentenceAnnotator.annotate(SentenceAnnotator.java:95)
at edu.stanford.nlp.pipeline.NERCombinerAnnotator.annotate(NERCombinerAnnotator.java:137)
at edu.stanford.nlp.pipeline.AnnotationPipeline.annotate(AnnotationPipeline.java:67)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.annotate(StanfordCoreNLP.java:847)
編集
現在、コードのいくつかの sutime 部分に対処しているため、これをもう一度見ています。次のようにするだけで再現できます。
ISODateInstance idi = new ISODateInstance();
boolean fields = idi.extractFields("200912031000");
System.out.println(fields);
true
は印刷された値であることに注意してください。