radinplaid commited on
Commit
cde8adc
·
verified ·
1 Parent(s): 59b94e1

Delete .ipynb_checkpoints/README-checkpoint.md

Browse files
.ipynb_checkpoints/README-checkpoint.md DELETED
@@ -1,121 +0,0 @@
1
- ---
2
- language:
3
- - fr
4
- - en
5
- tags:
6
- - translation
7
- license: cc-by-4.0
8
- datasets:
9
- - quickmt/quickmt-train.fr-en
10
- - quickmt/madlad400-en-backtranslated-fr
11
- - quickmt/newscrawl2024-en-backtranslated-fr
12
- - quickmt/canadian_hansard
13
- model-index:
14
- - name: quickmt-fr-en
15
- results:
16
- - task:
17
- name: Translation fra-eng
18
- type: translation
19
- args: fra-eng
20
- dataset:
21
- name: flores101-devtest
22
- type: flores_101
23
- args: fra_Latn eng_Latn devtest
24
- metrics:
25
- - name: BLEU
26
- type: bleu
27
- value: 46.84
28
- - name: CHRF
29
- type: chrf
30
- value: 69.87
31
- - name: COMET
32
- type: comet
33
- value: 89.4
34
- ---
35
-
36
-
37
- # `quickmt-fr-en` Neural Machine Translation Model
38
-
39
- `quickmt-fr-en` is a reasonably fast and reasonably accurate neural machine translation model for translation from `fr` into `en`.
40
-
41
- `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).
42
-
43
-
44
- ## *UPDATED VERSION!*
45
-
46
- This model was augmented with back-translated data and has improved translation quality!
47
-
48
-
49
- ## Try it on our Huggingface Space
50
-
51
- Give it a try before downloading here: https://huggingface.co/spaces/quickmt/QuickMT-Demo
52
-
53
-
54
- ## Model Information
55
-
56
- * Trained using [`eole`](https://github.com/eole-nlp/eole)
57
- * 200M parameter seq2seq transformer
58
- * 32k separate Sentencepiece vocabs
59
- * Exported for fast inference to [CTranslate2](https://github.com/OpenNMT/CTranslate2) format
60
- * The pytorch model (for use with [`eole`](https://github.com/eole-nlp/eole)) is available in this repository in the `eole-model` folder
61
-
62
- See the `eole` model configuration in this repository for further details and the `eole-model` for the raw `eole` (pytorch) model.
63
-
64
-
65
- ## Usage with `quickmt`
66
-
67
- You must install the Nvidia cuda toolkit first, if you want to do GPU inference.
68
-
69
- Next, install the `quickmt` python library and download the model:
70
-
71
- ```bash
72
- git clone https://github.com/quickmt/quickmt.git
73
- pip install -e ./quickmt/
74
-
75
- quickmt-model-download quickmt/quickmt-fr-en ./quickmt-fr-en
76
- ```
77
-
78
- Finally use the model in python:
79
-
80
- ```python
81
- from quickmt import Translator
82
-
83
- # Auto-detects GPU, set to "cpu" to force CPU inference
84
- mt = Translator("./quickmt-fr-en/", device="auto")
85
-
86
- # Translate - set beam size to 1 for faster speed (but lower quality)
87
- sample_text = "Le Dr Ehud Ur, professeur de médecine à l'Université Dalhousie de Halifax (Nouvelle-Écosse) et président de la division clinique et scientifique de l'Association canadienne du diabète, a averti que la recherche en était encore à ses débuts."
88
-
89
- mt(sample_text, beam_size=5)
90
- ```
91
-
92
- > '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, warned that research was still in its infancy.'
93
-
94
- ```python
95
- # Get alternative translations by sampling
96
- # You can pass any cTranslate2 `translate_batch` arguments
97
- mt([sample_text], sampling_temperature=1.2, beam_size=1, sampling_topk=50, sampling_topp=0.9)
98
- ```
99
-
100
- > 'Dr. Ehud Ur, Professor of Medicine at Dalhousie University in Halifax, Nova Scotia, and Chair of the Clinical & Scientific Division of the Canadian Diabetes Association, warned the research was still in its infancy.'
101
-
102
- 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 `eole` is also provided.
103
-
104
-
105
- ## Metrics
106
-
107
- `bleu` and `chrf2` are calculated with [sacrebleu](https://github.com/mjpost/sacrebleu) on the [Flores200 `devtest` test set](https://huggingface.co/datasets/facebook/flores). `comet22` with the [`comet`](https://github.com/Unbabel/COMET) library and the [default model](https://huggingface.co/Unbabel/wmt22-comet-da). "Time (s)" is the time in seconds to translate the flores-devtest dataset (1012 sentences) on an RTX 4070s GPU with batch size 32.
108
-
109
-
110
- | | bleu | chrf2 | comet22 | Time (s) |
111
- |:--------------------------------------|-------:|--------:|----------:|-----------:|
112
- | quickmt/quickmt-fr-en | 46.84 | 69.87 | 89.4 | 1.08 |
113
- | Helsinki-NLP/opus-mt-fr-en | 41.71 | 66.84 | 88.31 | 3.49 |
114
- | facebook/nllb-200-distilled-600M | 44.05 | 67.81 | 88.48 | 21.52 |
115
- | facebook/nllb-200-distilled-1.3B | 46.24 | 69.32 | 89.24 | 37.25 |
116
- | facebook/m2m100_418M | 36.48 | 63.3 | 85.87 | 18.28 |
117
- | facebook/m2m100_1.2B | 41.69 | 66.51 | 88 | 35.1 |
118
- | tencent/HY-MT1.5-1.8B | 28.68 | 61.62 | 88.66 | 9 |
119
- | tencent/Hunyuan-MT-7B-fp8 | 35.66 | 64.94 | 89.72 | 22 |
120
- | CohereLabs/aya-expanse-8b (bnb quant) | 45.03 | 69.02 | 90.29 | 73.97 |
121
-