项目作者: lyy1994

项目描述 :
An NMT framework built on Joint Representation
高级语言: Python
项目地址: git://github.com/lyy1994/reformer.git
创建时间: 2019-01-26T09:38:24Z
项目社区:https://github.com/lyy1994/reformer

开源协议:Other

下载


Reformer

PyTorch original implementation of Neural Machine Translation with Joint Representation. It is modified from fairseq-0.6.0.

Requirements

  • PyTorch version == 1.1.0
  • Python version == 3.6.7

Get started

Installation

You need to install it first:

  1. git clone https://github.com/lyy1994/reformer.git
  2. cd reformer
  3. pip install -r requirements.txt
  4. python setup.py build develop

Structure

Before running the training and decoding scripts, we implicitly make assumptions on the file directory structure:

  1. |- reformer (code)
  2. |- data
  3. |- data-bin
  4. |- BINARIZED_DATA_FOLDER
  5. |- RAW_DATA_FOLDER
  6. |- train (training set raw text)
  7. |- valid (validation set raw text)
  8. |- test (test set raw text)
  9. |- checkpoints
  10. |- torch-1.1.0
  11. |- EXPERIMENT_FOLDER
  12. |- toolkit
  13. |- multi-bleu.perl

Usage

To train a model, run:

  1. cd reformer/scripts
  2. sh train.sh

To decode from the trained model, run:

  1. sh decode.sh

If you would like to customize the configuration, please modify train.sh for training and decode.sh for decoding.

The table below summarizes the scripts for reproducing our experiments:

Dataset Script
IWSLT14 German-English iwslt-train.sh
NIST12 Chinese-English nist-train.sh

Citation

  1. @inproceedings{li2020aaai,
  2. title = {Neural Machine Translation with Joint Representation},
  3. author = {Yanyang Li and Qiang Wang and Tong Xiao and Tongran Liu and Jingbo Zhu},
  4. booktitle = {Proceedings of the Thirty-Fourth AAAI Conference on Artificial Intelligence},
  5. year = {2020},
  6. }