--- language: - uk - en tags: - translation license: cc-by-4.0 datasets: - quickmt/quickmt-train.uk-en - quickmt/finetranslations-sample-uk-en - HuggingFaceFW/finetranslations model-index: - name: quickmt-en-uk results: - task: name: Translation eng-ukr type: translation args: eng-ukr dataset: name: flores101-devtest type: flores_101 args: eng_Latn ukr_Cyrl devtest metrics: - name: BLEU type: bleu value: 32.44 - name: CHRF type: chrf value: 60.52 --- # `quickmt-en-uk` Neural Machine Translation Model `quickmt-en-uk` is a reasonably fast and reasonably accurate neural machine translation model for translation from English into Ukranian. `quickmt` models are roughly 3 times faster for GPU inference than OpusMT models and roughly [40 times](https://huggingface.co/spaces/quickmt/quickmt-vs-libretranslate) faster than [LibreTranslate](https://huggingface.co/spaces/quickmt/quickmt-vs-libretranslate)/[ArgosTranslate](github.com/argosopentech/argos-translate). ## Try it on our Huggingface Space Give it a try before downloading here: https://huggingface.co/spaces/quickmt/QuickMT-Demo ## Model Information * Trained using [`quickmt-train`](github.com/quickmt/quickmt-train) * 200M parameter seq2seq transformer * 32k separate Sentencepiece vocabs * Exported for fast inference to [CTranslate2](https://github.com/OpenNMT/CTranslate2) format * The pytorch model (for fine-tuning or pytorch inference) is available in this repository in the `pytorch_model` folder * Training config file here: `pytorch_model/config.yaml` ## 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: ```bash git clone https://github.com/quickmt/quickmt.git pip install -e ./quickmt/ ``` Finally use the model in python: ```python from quickmt import Translator # Auto-detects GPU, set to "cpu" to force CPU inference mt = Translator("quickmt/quickmt-en-uk", device="auto") # Translate - set beam size to 1 for faster speed (but lower quality) 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.' mt(sample_text, beam_size=5) ``` > 'Доктор Ехуд Ур, професор медицини в Університеті Далхаузі в Галіфаксі, Нова Шотландія і голова клінічного та наукового відділу Канадської діабетичної асоціації, попередив, що дослідження все ще знаходиться на початку.' ```python # Get alternative translations by sampling # You can pass any cTranslate2 `translate_batch` arguments mt([sample_text], sampling_temperature=1.2, beam_size=1, sampling_topk=50, sampling_topp=0.9) ``` > 'Доктор Ехуд Ур (Ehud Ur), професор медицини Університету Дальсаузі в Галіфаксі (Канада), а також голова клінічної та наукового підрозділу Канадської асоціації діабету, попередив, що дослідження все ще знаходяться на стадії свого початку.' 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](https://libretranslate.com/) which also uses `ctranslate2` and `sentencepiece`. A model in safetensors format to be used with `quickmt-train` is also provided. ## Metrics `bleu` and `chrf2` are calculated with [sacrebleu](https://github.com/mjpost/sacrebleu) on the [Flores200 `devtest` test set](https://huggingface.co/datasets/facebook/flores). "Time (s)" is the time in seconds to translate the flores-devtest dataset (1012 sentences) on an RTX 4070s GPU with batch size 32. | model | time | bleu | chrf | |------------------------------------|-------|-------|-------| | quickmt/quickmt-en-uk | 1.20 | 32.44 | 60.52 | | Helsinki-NLP/opus-mt-tc-big-en-zle | 3.78 | 31.98 | 60.08 | | facebook/nllb-200-distilled-1.3B | 19.23 | 26.31 | 56.91 | | CohereLabs/tiny-aya-global | 35.37 | 27.45 | 56.22 | | google/gemma-4-E2B-it | 70.78 | 29.02 | 57.54 |