tiedeman commited on
Commit
9797b6a
1 Parent(s): 356d99a

Initial commit

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.spm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ language:
4
+ - af
5
+ - ang
6
+ - bar
7
+ - bi
8
+ - bzj
9
+ - de
10
+ - djk
11
+ - drt
12
+ - en
13
+ - enm
14
+ - es
15
+ - fr
16
+ - frr
17
+ - fy
18
+ - gos
19
+ - gsw
20
+ - hrx
21
+ - hwc
22
+ - icr
23
+ - it
24
+ - jam
25
+ - kri
26
+ - ksh
27
+ - lb
28
+ - li
29
+ - nds
30
+ - nl
31
+ - pcm
32
+ - pis
33
+ - pt
34
+ - rop
35
+ - sco
36
+ - srm
37
+ - srn
38
+ - stq
39
+ - swg
40
+ - tcs
41
+ - tpi
42
+ - yi
43
+ - zea
44
+
45
+ tags:
46
+ - translation
47
+ - opus-mt-tc-bible
48
+
49
+ license: apache-2.0
50
+ model-index:
51
+ - name: opus-mt-tc-bible-big-gmw-fra_ita_por_spa
52
+ results:
53
+ - task:
54
+ name: Translation multi-multi
55
+ type: translation
56
+ args: multi-multi
57
+ dataset:
58
+ name: tatoeba-test-v2020-07-28-v2023-09-26
59
+ type: tatoeba_mt
60
+ args: multi-multi
61
+ metrics:
62
+ - name: BLEU
63
+ type: bleu
64
+ value: 40.9
65
+ - name: chr-F
66
+ type: chrf
67
+ value: 0.68712
68
+ ---
69
+ # opus-mt-tc-bible-big-gmw-fra_ita_por_spa
70
+
71
+ ## Table of Contents
72
+ - [Model Details](#model-details)
73
+ - [Uses](#uses)
74
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
75
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
76
+ - [Training](#training)
77
+ - [Evaluation](#evaluation)
78
+ - [Citation Information](#citation-information)
79
+ - [Acknowledgements](#acknowledgements)
80
+
81
+ ## Model Details
82
+
83
+ Neural machine translation model for translating from West Germanic languages (gmw) to unknown (fra+ita+por+spa).
84
+
85
+ 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).
86
+ **Model Description:**
87
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
88
+ - **Model Type:** Translation (transformer-big)
89
+ - **Release**: 2024-08-17
90
+ - **License:** Apache-2.0
91
+ - **Language(s):**
92
+ - Source Language(s): afr ang bar bis bzj deu djk drt eng enm frr fry gos gsw hrx hwc icr jam kri ksh lim ltz nds nld pcm pis rop sco srm srn stq swg tcs tpi yid zea
93
+ - Target Language(s): fra ita por spa
94
+ - Valid Target Language Labels: >>fra<< >>ita<< >>por<< >>spa<< >>xxx<<
95
+ - **Original Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/gmw-fra+ita+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip)
96
+ - **Resources for more information:**
97
+ - [OPUS-MT dashboard](https://opus.nlpl.eu/dashboard/index.php?pkg=opusmt&test=all&scoreslang=all&chart=standard&model=Tatoeba-MT-models/gmw-fra%2Bita%2Bpor%2Bspa/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-08-17)
98
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
99
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
100
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/)
101
+ - [HPLT bilingual data v1 (as part of the Tatoeba Translation Challenge dataset)](https://hplt-project.org/datasets/v1)
102
+ - [A massively parallel Bible corpus](https://aclanthology.org/L14-1215/)
103
+
104
+ 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<<`
105
+
106
+ ## Uses
107
+
108
+ This model can be used for translation and text-to-text generation.
109
+
110
+ ## Risks, Limitations and Biases
111
+
112
+ **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.**
113
+
114
+ 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)).
115
+
116
+ ## How to Get Started With the Model
117
+
118
+ A short example code:
119
+
120
+ ```python
121
+ from transformers import MarianMTModel, MarianTokenizer
122
+
123
+ src_text = [
124
+ ">>fra<< Ich möchte diesen Tag nie vergessen.",
125
+ ">>ita<< Chess is an amusing activity."
126
+ ]
127
+
128
+ model_name = "pytorch-models/opus-mt-tc-bible-big-gmw-fra_ita_por_spa"
129
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
130
+ model = MarianMTModel.from_pretrained(model_name)
131
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
132
+
133
+ for t in translated:
134
+ print( tokenizer.decode(t, skip_special_tokens=True) )
135
+
136
+ # expected output:
137
+ # Je ne veux jamais oublier cette journée.
138
+ # Gli scacchi sono un'attività divertente.
139
+ ```
140
+
141
+ You can also use OPUS-MT models with the transformers pipelines, for example:
142
+
143
+ ```python
144
+ from transformers import pipeline
145
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-bible-big-gmw-fra_ita_por_spa")
146
+ print(pipe(">>fra<< Ich möchte diesen Tag nie vergessen."))
147
+
148
+ # expected output: Je ne veux jamais oublier cette journée.
149
+ ```
150
+
151
+ ## Training
152
+
153
+ - **Data**: opusTCv20230926max50+bt+jhubc ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
154
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
155
+ - **Model Type:** transformer-big
156
+ - **Original MarianNMT Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/gmw-fra+ita+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip)
157
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
158
+
159
+ ## Evaluation
160
+
161
+ * [Model scores at the OPUS-MT dashboard](https://opus.nlpl.eu/dashboard/index.php?pkg=opusmt&test=all&scoreslang=all&chart=standard&model=Tatoeba-MT-models/gmw-fra%2Bita%2Bpor%2Bspa/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-08-17)
162
+ * test set translations: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/gmw-fra+ita+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.test.txt)
163
+ * test set scores: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/gmw-fra+ita+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.eval.txt)
164
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
165
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
166
+
167
+ | langpair | testset | chr-F | BLEU | #sent | #words |
168
+ |----------|---------|-------|-------|-------|--------|
169
+ | multi-multi | tatoeba-test-v2020-07-28-v2023-09-26 | 0.68712 | 40.9 | 10000 | 85215 |
170
+
171
+ ## Citation Information
172
+
173
+ * Publications: [Democratizing neural machine translation with OPUS-MT](https://doi.org/10.1007/s10579-023-09704-w) and [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.)
174
+
175
+ ```bibtex
176
+ @article{tiedemann2023democratizing,
177
+ title={Democratizing neural machine translation with {OPUS-MT}},
178
+ author={Tiedemann, J{\"o}rg and Aulamo, Mikko and Bakshandaeva, Daria and Boggia, Michele and Gr{\"o}nroos, Stig-Arne and Nieminen, Tommi and Raganato, Alessandro and Scherrer, Yves and Vazquez, Raul and Virpioja, Sami},
179
+ journal={Language Resources and Evaluation},
180
+ number={58},
181
+ pages={713--755},
182
+ year={2023},
183
+ publisher={Springer Nature},
184
+ issn={1574-0218},
185
+ doi={10.1007/s10579-023-09704-w}
186
+ }
187
+
188
+ @inproceedings{tiedemann-thottingal-2020-opus,
189
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
190
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
191
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
192
+ month = nov,
193
+ year = "2020",
194
+ address = "Lisboa, Portugal",
195
+ publisher = "European Association for Machine Translation",
196
+ url = "https://aclanthology.org/2020.eamt-1.61",
197
+ pages = "479--480",
198
+ }
199
+
200
+ @inproceedings{tiedemann-2020-tatoeba,
201
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
202
+ author = {Tiedemann, J{\"o}rg},
203
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
204
+ month = nov,
205
+ year = "2020",
206
+ address = "Online",
207
+ publisher = "Association for Computational Linguistics",
208
+ url = "https://aclanthology.org/2020.wmt-1.139",
209
+ pages = "1174--1182",
210
+ }
211
+ ```
212
+
213
+ ## Acknowledgements
214
+
215
+ The work is supported by the [HPLT project](https://hplt-project.org/), funded by the European Union’s Horizon Europe research and innovation programme under grant agreement No 101070350. We are also grateful for the generous computational resources and IT infrastructure provided by [CSC -- IT Center for Science](https://www.csc.fi/), Finland, and the [EuroHPC supercomputer LUMI](https://www.lumi-supercomputer.eu/).
216
+
217
+ ## Model conversion info
218
+
219
+ * transformers version: 4.45.1
220
+ * OPUS-MT git hash: 0882077
221
+ * port time: Tue Oct 8 11:29:19 EEST 2024
222
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ multi-multi tatoeba-test-v2020-07-28-v2023-09-26 0.68712 40.9 10000 85215
benchmark_translations.zip ADDED
File without changes
config.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "pytorch-models/opus-mt-tc-bible-big-gmw-fra_ita_por_spa",
3
+ "activation_dropout": 0.0,
4
+ "activation_function": "relu",
5
+ "architectures": [
6
+ "MarianMTModel"
7
+ ],
8
+ "attention_dropout": 0.0,
9
+ "bos_token_id": 0,
10
+ "classifier_dropout": 0.0,
11
+ "d_model": 1024,
12
+ "decoder_attention_heads": 16,
13
+ "decoder_ffn_dim": 4096,
14
+ "decoder_layerdrop": 0.0,
15
+ "decoder_layers": 6,
16
+ "decoder_start_token_id": 56345,
17
+ "decoder_vocab_size": 56346,
18
+ "dropout": 0.1,
19
+ "encoder_attention_heads": 16,
20
+ "encoder_ffn_dim": 4096,
21
+ "encoder_layerdrop": 0.0,
22
+ "encoder_layers": 6,
23
+ "eos_token_id": 526,
24
+ "forced_eos_token_id": null,
25
+ "init_std": 0.02,
26
+ "is_encoder_decoder": true,
27
+ "max_length": null,
28
+ "max_position_embeddings": 1024,
29
+ "model_type": "marian",
30
+ "normalize_embedding": false,
31
+ "num_beams": null,
32
+ "num_hidden_layers": 6,
33
+ "pad_token_id": 56345,
34
+ "scale_embedding": true,
35
+ "share_encoder_decoder_embeddings": true,
36
+ "static_position_embeddings": true,
37
+ "torch_dtype": "float32",
38
+ "transformers_version": "4.45.1",
39
+ "use_cache": true,
40
+ "vocab_size": 56346
41
+ }
generation_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bad_words_ids": [
4
+ [
5
+ 56345
6
+ ]
7
+ ],
8
+ "bos_token_id": 0,
9
+ "decoder_start_token_id": 56345,
10
+ "eos_token_id": 526,
11
+ "forced_eos_token_id": 526,
12
+ "max_length": 512,
13
+ "num_beams": 4,
14
+ "pad_token_id": 56345,
15
+ "transformers_version": "4.45.1"
16
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d0ba853b503c1232b0da924983fecceb288810968189dc8200f479c9dfbc5493
3
+ size 936477720
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:880e164da010b9755147957a6a079563196194e0e31f210f5cb0b4ac7ddcd531
3
+ size 936528965
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:776129458e81296e29b47104c164f4ab898ebd7c6cf2b74b88bb68df295bed40
3
+ size 799876
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:a3927ef85ca1bd6da0cbf59f1e80379d2f48f5c74d1620c49da620168ca1d15f
3
+ size 815654
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "gmw", "target_lang": "fra+ita+por+spa", "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/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17/gmw-fra+ita+por+spa", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff