Code Monkey home page Code Monkey logo

encoder-decoder-parser's Introduction

This implementation is based on the dynet2.0 library for this software to function. The paper is "Encoder-Decoder Shift-Reduce Syntactic Parsing", and the codes of experiments are based on the branch v_old.

Building

mkdir build
cd build
cmake .. -DEIGEN3_INCLUDE_DIR=/path/to/eigen
make    

Add -DBACKEND=cuda to cmake for GPU compile.

Data

Dependency oracle

python ./scripts/get_dependency_standard_oracle.py [training data in CoNLL format] [training data in CoNLL format] > [training dep oracle]
python ./scripts/get_dependency_standard_oracle.py [training data in CoNLL format] [depelopment data in CoNLL format] > [depelopment dep oracle]
python ./scripts/get_dependency_standard_oracle.py [training data in CoNLL format] [test data in CoNLL format] > [test dep oracle]

Constituent oracle

python ./scripts/get_constituent_topdown_oracle.py [training data in bracketed format] [training data in bracketed format] > [training con oracle]
python ./scripts/get_constituent_topdown_oracle.py [training data in bracketed format] [development data in bracketed format] > [development con oracle]
python ./scripts/get_constituent_topdown_oracle.py [training data in bracketed format] [test data in bracketed format] > [test con oracle]

Training

Dependency parsing

./dependency-parser --dynet-mem 2400 --train_file [training dep oracle] --dev_file [development dep oracle] --words_file [pretrained word embeddings] --layers 2 --action_dim 40 --input_dim 64 --pos_dim 6 --pretrained_dim 100 --rel_dim 20 --bilstm_input_dim 100 --bilstm_hidden_dim 200 --attention_hidden_dim 50 --train_methods 3 --train --use_pos --unk_strategy --unk_prob 0.2 --pdrop 0.3 

Constituent parsing

./constituent-parser --dynet-mem 1700 --train_file [training con oracle] --dev_file [development con oracle] --bracketed_file [development data in bracketed format] --layers 2 --input_dim 64 --pos_dim 6 --bilstm_input_dim 100 --bilstm_hidden_dim 200 --attention_hidden_dim 50 --words_file [pretrained word embeddings] --pretrained_dim 100 --action_dim 40 --train --use_pos --unk_strategy

Decoding

Dependency parsing

./dependency-parser --dynet-mem 2400 --train_file [training dep oracle] --test_file [test dep oracle] --words_file [pretrained word embeddings] --layers 2 --action_dim 40 --input_dim 64 --pos_dim 6 --pretrained_dim 100 --rel_dim 20 --bilstm_input_dim 100 --bilstm_hidden_dim 200 --attention_hidden_dim 50 --train_methods 3 --use_pos --model_file [model]

Constituent parsing

./constituent-parser --dynet-mem 1700 --train_file [training con oracle] --test_file [test con oracle] --bracketed_file [test data in bracketed format] --layers 2 --input_dim 64 --pos_dim 6 --bilstm_input_dim 100 --bilstm_hidden_dim 200 --attention_hidden_dim 50 --words_file [pretrained word embeddings] --pretrained_dim 100 --action_dim 40 --use_pos --model_file [model]

Citation

   @inproceedings{liu2017encoder
       title={Encoder-Decoder Shift-Reduce Syntactic Parsing},
       author={Liu, Jiangming and Zhang, Yue},
       booktitle={IWPT},
       year={2017},
       pages={105-114}
}        

encoder-decoder-parser's People

Contributors

leoncrashcode avatar

Watchers

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