No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.idea small changes Mar 4, 2017
data release the code Dec 3, 2016
utils next try: adaptive supervised learning Mar 9, 2017
LICENSE Update LICENSE Mar 15, 2017
README.md Update README.md Dec 10, 2016
__init__.py release the code Dec 3, 2016
actors.py add actor.py Mar 12, 2017
bleu.py release the code Dec 3, 2016
bleu.pyc next try: adaptive supervised learning Mar 9, 2017
config.py regular commit Mar 10, 2017
config.pyc regular commit Mar 10, 2017
data_iterator.py middle changes Mar 6, 2017
data_iterator.pyc next try: adaptive supervised learning Mar 9, 2017
insepection.py release the code Dec 3, 2016
insepection.pyc next try: adaptive supervised learning Mar 9, 2017
itchat.pkl regular updates Mar 8, 2017
layers.py regular commit Mar 13, 2017
layers.pyc next try: adaptive supervised learning Mar 9, 2017
mteval.sh release the code Dec 3, 2016
nmt_uni.py regular commit Mar 10, 2017
nmt_uni.pyc regular commit Mar 10, 2017
optimizer.py middle changes Mar 6, 2017
optimizer.pyc next try: adaptive supervised learning Mar 9, 2017
plot_heatmap.ipynb next try: adaptive supervised learning Mar 9, 2017
policy.py regular updates Mar 8, 2017
policy.pyc next try: adaptive supervised learning Mar 9, 2017
pretrain_uni.py add a simultaneous teacher forcing Mar 9, 2017
reward.py long time no commit Feb 25, 2017
reward.pyc next try: adaptive supervised learning Mar 9, 2017
run_eval.sh release the code Dec 3, 2016
run_train.sh long time no commit Feb 25, 2017
show_progress.ipynb a notebook to show the progress Dec 6, 2016
simultrans_beam.py release the code Dec 3, 2016
simultrans_eval.py release the code Dec 3, 2016
simultrans_model.py simultaneous test Mar 5, 2017
simultrans_model.pyc long time no commit Feb 25, 2017
simultrans_model_clean.py regular commit Mar 10, 2017
simultrans_model_clean.pyc regular commit Mar 10, 2017
simultrans_train.py regular commit Mar 13, 2017
translate_uni.py release the code Dec 3, 2016
translate_uni.sh release the code Dec 3, 2016
utils.py release the code Dec 3, 2016
utils.pyc next try: adaptive supervised learning Mar 9, 2017

README.md

Learning to Translate in Real-time with Neural Machine Translation

Translation in Real-time, a.k.a, Simultaneous Translation.

This code is the Theano implementation of the EACL2017 paper Learning to Translate in Real-time with Neural Machine Translation. It is based on the dl4mt-tutorial (https://github.com/nyu-dl/dl4mt-tutorial).

Dependencies:

Python 2.7

  • Theano 0.8.2 (cuda 8.0, cudnn v5)
  • seaborn, pandas (for drawing the heatmap)
  • NLTK 3.2.1

Preprocessing

The preprocessing and evaluation scripts are from MOSES.

Dataset:

We used the WMT'15 corpora as our training set for both pretraining the NMT model and training the Simultaneous NMT model. The original WMT'15 corpora can be downloaded from here. For the preprocessed corpora used in our experiments, both the source and target datasets are preprocessed using byte-pair encoding (http://arxiv.org/abs/1508.07909, https://github.com/rsennrich/subword-nmt).

Pretraining:

Before training the agent for simultaneous translation, the underlined translation model requires pretraining. In our experiments, we pretrained single-layer undirectional NMT for both RU-EN and DE-EN corpora for both directions.

Pretrain your own model:

Follow the instructions and setup the configurations in config.py (pretrain_config) and then excute:

$ export THEANO_FLAGS=device=gpu,floatX=float32
$ python pretrain_uni.py

It normally takes 1~2 weeks for training an unidirectional NMT model for WMT15 corpora.

Evaluate the BLEU score for a pre-trained NMT model

TBA.

Simultaneous Translation:

Training an Agent

Follow the instructions and setup the configurations in config.py (rl_config) and then excute:

$ export THEANO_FLAGS=device=gpu,floatX=float32
$ python simultrans_train.py

Monitoring

TBA.

Visualization