Code Monkey home page Code Monkey logo

stagedp's Introduction

Two-stage Discourse Parser

Here we implement the RST discourse parser described in A Two-stage Parsing Method for Text-level Discourse Analysis.

The best-trained models are put in the data/model folder. Due to the licence of RST data corpus, we can't include the data in our project folder. To reproduce the result in the paper, you need to download it from the LDC, preprocess the data as we state below and evaluate the model with python3 main.py --eval --eval_dir EVAL_DIR.

Usage:

  1. Preprocess the data:

    This project relies on Stanford CoreNLP toolkit to preprocess the data. You can download from here and put the file run_corenlp.sh into the CoreNLP folder. Then use the following command to preprocess both the data in train_dir and in test_dir.

    python3 preprocess.py [-h] --data_dir DATA_DIR --corenlp_dir CORENLP_DIR
    
  2. Extract feature templates, action maps and relation maps:

    python3 main.py --prepare --train_dir TRAIN_DIR --eval_dir EVAL_DIR
    
  3. Train model:

    python3 main.py --train --train_dir TRAIN_DIR
    
  4. Evaluate model:

    python3 main.py --eval --eval_dir EVAL_DIR
    

Requirements:

All the codes are tested under Python 3.5. And see requirements.txt for python library dependency and you can install them with pip.

stagedp's People

Contributors

yizhongw 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.