quickmt-en-ko / README.md
radinplaid's picture
Upload folder using huggingface_hub
33819ce verified
metadata
language:
  - en
  - ko
tags:
  - translation
license: cc-by-4.0
datasets:
  - quickmt/quickmt-train.ko-en
model-index:
  - name: quickmt-en-ko
    results:
      - task:
          name: Translation eng-kor
          type: translation
          args: eng-kor
        dataset:
          name: flores101-devtest
          type: flores_101
          args: eng_Latn kor_Hang devtest
        metrics:
          - name: CHRF
            type: chrf
            value: 56.25
          - name: BLEU
            type: bleu
            value: 27.03
          - name: COMET
            type: comet
            value: 86.11

quickmt-en-ko Neural Machine Translation Model

quickmt-en-ko is a reasonably fast and reasonably accurate neural machine translation model for translation from en into ko.

Model Information

See the eole model configuration in this repository for further details and the eole-model for the raw eole (pytorch) model.

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/

quickmt-model-download quickmt/quickmt-en-ko ./quickmt-en-ko

Finally use the model in python:

from quickmt import Translator

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

# Translate - set beam size to 5 for higher quality (but slower speed)
sample_text = 'Dr. Ehud Ur, professor of medicine at Dalhousie University in Halifax, Nova Scotia and chair of the clinical and scientific division of the Canadian Diabetes Association cautioned that the research is still in its early days.'
t(sample_text, beam_size=5)

# 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 ("kor_Hang"->"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 (faster speed is possible using a large batch size).

bleu chrf2 comet22 Time (s)
quickmt/quickmt-en-ko 14.97 36.96 87.10 1.36
facebook/nllb-200-distilled-600M 12.15 33.66 87.39 24.75
facebook/nllb-200-distilled-1.3B 13.23 35.62 88.39 40.29
facebook/m2m100_418M 9.91 30.69 83.20 22.23
facebook/m2m100_1.2B 11.35 33.26 85.65 41.15

quickmt-en-ko is the fastest and is higher quality than m2m100_418m, m2m100_1.2B and nllb-200-distilled-600M.