tiedeman commited on
Commit
ce1a73c
โ€ข
1 Parent(s): 6dffc2f

Initial commit

Browse files
.gitattributes CHANGED
@@ -29,3 +29,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
29
  *.zip filter=lfs diff=lfs merge=lfs -text
30
  *.zst filter=lfs diff=lfs merge=lfs -text
31
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
29
  *.zip filter=lfs diff=lfs merge=lfs -text
30
  *.zst filter=lfs diff=lfs merge=lfs -text
31
  *tfevents* filter=lfs diff=lfs merge=lfs -text
32
+ *.spm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ar
4
+ - es
5
+ - fr
6
+ - it
7
+ - itc
8
+
9
+ tags:
10
+ - translation
11
+ - opus-mt-tc
12
+
13
+ license: cc-by-4.0
14
+ model-index:
15
+ - name: opus-mt-tc-big-ar-itc
16
+ results:
17
+ - task:
18
+ name: Translation ara-cat
19
+ type: translation
20
+ args: ara-cat
21
+ dataset:
22
+ name: flores101-devtest
23
+ type: flores_101
24
+ args: ara cat devtest
25
+ metrics:
26
+ - name: BLEU
27
+ type: bleu
28
+ value: 28.7
29
+ - name: chr-F
30
+ type: chrf
31
+ value: 0.55670
32
+ - task:
33
+ name: Translation ara-fra
34
+ type: translation
35
+ args: ara-fra
36
+ dataset:
37
+ name: flores101-devtest
38
+ type: flores_101
39
+ args: ara fra devtest
40
+ metrics:
41
+ - name: BLEU
42
+ type: bleu
43
+ value: 33.4
44
+ - name: chr-F
45
+ type: chrf
46
+ value: 0.59715
47
+ - task:
48
+ name: Translation ara-glg
49
+ type: translation
50
+ args: ara-glg
51
+ dataset:
52
+ name: flores101-devtest
53
+ type: flores_101
54
+ args: ara glg devtest
55
+ metrics:
56
+ - name: BLEU
57
+ type: bleu
58
+ value: 23.5
59
+ - name: chr-F
60
+ type: chrf
61
+ value: 0.51898
62
+ - task:
63
+ name: Translation ara-ita
64
+ type: translation
65
+ args: ara-ita
66
+ dataset:
67
+ name: flores101-devtest
68
+ type: flores_101
69
+ args: ara ita devtest
70
+ metrics:
71
+ - name: BLEU
72
+ type: bleu
73
+ value: 22.3
74
+ - name: chr-F
75
+ type: chrf
76
+ value: 0.52523
77
+ - task:
78
+ name: Translation ara-por
79
+ type: translation
80
+ args: ara-por
81
+ dataset:
82
+ name: flores101-devtest
83
+ type: flores_101
84
+ args: ara por devtest
85
+ metrics:
86
+ - name: BLEU
87
+ type: bleu
88
+ value: 31.6
89
+ - name: chr-F
90
+ type: chrf
91
+ value: 0.58260
92
+ - task:
93
+ name: Translation ara-ron
94
+ type: translation
95
+ args: ara-ron
96
+ dataset:
97
+ name: flores101-devtest
98
+ type: flores_101
99
+ args: ara ron devtest
100
+ metrics:
101
+ - name: BLEU
102
+ type: bleu
103
+ value: 22.4
104
+ - name: chr-F
105
+ type: chrf
106
+ value: 0.51425
107
+ - task:
108
+ name: Translation ara-spa
109
+ type: translation
110
+ args: ara-spa
111
+ dataset:
112
+ name: flores101-devtest
113
+ type: flores_101
114
+ args: ara spa devtest
115
+ metrics:
116
+ - name: BLEU
117
+ type: bleu
118
+ value: 21.8
119
+ - name: chr-F
120
+ type: chrf
121
+ value: 0.50203
122
+ - task:
123
+ name: Translation ara-fra
124
+ type: translation
125
+ args: ara-fra
126
+ dataset:
127
+ name: tatoeba-test-v2021-08-07
128
+ type: tatoeba_mt
129
+ args: ara-fra
130
+ metrics:
131
+ - name: BLEU
132
+ type: bleu
133
+ value: 41.5
134
+ - name: chr-F
135
+ type: chrf
136
+ value: 0.57876
137
+ - task:
138
+ name: Translation ara-ita
139
+ type: translation
140
+ args: ara-ita
141
+ dataset:
142
+ name: tatoeba-test-v2021-08-07
143
+ type: tatoeba_mt
144
+ args: ara-ita
145
+ metrics:
146
+ - name: BLEU
147
+ type: bleu
148
+ value: 46.5
149
+ - name: chr-F
150
+ type: chrf
151
+ value: 0.66888
152
+ - task:
153
+ name: Translation ara-spa
154
+ type: translation
155
+ args: ara-spa
156
+ dataset:
157
+ name: tatoeba-test-v2021-08-07
158
+ type: tatoeba_mt
159
+ args: ara-spa
160
+ metrics:
161
+ - name: BLEU
162
+ type: bleu
163
+ value: 47.2
164
+ - name: chr-F
165
+ type: chrf
166
+ value: 0.64686
167
+ ---
168
+ # opus-mt-tc-big-ar-itc
169
+
170
+ ## Table of Contents
171
+ - [Model Details](#model-details)
172
+ - [Uses](#uses)
173
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
174
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
175
+ - [Training](#training)
176
+ - [Evaluation](#evaluation)
177
+ - [Citation Information](#citation-information)
178
+ - [Acknowledgements](#acknowledgements)
179
+
180
+ ## Model Details
181
+
182
+ Neural machine translation model for translating from Arabic (ar) to Italic languages (itc).
183
+
184
+ This model is part of the [OPUS-MT project](https://github.com/Helsinki-NLP/Opus-MT), an effort to make neural machine translation models widely available and accessible for many languages in the world. All models are originally trained using the amazing framework of [Marian NMT](https://marian-nmt.github.io/), an efficient NMT implementation written in pure C++. The models have been converted to pyTorch using the transformers library by huggingface. Training data is taken from [OPUS](https://opus.nlpl.eu/) and training pipelines use the procedures of [OPUS-MT-train](https://github.com/Helsinki-NLP/Opus-MT-train).
185
+ **Model Description:**
186
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
187
+ - **Model Type:** Translation (transformer-big)
188
+ - **Release**: 2022-07-28
189
+ - **License:** CC-BY-4.0
190
+ - **Language(s):**
191
+ - Source Language(s): ara
192
+ - Target Language(s): fra ita spa
193
+ - Valid Target Language Labels: >>fra<< >>ita<< >>spa<<
194
+ - **Original Model**: [opusTCv20210807_transformer-big_2022-07-28.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/ara-itc/opusTCv20210807_transformer-big_2022-07-28.zip)
195
+ - **Resources for more information:**
196
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
197
+ - More information about released models for this language pair: [OPUS-MT ara-itc README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/ara-itc/README.md)
198
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
199
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/
200
+
201
+ This is a multilingual translation model with multiple target languages. A sentence initial language token is required in the form of `>>id<<` (id = valid target language ID), e.g. `>>fra<<`
202
+
203
+ ## Uses
204
+
205
+ This model can be used for translation and text-to-text generation.
206
+
207
+ ## Risks, Limitations and Biases
208
+
209
+ **CONTENT WARNING: Readers should be aware that the model is trained on various public data sets that may contain content that is disturbing, offensive, and can propagate historical and current stereotypes.**
210
+
211
+ Significant research has explored bias and fairness issues with language models (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)).
212
+
213
+ ## How to Get Started With the Model
214
+
215
+ A short example code:
216
+
217
+ ```python
218
+ from transformers import MarianMTModel, MarianTokenizer
219
+
220
+ src_text = [
221
+ ">>lat_Latn<< ุฅูŠุด ุฅุณู…ูƒุŸ",
222
+ ">>por<< ุงู„ูŠูˆู†ุงู† ุฌู…ูŠู„ุฉ."
223
+ ]
224
+
225
+ model_name = "pytorch-models/opus-mt-tc-big-ar-itc"
226
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
227
+ model = MarianMTModel.from_pretrained(model_name)
228
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
229
+
230
+ for t in translated:
231
+ print( tokenizer.decode(t, skip_special_tokens=True) )
232
+
233
+ # expected output:
234
+ # Iulia: Tu nombre es?
235
+ # A Grรฉcia รฉ linda.
236
+ ```
237
+
238
+ You can also use OPUS-MT models with the transformers pipelines, for example:
239
+
240
+ ```python
241
+ from transformers import pipeline
242
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-ar-itc")
243
+ print(pipe(">>lat_Latn<< ุฅูŠุด ุฅุณู…ูƒุŸ"))
244
+
245
+ # expected output: Iulia: Tu nombre es?
246
+ ```
247
+
248
+ ## Training
249
+
250
+ - **Data**: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
251
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
252
+ - **Model Type:** transformer-big
253
+ - **Original MarianNMT Model**: [opusTCv20210807_transformer-big_2022-07-28.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/ara-itc/opusTCv20210807_transformer-big_2022-07-28.zip)
254
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
255
+
256
+ ## Evaluation
257
+
258
+ * test set translations: [opusTCv20210807_transformer-big_2022-07-28.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/ara-itc/opusTCv20210807_transformer-big_2022-07-28.test.txt)
259
+ * test set scores: [opusTCv20210807_transformer-big_2022-07-28.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/ara-itc/opusTCv20210807_transformer-big_2022-07-28.eval.txt)
260
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
261
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
262
+
263
+ | langpair | testset | chr-F | BLEU | #sent | #words |
264
+ |----------|---------|-------|-------|-------|--------|
265
+ | ara-fra | tatoeba-test-v2021-08-07 | 0.57876 | 41.5 | 1569 | 11066 |
266
+ | ara-ita | tatoeba-test-v2021-08-07 | 0.66888 | 46.5 | 235 | 1495 |
267
+ | ara-spa | tatoeba-test-v2021-08-07 | 0.64686 | 47.2 | 1511 | 9708 |
268
+ | ara-cat | flores101-devtest | 0.55670 | 28.7 | 1012 | 27304 |
269
+ | ara-fra | flores101-devtest | 0.59715 | 33.4 | 1012 | 28343 |
270
+ | ara-glg | flores101-devtest | 0.51898 | 23.5 | 1012 | 26582 |
271
+ | ara-ita | flores101-devtest | 0.52523 | 22.3 | 1012 | 27306 |
272
+ | ara-por | flores101-devtest | 0.58260 | 31.6 | 1012 | 26519 |
273
+ | ara-ron | flores101-devtest | 0.51425 | 22.4 | 1012 | 26799 |
274
+ | ara-spa | flores101-devtest | 0.50203 | 21.8 | 1012 | 29199 |
275
+
276
+ ## Citation Information
277
+
278
+ * Publications: [OPUS-MT โ€“ Building open translation services for the World](https://aclanthology.org/2020.eamt-1.61/) and [The Tatoeba Translation Challenge โ€“ Realistic Data Sets for Low Resource and Multilingual MT](https://aclanthology.org/2020.wmt-1.139/) (Please, cite if you use this model.)
279
+
280
+ ```
281
+ @inproceedings{tiedemann-thottingal-2020-opus,
282
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
283
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
284
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
285
+ month = nov,
286
+ year = "2020",
287
+ address = "Lisboa, Portugal",
288
+ publisher = "European Association for Machine Translation",
289
+ url = "https://aclanthology.org/2020.eamt-1.61",
290
+ pages = "479--480",
291
+ }
292
+
293
+ @inproceedings{tiedemann-2020-tatoeba,
294
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
295
+ author = {Tiedemann, J{\"o}rg},
296
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
297
+ month = nov,
298
+ year = "2020",
299
+ address = "Online",
300
+ publisher = "Association for Computational Linguistics",
301
+ url = "https://aclanthology.org/2020.wmt-1.139",
302
+ pages = "1174--1182",
303
+ }
304
+ ```
305
+
306
+ ## Acknowledgements
307
+
308
+ The work is supported by the [European Language Grid](https://www.european-language-grid.eu/) as [pilot project 2866](https://live.european-language-grid.eu/catalogue/#/resource/projects/2866), by the [FoTran project](https://www.helsinki.fi/en/researchgroups/natural-language-understanding-with-cross-lingual-grounding), funded by the European Research Council (ERC) under the European Unionโ€™s Horizon 2020 research and innovation programme (grant agreement No 771113), and the [MeMAD project](https://memad.eu/), funded by the European Unionโ€™s Horizon 2020 Research and Innovation Programme under grant agreement No 780069. We are also grateful for the generous computational resources and IT infrastructure provided by [CSC -- IT Center for Science](https://www.csc.fi/), Finland.
309
+
310
+ ## Model conversion info
311
+
312
+ * transformers version: 4.16.2
313
+ * OPUS-MT git hash: 8b9f0b0
314
+ * port time: Fri Aug 12 17:01:33 EEST 2022
315
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ara-cat flores101-dev 0.55874 29.0 997 25962
2
+ ara-fra flores101-dev 0.60236 34.4 997 26706
3
+ ara-glg flores101-dev 0.51799 24.0 997 25265
4
+ ara-ita flores101-dev 0.52071 22.1 997 25840
5
+ ara-por flores101-dev 0.58217 32.2 997 25287
6
+ ara-ron flores101-dev 0.51286 22.5 997 25616
7
+ ara-spa flores101-dev 0.49301 21.3 997 27793
8
+ ara-cat flores101-devtest 0.55670 28.7 1012 27304
9
+ ara-fra flores101-devtest 0.59715 33.4 1012 28343
10
+ ara-glg flores101-devtest 0.51898 23.5 1012 26582
11
+ ara-ita flores101-devtest 0.52523 22.3 1012 27306
12
+ ara-por flores101-devtest 0.58260 31.6 1012 26519
13
+ ara-ron flores101-devtest 0.51425 22.4 1012 26799
14
+ ara-spa flores101-devtest 0.50203 21.8 1012 29199
15
+ ara-ita tatoeba-test-v2021-03-30 0.67125 46.4 250 1590
16
+ ara-fra tatoeba-test-v2021-08-07 0.57876 41.5 1569 11066
17
+ ara-ita tatoeba-test-v2021-08-07 0.66888 46.5 235 1495
18
+ ara-spa tatoeba-test-v2021-08-07 0.64686 47.2 1511 9708
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3cb23f8e9189885bcd6a6e44242c8dd651760d22f1b7484548bf600d38a97f16
3
+ size 2644502
config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_dropout": 0.0,
3
+ "activation_function": "relu",
4
+ "architectures": [
5
+ "MarianMTModel"
6
+ ],
7
+ "attention_dropout": 0.0,
8
+ "bad_words_ids": [
9
+ [
10
+ 61579
11
+ ]
12
+ ],
13
+ "bos_token_id": 0,
14
+ "classifier_dropout": 0.0,
15
+ "d_model": 1024,
16
+ "decoder_attention_heads": 16,
17
+ "decoder_ffn_dim": 4096,
18
+ "decoder_layerdrop": 0.0,
19
+ "decoder_layers": 6,
20
+ "decoder_start_token_id": 61579,
21
+ "decoder_vocab_size": 61580,
22
+ "dropout": 0.1,
23
+ "encoder_attention_heads": 16,
24
+ "encoder_ffn_dim": 4096,
25
+ "encoder_layerdrop": 0.0,
26
+ "encoder_layers": 6,
27
+ "eos_token_id": 27447,
28
+ "forced_eos_token_id": 27447,
29
+ "init_std": 0.02,
30
+ "is_encoder_decoder": true,
31
+ "max_length": 512,
32
+ "max_position_embeddings": 1024,
33
+ "model_type": "marian",
34
+ "normalize_embedding": false,
35
+ "num_beams": 4,
36
+ "num_hidden_layers": 6,
37
+ "pad_token_id": 61579,
38
+ "scale_embedding": true,
39
+ "share_encoder_decoder_embeddings": true,
40
+ "static_position_embeddings": true,
41
+ "torch_dtype": "float16",
42
+ "transformers_version": "4.18.0.dev0",
43
+ "use_cache": true,
44
+ "vocab_size": 61580
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3691b60a168fbe385755005a8bb6e6fa528026a97f33d2cc957aef4065d5a691
3
+ size 605161283
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:900f072bb5d720878c235327527fdaf96ac80f3b93b7ff3fc9ec534c7acf8164
3
+ size 910955
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"eos_token": "</s>", "unk_token": "<unk>", "pad_token": "<pad>"}
target.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b11edf189e8f6b23b31bcb2b362a9dfc6cb3b104174283c77de03ef452cc97d
3
+ size 818332
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "ar", "target_lang": "itc", "unk_token": "<unk>", "eos_token": "</s>", "pad_token": "<pad>", "model_max_length": 512, "sp_model_kwargs": {}, "separate_vocabs": false, "special_tokens_map_file": null, "name_or_path": "marian-models/opusTCv20210807_transformer-big_2022-07-28/ar-itc", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff