I use the Stanford parser with nltk in python and got help from Stanford Parser and NLTK to set up the Stanford nlp libraries.
from nltk.parse.stanford import StanfordParser from nltk.parse.stanford import StanfordDependencyParser parser = StanfordParser(model_path="edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz") dep_parser = StanfordDependencyParser(model_path="edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz") one = ("John sees Bill") parsed_Sentence = parser.raw_parse(one) # GUI for line in parsed_Sentence: print line line.draw() parsed_Sentence = [parse.tree() for parse in dep_parser.raw_parse(one)] print parsed_Sentence # GUI for line in parsed_Sentence: print line line.draw()
I get the wrong parsing and dependency trees, as shown in the example below, it considers βseesβ as a noun instead of a verb.

What should I do? It works great when I change the sentence, for example (one = "John sees Bill"). The correct conclusion for this sentence can be seen here. The correct conclusion of the parse tree.
An example of the correct output is also shown below:


source share