I am doing a project related to NLP, and I decide to use standfordcorenlp. However, when I try to implement these piece of code there exists an error. Following is my code and what printed on the console:
from stanfordcorenlp import StanfordCoreNLP
nlp = StanfordCoreNLP(r'/Users/xiehang/PycharmProjects/Autism/stanford-corenlp-full-2018-02-27')
sentence = 'Enviroment is really important.'
print (nlp.ner(sentence))
nlp.close();
And the console prints out:
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
/Users/xiehang/PycharmProjects/Autism/NER.py Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/psutil/_psosx.py", line 330, in wrapper return fun(self, *args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/psutil/_psosx.py", line 515, in connections rawlist = cext.proc_connections(self.pid, families, types) PermissionError: [Errno 1] Operation not permitted
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/Users/xiehang/PycharmProjects/Autism/NER.py", line 9, in nlp = StanfordCoreNLP(r'/Users/xiehang/PycharmProjects/Autism/stanford-corenlp-full-2018-02-27') File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/stanfordcorenlp/corenlp.py", line 79, in init if port_candidate not in [conn.laddr[1] for conn in psutil.net_connections()]: File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/psutil/init.py", line 2108, in net_connections return _psplatform.net_connections(kind) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/psutil/_psosx.py", line 249, in net_connections cons = Process(pid).connections(kind) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/psutil/_psosx.py", line 335, in wrapper raise AccessDenied(self.pid, self._name) psutil._exceptions.AccessDenied: psutil.AccessDenied (pid=707)
Process finished with exit code 1
I have searched almost all possible sites trying to figure it out for several days and it is very painful. I really hope someone can help me figure it out. Thanks!