README.md 1.48 KB
Newer Older
1
2
3
4
5
6
7
8
# Understanding Back-Translation at Scale (Edunov et al., 2018)

This page includes pre-trained models from the paper [Understanding Back-Translation at Scale (Edunov et al., 2018)](https://arxiv.org/abs/1808.09381).

## Pre-trained models

Description | Dataset | Model | Test set(s)
---|---|---|---
9
Transformer <br> ([Edunov et al., 2018](https://arxiv.org/abs/1808.09381); WMT'18 winner) | [WMT'18 English-German](http://www.statmt.org/wmt18/translation-task.html) | [download (.tar.gz)](https://dl.fbaipublicfiles.com/fairseq/models/wmt18.en-de.ensemble.tar.gz) | See NOTE in the archive
10

Myle Ott's avatar
Myle Ott committed
11
12
13
14
15
## Example usage

Interactive generation from the full ensemble via PyTorch Hub:
```
>>> import torch
Myle Ott's avatar
Myle Ott committed
16
17
>>> torch.hub.list('pytorch/fairseq')
[..., 'transformer.wmt14.en-fr', 'transformer.wmt16.en-de', 'transformer.wmt18.en-de', ... ]
Myle Ott's avatar
Myle Ott committed
18
19
>>> en2de_ensemble = torch.hub.load(
...   'pytorch/fairseq',
Myle Ott's avatar
Myle Ott committed
20
...   'transformer.wmt18.en-de',
Myle Ott's avatar
Myle Ott committed
21
22
23
24
25
26
27
28
29
30
31
...   checkpoint_file='wmt18.model1.pt:wmt18.model2.pt:wmt18.model3.pt:wmt18.model4.pt:wmt18.model5.pt',
...   data_name_or_path='.',
...   tokenizer='moses',
...   bpe='subword_nmt',
... )
>>> len(en2de_ensemble.models)
5
>>> print(en2de_ensemble.generate('Hello world!'))
Hallo Welt!
```

32
33
34
35
36
37
38
39
40
## Citation
```bibtex
@inproceedings{edunov2018backtranslation,
  title = {Understanding Back-Translation at Scale},
  author = {Edunov, Sergey and Ott, Myle and Auli, Michael and Grangier, David},
  booktitle = {Conference of the Association for Computational Linguistics (ACL)},
  year = 2018,
}
```