sina-al / pynlp

A pythonic wrapper for Stanford CoreNLP.
MIT License
107 stars 11 forks source link

gives IndexError when i use nlp(text) #9

Closed mcjoshi closed 6 years ago

mcjoshi commented 6 years ago

Hi, I followed up the demo you have given. But it doesn't work. aa

What am i missing ?

sina-al commented 6 years ago

Hi mcjoshi, thanks for this. What version of Stanford CoreNLP are you using? I can't seem to reproduce this error with version 3.8. It's possible that the library isn't compatible with the new 3.9 release. If so, try using 3.8 for now. Let me know how it goes, thanks.

mcjoshi commented 6 years ago

I tried it with 3.6, 3.8 and 3.9. So I don't think its problem related to CoreNLP version. I tried doing entity recognition using pycorenlp. It works fine when ner is excluded but when ner is included in annotators, it gives error.

When i run following section of your code, it prints nothing :


from pynlp import StanfordCoreNLP
nlp = StanfordCoreNLP(annotators='entitymentions')
text = ('GOP Sen. Rand Paul was assaulted in his home.')
doc = nlp(text)
print(doc)
sina-al commented 6 years ago

Can you please show me the output of the following code:

from pynlp import StanfordCoreNLP
nlp = StanfordCoreNLP(annotators='entitymentions')
text = ('GOP Sen. Rand Paul was assaulted in his home.')
doc = nlp(text)
print(doc._doc)

Also, please run pip freeze and paste here the version numbers for:

TMarafon commented 6 years ago

Hi, I'm having the same issue here.

from pynlp import StanfordCoreNLP
nlp = StanfordCoreNLP(annotators='entitymentions')
text = ('GOP Sen. Rand Paul was assaulted in his home.')
doc = nlp(text)
print(doc._doc)

The output is empty.

Regarding the version numbers:

sina-al commented 6 years ago

Hello,

Can you please show me the output from the CoreNLP server when you run your code?

sina-al commented 6 years ago

Closed as abandoned.