rsennrich / ParZu

The Zurich Dependency Parser for German
https://pub.cl.uzh.ch/demo/parzu/
GNU General Public License v2.0
81 stars 19 forks source link

Creating the visual dependency graph from conll data #34

Open sambaPython24 opened 2 years ago

sambaPython24 commented 2 years ago

Hello, the parser works great and I would like to reproduce the dependency graph that I saw in your example. image

I am using the docker image and tried the option "conll" and "graphical" as an output. "graphical" seems to include the svg file but I would like to understand how to find the hierarchical arrows between the different words based on the "conll" data (not just the final image, but in some kind of hierarchical structure.)

rsennrich commented 2 years ago

The tree structure can be recovered from the conll formatted output. In the conll output, the head position of each word is given in column 7 - words with head position 0 form the top-level roots. For all other positions, there will be an dependency arc (arrow) from the head to that position. To find out what level in the tree you are in, you count how many arcs it takes to reach a root.

you can also check the code that converts conll files into the SVG images: https://github.com/rsennrich/ParZu/tree/master/postprocessor/DepSVG