Coder Social home page Coder Social logo

fairseq-dro-mnmt's Introduction

Distributionally Robust Multilingual Machine Translation

This repository contains codes for experiments in the following paper.

Distributionally Robust Multilingual Machine Translation
Chunting Zhou*, Daniel Levy*, Xian Li, Marjan Ghazvininejad, Graham Neubig
EMNLP 2021

illustration

Setup

  • This repo is based on fairseq (tag v0.10.0) (please follow the instructions in the fairseq repo for requirements on apex, Python and Pytorch version.)
    cd fairseq; pip install --editable ./
    

Training and Inference

Slurm scripts for training and decoding on the TED58 dataset can be found under exps/. The preprocessing scripts of the datasets in the paper can be found under utils/. Please replace the data path to your own MT data if you'd like to train on a different dataset.

sbatch exps/1_baseline_t1_chi_square_0.05_ted.sh

To compute the baseline losses, exps/eval_baselines_ted.sh is an example script of how to load a pretrained ERM model for computing the average loss on the training set.

Other baseline methods

The scripts for running other baseline methods can be found under exps/ as well, similarly, please replace with your own dataset hyperparameters correspondingly.

  1. ERM

    sbatch exps/2_erm.sh or bash exps/2_erm.sh (need slight modification on the env variable SLURM_ARRAY_TASK_ID).

  2. CVaR group DRO with primal-dual method

    sbatch exps/3_baseline_cvar_pd.sh

  3. CVaR group DRO with our iterated best response (IBR)

    sbatch exps/4_baseline_cvar_ibr.sh

  4. Chi-square group DRO with primal-dual method

    sbatch exps/5_baseline_chi_square_primal_dual.sh

  5. group DRO (Sagawa et al., 2020)
    sbatch exps/6_baseline_eg_reweight.sh

Reference

@inproceedings{zhou21emnlp,
    title = {Distributionally Robust Multilingual Machine Translation},
    author = {Chunting Zhou and Daniel Levy and Xian Li and Marjan Ghazvininejad and Graham Neubig},
    booktitle = {Conference on Empirical Methods in Natural Language Processing (EMNLP)},
    address = {Punta Cana, Dominican Republic},
    month = {November},
    year = {2021}
}

fairseq-dro-mnmt's People

Contributors

daniellevy avatar violet-zct 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.