Dependency parser based on Alpino and KAF/NAF as input/output
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
alpino_dependency_parser.py
config.cfg
config.ic.cfg
config.kyoto.cfg

README.md

#Dependency parser for Dutch#

This module implements a dependency parser for Dutch based on the Alpino parser. The input/output format is KAF/NAF format (a description of the KAF format can be found at https://github.com/opener-project/kaf/wiki/KAF-structure-overview). This is the specification of the input/output:

  • Input: a valid KAF/NAF file at least with the <text> and <term> layer
  • Output: the input KAF/NAF file extended with dependencies (<deps> layer)

#Installation#

This module is fully implemented using Python, so you will need to have it installed on your machine (recommented version 2.7). There are some requirements:

These are the steps recommend for the installation. You can skip any step if that tool/library is already installed on your machine.

##1 Install the Alpino parser##

To install the Alpino parser we recommend to download the binary package that suits your system (http://www.let.rug.nl/vannoord/alp/Alpino/binary/)

##2 Install the lxml library##

If you have "pip" install on your machine, for installing lxml you just have to run:

pip install lxml

You can check the installation procesure at http://lxml.de/installation.html

##3 Install the KafNafParser##

This is a python module, and you will need just to clone it in order to have it installed. Execute this command:

git clone https://github.com/cltl/KafNafParserPy.git

##4 Install the dependency parser##

Again only cloning the repository from our CLTL github account is required:

git clone https://github.com/cltl/dependency-parser-nl.git

##5 Setting up##

The dependency parser needs to know where Alpino and the KafNafParser were installed. So you will have to specify the path to these tools in the file config.cfg. Open it with a text editor and set the paths to the correct paths where you installed Alpino and KafNafParser in your local machine. If Alpino has been installed on "/Users/ruben/NLP_tools/Alpino" and the KafNafParser on "/Users/ruben/cltl_github/KafNafParserPy" this is an example of configuration file:

[general]
alpino_home = /Users/ruben/NLP_tools/Alpino/
kaf_naf_parser_path = /Users/ruben/cltl_github/

Note than the name of the repository must be excluded from the variable kaf_naf_parser_path.

#Running#

The main script is the file alpino_dependency_parser.py. This script reads a KAF/NAF from the standard input and writes the resulting KAF/NAF on the standard output, generating some log information on the standard error. These are some examples:

$ cat input.kaf | alpino_dependency_parser.py > output.kaf 2> output.err
$ cat input.naf | python alpino_dependency_parser.py > output.naf 2> /dev/null

If the first call doesn't work in your case, try calling "python" specifically, as in the second example.

#Contact#

#License#

Sofware distributed under GPL.v3, see LICENSE file for details.