Coder Social home page Coder Social logo

tupa's Introduction

Transition-based UCCA Parser Build Status

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

Requirements

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.en.download all
ci/install-dynet.sh
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).

tupa's People

Contributors

danielhers avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.