Coder Social home page Coder Social logo

past-and-future-nmt's Introduction

past-and-future-nmt

Modeling Past and Future for Neural Machine Translation


If you use the code, which is implemeted on the popular codebase Nematus, please cite our paper:

@article{Zheng:2018:TACL,
  author    = {Zheng, Zaixiang and Zhou, Hao and Huang, Shujian and Mou, Lili and Dai Xinyu and Chen, Jiajun and Tu, Zhaopeng},
  title     = {Modeling Past and Future for Neural Machine Translation},
  journal   = {Transactions of the Association for Computational Linguistics},
  year      = {2018},
}

Requirements

  1. python2.7
  2. Theano >= 0.9
  3. mosesdecoder (only scripts needed)
  4. cuda >= 8.0

Usage

  1. Data preparation
  2. Pretraining a RNNSearch model on Nematus
  3. Training
  4. Testing

Data preparation

Pretrain a RNNSearch model on Nematus

Training

Run ./scripts/train.sh (edit it if needed) for training. See ./scripts/train.sh for details.

model-specific options

option description (value)
--use_past_layer (bool, default: False) whether to apply past layer
--use_future_layer (bool, default: False) whether to apply future layer
--future_layer_type (str, default: "gru_inside") type of RNN cell for future layer,
only support ["gru", "gru_outside", "gru_inside"]
--use_subtractive_loss (bool, default: False) whether to use subtractive loss on past or(and) future layer
--use_testing_loss (bool, default: False) whether to use subtractive loss during testing phase

Testing

Run ./scripts/test.sh (edit it if needed) for testing. See ./scripts/test.sh for details.

past-and-future-nmt's People

Contributors

tuzhaopeng avatar zhengzx-nlp avatar

Watchers

 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.