I am trying to get Stanford Dependency Parser setup. However I am getting an Import Error - 'ImportError: cannot import name StanfordDependencyParser'. I tried following instructions from answers to previous posts such as - Stanford Parser and NLTK and Stanford Dependency Parser Setup and NLTK. Nothing seems to be working.
My code is as follows:
>>> import nltk
>>> import os
>>> os.environ['STANFORD_PARSER'] = 'C:\jars'
>>> os.environ['STANFORD_MODELS'] = 'C:\jars'
>>> os.environ['JAVAHOME'] = 'C:\Program Files (x86)\Java\jre1.8.0_66\bin'
>>> from nltk.parse.stanford import StanfordDependencyParser
Traceback (most recent call last):
File "<pyshell#23>", line 1, in <module>
from nltk.parse.stanford import StanfordDependencyParser
ImportError: cannot import name StanfordDependencyParser
I am not sure what the issue is. I have updated NLTK to the latest version. I have also tried removing the 'import nltk' in case the error was because I was importing an entity twice.
I'm pretty lost as to how to proceed. I am very new to NLTK and python. Any help would be appreciated. Thank you in advance.