GithubHelp home page GithubHelp logo

gw0 / conll16st-sronnqvist-ablstm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sronnqvist/discourse-ablstm

0.0 2.0 1.0 79.45 MB

Attention-based Bidirectional Long Short-Term Memory neural network for classification of Chinese implicit discourse relations

Python 100.00%

conll16st-sronnqvist-ablstm's Introduction

Att-BiLSTM neural network for discourse sense classification

Attention-based Bidirectional Long Short-Term Memory model for classification of Chinese implicit discourse relations.

Code developed by Samuel Rönnqvist, with contributions and comments from Farrokh Mehryary, Niko Schenk and Philip Schultz.

NOTE: The original model from these authors performs bad on the blind test dataset from CoNLL2016st! It also cheats by shuffling the training and validation datasets and show much better validation score! The partial sampling implementation differs from the one in the paper, because it contains a bug. Otherwise, the attention layer is unusual, because it is computed in respect to a fixed query vector.

Results after fixing these issues (see output-corrected.txt and output-original.txt):

Trainable params: 6,569,710
Best validation score: 64.78
with test score: 69.03
with blind score: 62.99

This repository hosts the corrected model described in:

Samuel Rönnqvist, Niko Schenk and Christian Chiarcos. A Recurrent Neural Model with Attention for the Recognition of Chinese Implicit Discourse Relations. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (ACL). 2017.

@inproceedings{ronnqvist2017ablstm,
  author    = {Samuel R\"onnqvist and Niko Schenk and Christian Chiarcos},
  title     = {{A Recurrent Neural Model with Attention for the Recognition of Chinese Implicit Discourse Relations}},
  booktitle = {Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (ACL)},
  month     = {July},
  year      = {2017},
  address   = {Vancouver, BC, Canada},
  publisher = {Association for Computational Linguistics}
}

The paper is also available as a poster, which was presented at the ACL conference.

The work is licensed under Creative Commons Attribution 4.0 International, for academic use please cite above paper.

Requirements

Installing required software:

apt-get install python3 python3-pip

pip3 install numpy h5py gensim
pip3 install keras==1.2.0

gzip -d zh-gw300_intersect.w2v.gz

For training use:

KERAS_BACKEND=theano python3 train.py

Code is developed for Keras 1.2.x, not fully compatible with Keras 2. Use Keras backend "theano".

Alternatively run it inside the Docker container gw000/keras-full:

docker run -it --rm -v $(pwd):/srv --user root gw000/keras-full:1.2.0 bash
pip3 install numpy h5py gensim
KERAS_BACKEND=theano python3 train.py

For training model on GPU using Docker:

docker run -it --rm $(ls /dev/nvidia* | xargs -I{} echo '--device={}') $(ls /usr/lib/*-linux-gnu/{libcuda,libnvidia}* | xargs -I{} echo '-v {}:{}:ro') -v $(pwd):/srv --user root gw000/keras-full:1.2.0 bash
pip3 install numpy h5py gensim
KERAS_BACKEND=theano THEANO_FLAGS='device=gpu,floatX=float32,nvcc.fastmath=True,lib.cnmem=0.45' python3 train.py

Data is provided through LDC and was used for CoNLL-2016 Shared Task.

conll16st-sronnqvist-ablstm's People

Contributors

gw0 avatar sronnqvist avatar

Watchers

 avatar  avatar

Forkers

tjuzcguo

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.