smilli / py-corenlp

Python wrapper for Stanford CoreNLP
353 stars 75 forks source link

Weird error: py-corenlp or CoreNLP problem? #18

Open pwichmann opened 7 years ago

pwichmann commented 7 years ago

Many thanks for your excellent library! It helped me quite a lot.

I have recently started to run into this error (after update to CoreNLP 3.7.0):

[pool-2-thread-3] ERROR edu.stanford.nlp.pipeline.StanfordCoreNLP - Attempted to fetch annotator "parse" before the annotator pool was created! java.util.concurrent.ExecutionException: java.lang.AssertionError: Failed to get parser - this should not be possible

Can this be a py-corenlp problem or is it a Stanford CoreNLP problem?

Motwani commented 7 years ago

Getting the same error as above.

This is the code I'm running.

import json
from pycorenlp import StanfordCoreNLP
import pickle
import codecs

nlp = StanfordCoreNLP('http://localhost:9000')

lines = "Carrie would sneak rides on her sister Dan's bike . "

ans = nlp.annotate(lines, properties={'annotators':'tokenize,ssplit,pos,lemma,ner,parse,mention,coref','coref.algorithm':'neural'})

Using CoreNLP 3.7.0.

pwichmann commented 7 years ago

If anyone knows what causes the error, would you be so kind to reply in this thread?

Sheldon-Anderson commented 6 years ago

I've met this same kind of error. When I ran it on Windows 10 OS, it was OK, but when I ran it on Ubuntu 16.04 Server, It was an error.

Try to use 'annotators':'tokenize,ssplit,pos,depparse,parse' instead of 'annotators':'tokenize,ssplit,pos,lemma,ner,parse,mention,coref'. It ran well.

If you really need 'coref', you'd better try some methods else.

nzv8fan commented 6 years ago

Could it be that you're attempting to call CoreNLP before the server is fully started? It takes a few seconds for the server to boot up.