how to get a dependency tree with Stanford NLP parser

happy77 picture happy77 · Nov 20, 2012 · Viewed 9.9k times · Source

How can I get the dependency tree as Figure below. I can get the dependency relation as pure text, and also the dependency graph with the help of dependencysee tool. But how about the dependency tree which has words as nodes and dependency as edges. Thanks very much!

Standard Stanford dependencies (collapsed and propagated)

Answer

Christopher Manning picture Christopher Manning · Nov 23, 2012

These graphs are produced using GraphViz, an open source graph drawing package, originally from AT&T Research. You can find a method toDotFormat() in edu.stanford.nlp.trees.semgraph.SemanticGraph that will convert a SemanticGraph into dot input language format which can be rendered by dot/GraphViz. At present, there isn't a command-line tool that provides this functionality, but it's pretty straightforward using that method.