views:

407

answers:

1

Hello!

Basically I want to find a path between two NP tokens in the dependencies graph. However, I can't seem to find a good way to do this in the Stanford Parser. Any help?

Thank You Very Much

+2  A: 

The Stanford Parser just returns a list of dependencies between word tokens. (We do this to avoid external library dependencies.) But if you want to manipulate the dependencies, you'll almost certainly want to put them in a graph data structure. We usually use jgrapht: http://jgrapht.sourceforge.net/

Christopher Manning
Thank you.I'm actually using this to extract triples (Subject,Verb,Object) from sentences. My idea was to first detect the entities in the sentence, and then, for each pair of entities, find a path between them in the dependency graph that contained a verb. The problem is that, although this works for some cases, for some it doesn't. Like this one: "Paper is a thin, flat material produced by compressed fibers.". Here, the stanford parser finds a direct nsubj relation between "paper" and "material". Can you recommend any good way to do this triple extraction?Thank You.
pns
In the SD representation, the copula (verb "to be") isn't treated as a predicate, rather the noun or adjective is treated as the predicate:thin(paper)material(paper).See the discussion in http://nlp.stanford.edu/pubs/dependencies-coling08.pdf (section 2.2)But if you wanted to undo this, you could look for a cop() dependency of the noun or adjective and rewrite it as be(paper, thin)be(paper, material)
Christopher Manning