using Dependency Parser in Stanford coreNLP
Posted
by
Eddie Dovzhik
on Stack Overflow
See other posts from Stack Overflow
or by Eddie Dovzhik
Published on 2011-11-17T15:33:47Z
Indexed on
2011/11/26
1:49 UTC
Read the original article
Hit count: 375
nlp
|stanford-nlp
I am using the Stanford coreNLP ( http://nlp.stanford.edu/software/corenlp.shtml ) in order to parse sentences and extract dependencies between the words.
I have managed to create the dependencies graph like in the example in the supplied link, but I don't know how to work with it. I can print the entire graph using the toString()
method, but the problem I have is that the methods that search for certain words in the graph, such as getChildList
, require an IndexedWord object as a parameter. Now, it is clear why they do because the nodes of the graph are of IndexedWord type, but it's not clear to me how I create such an object in order to search for a specific node.
For example: I want to find the children of the node that represents the word "problem" in my sentence. How I create an IndexWord object that represents the word "problem" so I can search for it in the graph?
© Stack Overflow or respective owner