A simple CoNLL-X to tikz-dependency converter.
This converter aims to provide a function to visualize a simple dependency tree through converting from the CoNLL-X data format to the tikz-dependency.
Currently, I have implemented the converter in Python, C/C++ and Go. The functionality of these implementations is mostly same except that the C/C++ implementation does not provide command line options. The code is known to work on Linux and OS X.
Requirements depend on the type of implementations what you want to use:
- Go compilers if you want to use go code.
- C compiler if you want to use C compiled program.
- C/C++ compiler if you want to use C++ compiled program.
- Python if you want to run the python script.
Please note that tikz-dependency package is required when you want to compile generated latex files with this converter.
We will describe the usage for each implementation in the following sections.
Please see -h
or --help
for all possible options.
Again, note that the options is not available for the C/C++ implementation.
The python code just works. There are no need to install the code or additional packages.
$ ./conllx_to_tikz_dep.py conllx_data [options]
With the option --with-label
, you can draw dependency trees with edge labels.
$ ./conllx_to_tikz_dep.py conllx_data --with-label
They look like this:
By default, the direction of dependency edge is from a head word to its modifier.
With the option --reverse-edge
, the direction of edges can be reversed.
$ ./conllx_to_tikz_dep.py conllx_data --reverse-edge
You can compare predicted parse trees by your parser to gold parse trees annotated by humans.
$ ./conllx_to_tikz_dep.py --reverse-edge --diff gold_data predict_data
$ cd c
$ make
To run C program
$ ./conllx_to_tikz_dep conllx_data
To run C++ program
$ ./conllx_to_tikz_dep_pp conllx_data
$ go build conllx_to_tikz_dep.go
$ ./conllx_to_tikz_dep conllx_data
or
$ go run conllx_to_tikz_dep.go conllx_data
For the details of the input data format, see the website: CoNLL-X Shared Task: Multi-lingual Dependency Parsing
This code is distributed under the New BSD License. See the file LICENSE.