quickmt-en-fr Neural Machine Translation Model
quickmt-en-fr is a reasonably fast and reasonably accurate neural machine translation model for translation from en into fr.
Model Information
- Trained using
eole - 185M parameter transformer 'big' with 8 encoder layers and 2 decoder layers
- 50k joint Sentencepiece vocabulary
- Exported for fast inference to CTranslate2 format
- Training data: https://huggingface.co/datasets/quickmt/quickmt-train.fr-en/tree/main
See the eole-config.yaml model configuration in this repository for further details.
Usage with quickmt
You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
Next, install the quickmt python library and download the model:
git clone https://github.com/quickmt/quickmt.git
pip install ./quickmt/
# List available models
quickmt-list
# Download a model
quickmt-model-download quickmt/quickmt-en-fr ./quickmt-en-fr
Finally use the model in python:
from quickmt import Translator
# Auto-detects GPU, set to "cpu" to force CPU inference
t = Translator("./quickmt-en-fr/", device="auto")
# Translate - set beam size to 5 for higher quality (but slower speed)
sample_text = "The Virgo interferometer is a large-scale scientific instrument near Pisa, Italy, for detecting gravitational waves."
t(sample_text, beam_size=1)
# Get alternative translations by sampling
# You can pass any cTranslate2 `translate_batch` arguments
t([sample_text], sampling_temperature=1.2, beam_size=1, sampling_topk=50, sampling_topp=0.9)
The model is in ctranslate2 format, and the tokenizers are sentencepiece, so you can use ctranslate2 directly instead of through quickmt. It is also possible to get this model to work with e.g. LibreTranslate which also uses ctranslate2 and sentencepiece.
Metrics
bleu and chrf2 are calculated with sacrebleu on the Flores200 devtest test set ("eng_Latn"->"fra_Latn"). comet22 with the comet library and the default model. "Time (s)" is the time in seconds to translate (using ctranslate2) the flores-devtest dataset (1012 sentences) on an RTX 4070s GPU with batch size 32.
| Model | chrf2 | bleu | comet22 | Time (s) |
|---|---|---|---|---|
| quickmt/quickmt-en-fr | 71.60 | 50.79 | 87.11 | 1.28 |
| Helsinki-NLP/opus-mt-en-fr | 69.98 | 47.97 | 86.29 | 4.13 |
| facebook/m2m100_418M | 63.29 | 39.52 | 82.11 | 22.4 |
| facebook/m2m100_1.2B | 68.31 | 45.39 | 86.50 | 44.0 |
| facebook/nllb-200-distilled-600M | 70.36 | 48.71 | 87.63 | 27.8 |
| facebook/nllb-200-distilled-1.3B | 71.95 | 51.10 | 88.50 | 47.8 |
quickmt-en-fr is the fastest and is higher quality than opus-mt-en-fr, m2m100_418m, m2m100_1.2B.
- Downloads last month
- 25
Collection including quickmt/quickmt-en-fr
Evaluation results
- CHRF on flores101-devtestself-reported71.600
- BLEU on flores101-devtestself-reported50.790
- COMET on flores101-devtestself-reported87.110