-
Notifications
You must be signed in to change notification settings - Fork 73
Description
Hi, I'm trying to POS tag, lemmatize and do sentiment analysis on some text, but whenever I use the sentiment tool something goes wrong and instead of a json output I get a string.
I get a similar error when trying the sentiment in a browser at http://localhost:9000/ where the output seems to be correct but in a red box and without the usual visuals.
I downloaded the latest version of CoreNLP on the official website, I am running the server with java -mx6g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -timeout 10000 without any problem.
The code I am trying is
from pycorenlp import StanfordCoreNLP
nlp_wrapper = StanfordCoreNLP('http://localhost:9000')
doc = "I like this chocolate."
annot_doc = nlp_wrapper.annotate(doc,
properties={
'annotators': 'sentiment',
'outputFormat': 'json',
'timeout': 10000,
})
I run the code above on:
macOS 10.15.3
pycorenlp 0.3.0
python 3.6
java 8
Thank you for your help!