There aren’t many tools which allow you to visualise sentences parsed with dependency grammars. Here’s a small tool which generates a PNG of the dependency graph of a given sentence using the Stanford Parser.
How to run:
Dependency graph shown in the image above for Einey’s quote can be generated by following these steps.
- Click here to download <dependensee-3.7.0.jar>.
- Download the latest version of the Stanford Parser. I am using version 3.7.0.
- Place the jar file in the Stanford Parser folder.
- On the command prompt, run
java -cp dependensee-3.7.0.jar;stanford-parser.jar;stanford-parser-3.6.0-models.jar;slf4j-api.jar com.chaoticity.dependensee.Main "Example isn't another way to teach, it is the only way to teach." out.png
(If you are on *nix, replace the semicolon by a colon and make sure you have Arial installed. If you have an already parsed dependency output file, replace the sentence by -t input.txt
.)
5. Open out.png
and admire :)
DependenSee can render part-of-speech tags as well as manages very basic edge overlap. You can also link the library in your code. An example is given below. Comments/queries are welcome and you can also find the source at github.