Views
No views yet
quickmt-en-ko Neural Machine Translation Modelquickmt-en-ko is a reasonably fast and reasonably accurate neural machine translation model for translation from en into ko.eoleeole model configuration in this repository for further details and the eole-model for the raw eole (pytorch) model.quickmtquickmt python library.1git clone https://github.com/quickmt/quickmt.git
2pip install ./quickmt/1from quickmt import Translator
2from huggingface_hub import snapshot_download
3
4# Download Model (if not downloaded already) and return path to local model
5# Device is either 'auto', 'cpu' or 'cuda'
6t = Translator(
7 snapshot_download("quickmt/quickmt-en-ko", ignore_patterns="eole-model/*"),
8 device="cpu"
9)
10
11# Translate - set beam size to 5 for higher quality (but slower speed)
12sample_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.'
13t(sample_text, beam_size=5)
14
15# Get alternative translations by sampling
16# You can pass any cTranslate2 `translate_batch` arguments
17t([sample_text], sampling_temperature=1.2, beam_size=1, sampling_topk=50, sampling_topp=0.9)
18
19> '노바 스코샤 주 핼리팩스에 있는 댈하우지 대학교 의과 교수인 에후드 우르 박사와 캐나다 당뇨병 협회의 임상 및 과학 부문 의장은 이 연구가 아직 초기 단계에 있다고 경고했다.'
20ctranslate2 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.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.