from pycorenlp import StanfordCoreNLP
nlp = StanfordCoreNLP('http://localhost:9000')
res = nlp.annotate("I love you. I hate him. You are nice. He is dumb",
properties={
'annotators': 'sentiment',
'outputFormat': 'json',
'timeout': 1000,
})
for s in res["sentences"]:
print("%d: '%s': %s %s" % (
s["index"],
" ".join([t["word"] for t in s["tokens"]]),
s["sentimentValue"], s["sentiment"]))
I get error message:
Traceback (most recent call last):
File "C:/path_to_file/test_corenlp.py", line 1, in <module>
from pycorenlp import StanfordCoreNLP
ModuleNotFoundError: No module named 'pycorenlp'
tried to look at closed issue with same error, but no help. Anyone experiencing this error ?
Installed pycorenlp through pip:
pip install pycorenlp
Run the server, but still when I run this code:
I get error message:
tried to look at closed issue with same error, but no help. Anyone experiencing this error ?