Translate is a library for machine translation written in PyTorch. It provides training for sequence-to-sequence models. These models can be exported to Caffe2 graphs via ONNX, loaded and run from C++ for production purposes. Translate relies on fairseq, a general sequence-to-sequence library.
Translate requires
- Mac OS X or Linux
- A CUDA installation
To install Translate, please refer to the install.sh
script. In short, run bash install.sh
.
We provide a example script to train a model for the IWSLT 2014 German-English task. We used this command to obtain a pretrained model:
bash fbtranslate/examples/train_iwslt14.sh
The pretrained model actually contains two checkpoints that correspond to training twice with random initialization of the parameters. This is useful to obtain ensembles.
A pretrained model for IWSLT 2014 can be evaluated by running the example script:
bash fbtranslate/examples/generate_iwslt14.sh
Note the improvement in performance when using an ensemble of size 2 instead of a single model.
TODO
We welcome contributions! See the CONTRIBUTING.md
file for how to help out.
Translate is BSD-licensed, as found in the LICENSE file.