Code Monkey home page Code Monkey logo

diversenmt's Introduction

Modeling Fluency and Faithfulness for Diverse Neural Machine Translation

PyTorch implementation of the models described in the AAAI2020 long paper Modeling Fluency and Faithfulness for Diverse Neural Machine Translation.

Related code

Implemented based on Fairseq-py, an open-source toolkit released by Facebook which was implemented strictly referring to Vaswani et al. (2017).

DiverseNMT

Download the preprocessed WMT'16 EN-DE data provided by Google and extract it and preprocess the dataset with a joined dictionary.

Train a base model.

$ sh run_ende.sh

Inference the test set.

$ python generate.py $DATA --path $SMODEL \
    --gen-subset test --beam 4 --batch-size 128 \
    --remove-bpe --lenpen 0.6 > pred.de \
# because fairseq's output is unordered, we need to recover its order
$ grep ^H pred.de | cut -f1,3- | cut -c3- | sort -k1n | cut -f2- > pred.de

Citation

If you find the resources in this repository useful, please consider citing:

@article{feng2019modeling,
  title={Modeling Fluency and Faithfulness for Diverse Neural Machine Translation},
  author={Feng, Yang and Xie, Wanying and Gu, Shuhao and Shao, Chenze and Zhang, Wen and Yang, Zhengxin and Yu, Dong},
  journal={arXiv preprint arXiv:1912.00178},
  year={2019}
}

diversenmt's People

Watchers

James Cloos 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.