py-corenlp icon indicating copy to clipboard operation
py-corenlp copied to clipboard

Weird error: py-corenlp or CoreNLP problem?

Open pwichmann opened this issue 7 years ago • 4 comments

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?

pwichmann avatar Apr 12 '17 15:04 pwichmann

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.

Motwani avatar Apr 14 '17 17:04 Motwani

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

pwichmann avatar Apr 19 '17 00:04 pwichmann

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.

Sheldon-Anderson avatar Mar 14 '18 15:03 Sheldon-Anderson

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.

nzv8fan avatar May 07 '18 01:05 nzv8fan