Coder Social home page Coder Social logo

divyanshugit / emnlp2021-sixt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ghchen18/emnlp2021-sixt

0.0 0.0 0.0 487 KB

Code for EMNLP 2021 paper 'Zero-shot Cross-lingual Transfer of NMT with Multilingual Pretrained Encoders'

License: MIT License

Shell 0.34% C++ 0.84% Python 96.35% Cuda 1.92% Cython 0.55%

emnlp2021-sixt's Introduction

EMNLP'21 Zero-shot Cross-lingual Transfer of NMT with Multilingual Pretrained Encoders

This is the official repo for the EMNLP 2021 paper "Zero-shot Cross-lingual Transfer of Neural Machine Translation with Multilingual Pretrained Encoders" [paper].

The code uses pytorch and is based on fairseq v0.9.0. Please refer to the official fairseq repo for more details about the instructions and examples about fairseq toolkit. You can follow the steps below to replicate the experiments in the paper. Before start, first install relevant packages. The fairseq package should be built with this repo.

## create conda env first
cd /path/to/this/repo
python -m pip install -e . --user   ## install fairseq toolkit with this repo

Step 1: preprocess data

First download the off-the-shelf xlmr-base and xlmr-large models from the official repo. Then download the training/validation/test data from WMT/WAT/CC-align/FLores/Tatoba etc., the detailed urls are in the paper appendix. Suppose all files are placed under a path dataloc=/path/to/your/raw/data. Then use the preprocess.py to binarize the dataset: bash scripts/preprocess.sh, more details are in the shell script.

Step 2: Train the SixT model with two-stage training

The proposed SixT model can be trained with the processed dataset. bash scripts/run.sh to train SixT model in two training stages. More details are in the shell script.

Step 3: Test the SixT model in the testsets

After the model is trained, you can directly test it in a zero-shot manner. The testsets are also needed to be binarized with the preprocess.sh script. See more in scripts/run.sh.

Citation

If you find our work useful for your research, welcome to cite the following paper:

@inproceedings{chen2021zeroshot,
    title={Zero-shot Cross-lingual Transfer of Neural Machine Translation with Multilingual Pretrained Encoders}, 
    author = "Chen, Guanhua  and
      Ma, Shuming  and
      Chen, Yun  and
      Dong, Li  and
      Zhang, Dongdong  and
      Pan, Jia  and
      Wang, Wenping  and
      Wei, Furu",
    year={2021},
    booktitle = "Proceedings of EMNLP",
    month = nov,
    year = "2021",
    pages = "15--26",
}

emnlp2021-sixt's People

Contributors

ghchen18 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.