quickmt-en-fr / README.md
radinplaid's picture
Upload folder using huggingface_hub
f9ebc67 verified
metadata
language:
  - en
  - fr
tags:
  - translation
license: cc-by-4.0
datasets:
  - quickmt/quickmt-train.en-fr
model-index:
  - name: quickmt-en-fr
    results:
      - task:
          name: Translation fra-eng
          type: translation
          args: fra-eng
        dataset:
          name: flores101-devtest
          type: flores_101
          args: eng_Latn fra_Latn devtest
        metrics:
          - name: CHRF
            type: chrf
            value: 71.6
          - name: BLEU
            type: bleu
            value: 50.79
          - name: COMET
            type: comet
            value: 87.11

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

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 ("fra_Latn"->"eng_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.