tiedeman commited on
Commit
dda10b0
1 Parent(s): 71c0fc5

Initial commit

Browse files
.gitattributes CHANGED
@@ -30,3 +30,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
30
  *.zip filter=lfs diff=lfs merge=lfs -text
31
  *.zst filter=lfs diff=lfs merge=lfs -text
32
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
30
  *.zip filter=lfs diff=lfs merge=lfs -text
31
  *.zst filter=lfs diff=lfs merge=lfs -text
32
  *tfevents* filter=lfs diff=lfs merge=lfs -text
33
+ *.spm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - bs
4
+ - en
5
+ - hr
6
+ - sh
7
+ - sr
8
+ language_bcp47:
9
+ - bs_Latn
10
+ - sr_Cyrl
11
+ - sr_Latn
12
+
13
+ tags:
14
+ - translation
15
+ - opus-mt-tc
16
+
17
+ license: cc-by-4.0
18
+ model-index:
19
+ - name: opus-mt-tc-base-en-sh
20
+ results:
21
+ - task:
22
+ name: Translation eng-hrv
23
+ type: translation
24
+ args: eng-hrv
25
+ dataset:
26
+ name: flores200-dev
27
+ type: flores200-dev
28
+ args: eng-hrv
29
+ metrics:
30
+ - name: BLEU
31
+ type: bleu
32
+ value: 28.1
33
+ - name: chr-F
34
+ type: chrf
35
+ value: 0.57963
36
+ - task:
37
+ name: Translation eng-srp_Cyrl
38
+ type: translation
39
+ args: eng-srp_Cyrl
40
+ dataset:
41
+ name: flores200-dev
42
+ type: flores200-dev
43
+ args: eng-srp_Cyrl
44
+ metrics:
45
+ - name: BLEU
46
+ type: bleu
47
+ value: 32.2
48
+ - name: chr-F
49
+ type: chrf
50
+ value: 0.60096
51
+ - task:
52
+ name: Translation eng-hrv
53
+ type: translation
54
+ args: eng-hrv
55
+ dataset:
56
+ name: flores200-devtest
57
+ type: flores200-devtest
58
+ args: eng-hrv
59
+ metrics:
60
+ - name: BLEU
61
+ type: bleu
62
+ value: 28.9
63
+ - name: chr-F
64
+ type: chrf
65
+ value: 0.58652
66
+ - task:
67
+ name: Translation eng-srp_Cyrl
68
+ type: translation
69
+ args: eng-srp_Cyrl
70
+ dataset:
71
+ name: flores200-devtest
72
+ type: flores200-devtest
73
+ args: eng-srp_Cyrl
74
+ metrics:
75
+ - name: BLEU
76
+ type: bleu
77
+ value: 31.7
78
+ - name: chr-F
79
+ type: chrf
80
+ value: 0.59874
81
+ - task:
82
+ name: Translation eng-hrv
83
+ type: translation
84
+ args: eng-hrv
85
+ dataset:
86
+ name: flores101-devtest
87
+ type: flores_101
88
+ args: eng hrv devtest
89
+ metrics:
90
+ - name: BLEU
91
+ type: bleu
92
+ value: 28.7
93
+ - name: chr-F
94
+ type: chrf
95
+ value: 0.586
96
+ - task:
97
+ name: Translation eng-srp_Cyrl
98
+ type: translation
99
+ args: eng-srp_Cyrl
100
+ dataset:
101
+ name: flores101-devtest
102
+ type: flores_101
103
+ args: eng srp_Cyrl devtest
104
+ metrics:
105
+ - name: BLEU
106
+ type: bleu
107
+ value: 31.7
108
+ - name: chr-F
109
+ type: chrf
110
+ value: 0.59874
111
+ - task:
112
+ name: Translation eng-bos_Latn
113
+ type: translation
114
+ args: eng-bos_Latn
115
+ dataset:
116
+ name: tatoeba-test-v2021-08-07
117
+ type: tatoeba_mt
118
+ args: eng-bos_Latn
119
+ metrics:
120
+ - name: BLEU
121
+ type: bleu
122
+ value: 46.3
123
+ - name: chr-F
124
+ type: chrf
125
+ value: 0.666
126
+ - task:
127
+ name: Translation eng-hbs
128
+ type: translation
129
+ args: eng-hbs
130
+ dataset:
131
+ name: tatoeba-test-v2021-08-07
132
+ type: tatoeba_mt
133
+ args: eng-hbs
134
+ metrics:
135
+ - name: BLEU
136
+ type: bleu
137
+ value: 42.1
138
+ - name: chr-F
139
+ type: chrf
140
+ value: 0.631
141
+ - task:
142
+ name: Translation eng-hrv
143
+ type: translation
144
+ args: eng-hrv
145
+ dataset:
146
+ name: tatoeba-test-v2021-08-07
147
+ type: tatoeba_mt
148
+ args: eng-hrv
149
+ metrics:
150
+ - name: BLEU
151
+ type: bleu
152
+ value: 49.7
153
+ - name: chr-F
154
+ type: chrf
155
+ value: 0.691
156
+ - task:
157
+ name: Translation eng-srp_Cyrl
158
+ type: translation
159
+ args: eng-srp_Cyrl
160
+ dataset:
161
+ name: tatoeba-test-v2021-08-07
162
+ type: tatoeba_mt
163
+ args: eng-srp_Cyrl
164
+ metrics:
165
+ - name: BLEU
166
+ type: bleu
167
+ value: 45.1
168
+ - name: chr-F
169
+ type: chrf
170
+ value: 0.645
171
+ - task:
172
+ name: Translation eng-srp_Latn
173
+ type: translation
174
+ args: eng-srp_Latn
175
+ dataset:
176
+ name: tatoeba-test-v2021-08-07
177
+ type: tatoeba_mt
178
+ args: eng-srp_Latn
179
+ metrics:
180
+ - name: BLEU
181
+ type: bleu
182
+ value: 39.8
183
+ - name: chr-F
184
+ type: chrf
185
+ value: 0.613
186
+ ---
187
+ # opus-mt-tc-base-en-sh
188
+
189
+ ## Table of Contents
190
+ - [Model Details](#model-details)
191
+ - [Uses](#uses)
192
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
193
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
194
+ - [Training](#training)
195
+ - [Evaluation](#evaluation)
196
+ - [Citation Information](#citation-information)
197
+ - [Acknowledgements](#acknowledgements)
198
+
199
+ ## Model Details
200
+
201
+ Neural machine translation model for translating from English (en) to Serbo-Croatian (sh).
202
+
203
+ 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).
204
+ **Model Description:**
205
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
206
+ - **Model Type:** Translation (transformer-align)
207
+ - **Release**: 2021-04-20
208
+ - **License:** CC-BY-4.0
209
+ - **Language(s):**
210
+ - Source Language(s): eng
211
+ - Target Language(s): bos_Latn hbs hrv srp_Cyrl srp_Latn
212
+ - Language Pair(s): eng-bos_Latn eng-hbs eng-hrv eng-srp_Cyrl eng-srp_Latn
213
+ - Valid Target Language Labels: >>bos_Cyrl<< >>bos_Latn<< >>cnr<< >>cnr_Latn<< >>hbs<< >>hbs_Cyrl<< >>hrv<< >>srp_Cyrl<< >>srp_Latn<<
214
+ - **Original Model**: [opus+bt-2021-04-20.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-hbs/opus+bt-2021-04-20.zip)
215
+ - **Resources for more information:**
216
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
217
+ - More information about released models for this language pair: [OPUS-MT eng-hbs README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/eng-hbs/README.md)
218
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
219
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/
220
+
221
+ 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. `>>bos_Latn<<`
222
+
223
+ ## Uses
224
+
225
+ This model can be used for translation and text-to-text generation.
226
+
227
+ ## Risks, Limitations and Biases
228
+
229
+ **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.**
230
+
231
+ 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)).
232
+
233
+ ## How to Get Started With the Model
234
+
235
+ A short example code:
236
+
237
+ ```python
238
+ from transformers import MarianMTModel, MarianTokenizer
239
+
240
+ src_text = [
241
+ ">>hrv<< You're about to make a very serious mistake.",
242
+ ">>hbs<< I've just been too busy."
243
+ ]
244
+
245
+ model_name = "pytorch-models/opus-mt-tc-base-en-sh"
246
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
247
+ model = MarianMTModel.from_pretrained(model_name)
248
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
249
+
250
+ for t in translated:
251
+ print( tokenizer.decode(t, skip_special_tokens=True) )
252
+
253
+ # expected output:
254
+ # Ti si o tome napraviti vrlo ozbiljnu pogrešku.
255
+ # [4]
256
+ ```
257
+
258
+ You can also use OPUS-MT models with the transformers pipelines, for example:
259
+
260
+ ```python
261
+ from transformers import pipeline
262
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-base-en-sh")
263
+ print(pipe(">>hrv<< You're about to make a very serious mistake."))
264
+
265
+ # expected output: Ti si o tome napraviti vrlo ozbiljnu pogrešku.
266
+ ```
267
+
268
+ ## Training
269
+
270
+ - **Data**: opus+bt ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
271
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
272
+ - **Model Type:** transformer-align
273
+ - **Original MarianNMT Model**: [opus+bt-2021-04-20.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-hbs/opus+bt-2021-04-20.zip)
274
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
275
+
276
+ ## Evaluation
277
+
278
+ * test set translations: [opus+bt-2021-04-20.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-hbs/opus+bt-2021-04-20.test.txt)
279
+ * test set scores: [opus+bt-2021-04-20.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-hbs/opus+bt-2021-04-20.eval.txt)
280
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
281
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
282
+
283
+ | langpair | testset | chr-F | BLEU | #sent | #words |
284
+ |----------|---------|-------|-------|-------|--------|
285
+ | eng-bos_Latn | tatoeba-test-v2021-08-07 | 0.666 | 46.3 | 301 | 1650 |
286
+ | eng-hbs | tatoeba-test-v2021-08-07 | 0.631 | 42.1 | 10017 | 63927 |
287
+ | eng-hrv | tatoeba-test-v2021-08-07 | 0.691 | 49.7 | 1480 | 9396 |
288
+ | eng-srp_Cyrl | tatoeba-test-v2021-08-07 | 0.645 | 45.1 | 1580 | 9152 |
289
+ | eng-srp_Latn | tatoeba-test-v2021-08-07 | 0.613 | 39.8 | 6656 | 43729 |
290
+ | eng-hrv | flores101-devtest | 0.586 | 28.7 | 1012 | 22423 |
291
+ | eng-hrv | flores200-dev | 0.57963 | 28.1 | 997 | 21567 |
292
+ | eng-hrv | flores200-devtest | 0.58652 | 28.9 | 1012 | 22423 |
293
+ | eng-srp_Cyrl | flores101-devtest | 0.59874 | 31.7 | 1012 | 23456 |
294
+ | eng-srp_Cyrl | flores200-dev | 0.60096 | 32.2 | 997 | 22384 |
295
+ | eng-srp_Cyrl | flores200-devtest | 0.59874 | 31.7 | 1012 | 23456 |
296
+
297
+ ## Citation Information
298
+
299
+ * 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.)
300
+
301
+ ```
302
+ @inproceedings{tiedemann-thottingal-2020-opus,
303
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
304
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
305
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
306
+ month = nov,
307
+ year = "2020",
308
+ address = "Lisboa, Portugal",
309
+ publisher = "European Association for Machine Translation",
310
+ url = "https://aclanthology.org/2020.eamt-1.61",
311
+ pages = "479--480",
312
+ }
313
+
314
+ @inproceedings{tiedemann-2020-tatoeba,
315
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
316
+ author = {Tiedemann, J{\"o}rg},
317
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
318
+ month = nov,
319
+ year = "2020",
320
+ address = "Online",
321
+ publisher = "Association for Computational Linguistics",
322
+ url = "https://aclanthology.org/2020.wmt-1.139",
323
+ pages = "1174--1182",
324
+ }
325
+ ```
326
+
327
+ ## Acknowledgements
328
+
329
+ 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.
330
+
331
+ ## Model conversion info
332
+
333
+ * transformers version: 4.16.2
334
+ * OPUS-MT git hash: e2a6299
335
+ * port time: Tue Oct 11 10:14:32 CEST 2022
336
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ eng-bos_Latn tatoeba-test-v2020-07-28 0.667 46.4 300 1647
2
+ eng-bos_Latn tatoeba-test-v2021-03-30 0.667 46.4 300 1647
3
+ eng-bos_Latn tatoeba-test-v2021-08-07 0.666 46.3 301 1650
4
+ eng-hbs tatoeba-test-v2020-07-28 0.630 42.1 10000 63836
5
+ eng-hbs tatoeba-test-v2021-03-30 0.630 42.1 10002 63845
6
+ eng-hbs tatoeba-test-v2021-08-07 0.631 42.1 10017 63927
7
+ eng-hrv flores101-dev 0.580 28.2 997 21567
8
+ eng-hrv flores101-devtest 0.586 28.7 1012 22423
9
+ eng-hrv flores200-dev 0.57963 28.1 997 21567
10
+ eng-hrv flores200-devtest 0.58652 28.9 1012 22423
11
+ eng-hrv tatoeba-test-v2020-07-28 0.690 49.6 1468 9332
12
+ eng-hrv tatoeba-test-v2021-03-30 0.691 49.7 1469 9336
13
+ eng-hrv tatoeba-test-v2021-08-07 0.691 49.7 1480 9396
14
+ eng-srp_Cyrl flores101-dev 0.60096 32.2 997 22384
15
+ eng-srp_Cyrl flores101-devtest 0.59874 31.7 1012 23456
16
+ eng-srp_Cyrl flores200-dev 0.60096 32.2 997 22384
17
+ eng-srp_Cyrl flores200-devtest 0.59874 31.7 1012 23456
18
+ eng-srp_Cyrl tatoeba-test-v2020-07-28 0.644 44.9 1577 9133
19
+ eng-srp_Cyrl tatoeba-test-v2021-03-30 0.644 44.9 1577 9133
20
+ eng-srp_Cyrl tatoeba-test-v2021-08-07 0.645 45.1 1580 9152
21
+ eng-srp_Latn tatoeba-test-v2020-07-28 0.613 39.7 6655 43724
22
+ eng-srp_Latn tatoeba-test-v2021-03-30 0.613 39.7 6656 43729
23
+ eng-srp_Latn tatoeba-test-v2021-08-07 0.613 39.8 6656 43729
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:614460cbbd1254456a8cbc57d470fc81ebba796bb2105688720d65c938f02f16
3
+ size 3664146
config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_dropout": 0.0,
3
+ "activation_function": "swish",
4
+ "architectures": [
5
+ "MarianMTModel"
6
+ ],
7
+ "attention_dropout": 0.0,
8
+ "bad_words_ids": [
9
+ [
10
+ 58638
11
+ ]
12
+ ],
13
+ "bos_token_id": 0,
14
+ "classifier_dropout": 0.0,
15
+ "d_model": 512,
16
+ "decoder_attention_heads": 8,
17
+ "decoder_ffn_dim": 2048,
18
+ "decoder_layerdrop": 0.0,
19
+ "decoder_layers": 6,
20
+ "decoder_start_token_id": 58638,
21
+ "decoder_vocab_size": 58639,
22
+ "dropout": 0.1,
23
+ "encoder_attention_heads": 8,
24
+ "encoder_ffn_dim": 2048,
25
+ "encoder_layerdrop": 0.0,
26
+ "encoder_layers": 6,
27
+ "eos_token_id": 39611,
28
+ "forced_eos_token_id": 39611,
29
+ "init_std": 0.02,
30
+ "is_encoder_decoder": true,
31
+ "max_length": 512,
32
+ "max_position_embeddings": 512,
33
+ "model_type": "marian",
34
+ "normalize_embedding": false,
35
+ "num_beams": 6,
36
+ "num_hidden_layers": 6,
37
+ "pad_token_id": 58638,
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": 58639
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9806194b64d2f1f7d1d4da428dce3be87fef2465f85024af53c5a07bc02aef3
3
+ size 208578627
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e21a114e9cd29d86d6686270b555ebae828d7ede41d155c24885477a5fbd5ea5
3
+ size 795135
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:5af3b120c89deff27c19623dafd9c48d2198aa811cf66c21167f5fe305e6ad7e
3
+ size 812079
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "en", "target_lang": "sh", "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/opus+bt-2021-04-20/en-sh", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff