Skip to main content

Transition-based UCCA Parser

Project description

TUPA is a transition-based parser for Universal Conceptual Cognitive Annotation (UCCA).

Requirements

  • Python 3.x

Build

Install the required modules:

git submodule update --init --recursive
virtualenv --python=/usr/bin/python3 .
. bin/activate  # on bash
source bin/activate.csh  # on csh
pip install -r requirements.txt
python -m spacy download en
python ucca/setup.py install
python setup.py install

Train the parser

Having a directory with UCCA passage files (for example, the Wiki corpus), run:

python tupa/parse.py -t <train_dir> -d <dev_dir> -m <model_filename>

To specify a model type (sparse, mlp or bilstm), add -c <model_type>.

Parse a text file

Run the parser on a text file (here named example.txt) using a trained model:

python tupa/parse.py example.txt -m <model_filename>

A file named example.xml will be created.

If you specified a model type using -c when training the model, be sure to include it when parsing too.

Pre-trained models

To download and extract the pre-trained models, run:

wget http://www.cs.huji.ac.il/~danielh/ucca/{sparse,mlp,bilstm}.tgz
tar xvzf sparse.tgz
tar xvzf mlp.tgz
tar xvzf bilstm.tgz

Run the parser using any of them:

python tupa/parse.py example.txt -c sparse -m models/ucca-sparse
python tupa/parse.py example.txt -c mlp -m models/ucca-mlp
python tupa/parse.py example.txt -c bilstm -m models/ucca-bilstm

Author

Citation

If you make use of this software, please cite the following paper:

@inproceedings{hershcovich2017a,
  title={A Transition-Based Directed Acyclic Graph Parser for {UCCA}},
  author={Hershcovich, Daniel and Abend, Omri and Rappoport, Ari},
  booktitle={Proc. of ACL},
  year={2017}
}

License

This package is licensed under the GPLv3 or later license (see `LICENSE.txt <LICENSE.txt>`__).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TUPA-1.0.post5.tar.gz (89.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page