stanfordnlp / CoreNLP

CoreNLP: A Java suite of core NLP tools for tokenization, sentence segmentation, NER, parsing, coreference, sentiment analysis, etc.
http://stanfordnlp.github.io/CoreNLP/
GNU General Public License v3.0
9.72k stars 2.7k forks source link

Crash: openie.resolve_coref #789

Closed rothn closed 6 years ago

rothn commented 6 years ago

The following command-line invocation crashes OpenIE:

I want the system to resolve coreferences as I am trying to produce a simple training set of labeled data for an algorithm.


[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator tokenize
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator ssplit
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator pos
[main] INFO edu.stanford.nlp.tagger.maxent.MaxentTagger - Loading POS tagger from edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger ... done [0.4 sec].
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator lemma
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator depparse
[main] INFO edu.stanford.nlp.parser.nndep.DependencyParser - Loading depparse model: edu/stanford/nlp/models/parser/nndep/english_UD.gz ... 
[main] INFO edu.stanford.nlp.parser.nndep.Classifier - PreComputed 99996, Elapsed Time: 7.446 (s)
[main] INFO edu.stanford.nlp.parser.nndep.DependencyParser - Initializing dependency parser ... done [8.5 sec].
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator ner
[main] INFO edu.stanford.nlp.ie.AbstractSequenceClassifier - Loading classifier from edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz ... done [0.8 sec].
[main] INFO edu.stanford.nlp.ie.AbstractSequenceClassifier - Loading classifier from edu/stanford/nlp/models/ner/english.muc.7class.distsim.crf.ser.gz ... done [0.5 sec].
[main] INFO edu.stanford.nlp.ie.AbstractSequenceClassifier - Loading classifier from edu/stanford/nlp/models/ner/english.conll.4class.distsim.crf.ser.gz ... done [0.5 sec].
[main] INFO edu.stanford.nlp.time.JollyDayHolidays - Initializing JollyDayHoliday for SUTime from classpath edu/stanford/nlp/models/sutime/jollyday/Holidays_sutime.xml as sutime.binder.1.
[main] INFO edu.stanford.nlp.time.TimeExpressionExtractorImpl - Using following SUTime rules: edu/stanford/nlp/models/sutime/defs.sutime.txt,edu/stanford/nlp/models/sutime/english.sutime.txt,edu/stanford/nlp/models/sutime/english.holidays.sutime.txt
[main] INFO edu.stanford.nlp.pipeline.TokensRegexNERAnnotator - ner.fine.regexner: Read 580704 unique entries out of 581863 from edu/stanford/nlp/models/kbp/english/gazetteers/regexner_caseless.tab, 0 TokensRegex patterns.
[main] INFO edu.stanford.nlp.pipeline.TokensRegexNERAnnotator - ner.fine.regexner: Read 4869 unique entries out of 4869 from edu/stanford/nlp/models/kbp/english/gazetteers/regexner_cased.tab, 0 TokensRegex patterns.
[main] INFO edu.stanford.nlp.pipeline.TokensRegexNERAnnotator - ner.fine.regexner: Read 585573 unique entries from 2 files
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator mention
Exception in thread "main" java.lang.IllegalArgumentException: No annotator named mention
    at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:151)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:251)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:192)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:188)
    at edu.stanford.nlp.naturalli.OpenIE.main(OpenIE.java:735)```
J38 commented 6 years ago

Hi I just pushed a change to potentially fix this. Some annotator names have changed, and I needed to remove the mention annotator. If you get the latest code and use that, does your error go away?

rothn commented 6 years ago

Is this in the latest published (jar) build or would I have to clone and build it?

J38 commented 6 years ago

Clone and build it. We are going to release a new 3.9.3 in a few weeks though that will have this change.

J38 commented 6 years ago

I believe this is fixed now, let me know if you see any problems.

j6mes commented 5 years ago

Did 3.9.3 ever get released? I don't see anything on the website or on Maven. I am also am having issues with this.

J38 commented 5 years ago

I think there was an issue we thought we had to emergency fix but realized it wasn't present in 3.9.2, so no. We are working hard to release 4.0.0 before the end of the year!

lighteternal commented 4 years ago

Hi, this is possibly linked to my issue; I am using the python wrapper: https://github.com/philipperemy/Stanford-OpenIE-Python/issues/16

I was trying to extract triples using openie and the coref annotators, however I get an AnnotationException when I set "openie.resolve_coref": "true".

Is there a way to use coref+openie using the 3.9.2 version? Is there an updated/buildable jar that solves the problem? I am using stanford-corenlp-full-2018-10-05.

Many thanks!