This page describes a dependency tree and predicate-argument structure visualizer which is implemented in Perl and saves into Scalable Vector Graphics (SVG). There are different ways to visualize dependency trees (e.g. Prague school, Melchuk, Connexor, Link Grammar, etc). Our inspiration has been the trees from the papers by Duchier and Debusmann, see e.g. XDG.
The words of the sentence are represented as nodes in a graph. Each node can have several properties which correspond to the properties of the word, such as the lemma form, the position in the sentence, the part-of-speech tag, etc. The dependencies are represented as arcs which connect the nodes. Each arc has a label for the dependency type.
DepSVG can also handle words with multiple heads. In the following picture, 'Fli-1' is both a subject and a control subject. (This sentence originates from a biomedical domain which we analyse in the OntoGene project.)
Download the following files:
DepSVG.pm
.To install:
conll_to_svg.perl
to the $PATH
$PERL5LIB
. If they are in the current
directory then they are also reachable.Use e.g. by:
perl conll_to_svg.perl --dir img/german < data/german_tiger_train.test
The directory img/german
will contain the SVG files,
one for each sentence.
Some notes:
java -mx1024m -jar batik-rasterizer.jar -m image/png -d . *.svg
.
Note that Batik Rasterizer can also produce PDF-files (if you need a scalable
image which is not SVG).