quickmt-en-zh Neural Machine Translation Model

Usage

Install quickmt

git clone https://github.com/quickmt/quickmt.git
pip install ./quickmt/

Download model

quickmt-model-download quickmt/quickmt-en-zh ./quickmt-en-zh

Use model

Inference with quickmt:

from quickmt import Translator

# Auto-detects GPU, set to "cpu" to force CPU inference
t = Translator("./quickmt-en-zh/", device="auto")

# Translate - set beam size to 5 for higher quality (but slower speed)
t(["The roe deer (Capreolus capreolus), also known as the roe, western roe deer,[3][4] or European roe,[3] is a species of deer."], beam_size=1)

# Get alternative translations by sampling
# You can pass any cTranslate2 `translate_batch` arguments
t(["The roe deer (Capreolus capreolus), also known as the roe, western roe deer,[3][4] or European roe,[3] is a species of deer."], 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 the model files directly if you want. It would be fairly easy to get them to work with e.g. LibreTranslate which also uses ctranslate2 and sentencepiece.

Model Information

See eole-config.yaml for more detail.

Metrics

CHRF2 calculated with sacrebleu on the Flores200 devtest test set ("eng_Latn"->"zho_Hans").

"GPU Time" is the time to translate the flores-devtest corpus using a batch size of 32 on a GTX 1080 GPU. "CPU Time" is the time to translate the following input with a single CPU core:

James Joyce (2 February 1882 – 13 January 1941) was an Irish novelist, poet and literary critic who contributed to the modernist avant-garde movement and is regarded as one of the most influential and important writers of the 20th century.

Model chrf2 comet22 CPU Time (s) GPU Time (s)
quickmt/quickmt-zh-en 34.53 0.8512 1.91 3.92
Helsinki-NLP/opus-mt-zh-en 29.20 0.8236 1.50 10.10
facebook/m2m100_418M 26.63 0.7376 10.2 49.02
facebook/nllb-200-distilled-600M 24.68 0.7840 13.2 55.92

quickmt-en-zh is the highest quality and is the fastest on GPU (and not far behind on CPU).

Helsinki-NLP/opus-mt-en-zh is one of the most downloaded machine translation models on HuggingFace, and this model is considerably more accurate and similar in speed.

Downloads last month
8
Inference Providers NEW
This model is not currently available via any of the supported third-party Inference Providers, and HF Inference API was unable to determine this model's library.

Dataset used to train quickmt/quickmt-en-zh

Evaluation results