tiedeman commited on
Commit
74ba497
1 Parent(s): 65c4344

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,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - es
4
+ - fa
5
+ - fr
6
+ - it
7
+ - itc
8
+ - pt
9
+
10
+ tags:
11
+ - translation
12
+ - opus-mt-tc
13
+
14
+ license: cc-by-4.0
15
+ model-index:
16
+ - name: opus-mt-tc-big-fa-itc
17
+ results:
18
+ - task:
19
+ name: Translation fas-fra
20
+ type: translation
21
+ args: fas-fra
22
+ dataset:
23
+ name: flores101-devtest
24
+ type: flores_101
25
+ args: fas fra devtest
26
+ metrics:
27
+ - name: BLEU
28
+ type: bleu
29
+ value: 28.9
30
+ - name: chr-F
31
+ type: chrf
32
+ value: 0.55883
33
+ - task:
34
+ name: Translation fas-ita
35
+ type: translation
36
+ args: fas-ita
37
+ dataset:
38
+ name: flores101-devtest
39
+ type: flores_101
40
+ args: fas ita devtest
41
+ metrics:
42
+ - name: BLEU
43
+ type: bleu
44
+ value: 19.7
45
+ - name: chr-F
46
+ type: chrf
47
+ value: 0.49512
48
+ - task:
49
+ name: Translation fas-por
50
+ type: translation
51
+ args: fas-por
52
+ dataset:
53
+ name: flores101-devtest
54
+ type: flores_101
55
+ args: fas por devtest
56
+ metrics:
57
+ - name: BLEU
58
+ type: bleu
59
+ value: 27.6
60
+ - name: chr-F
61
+ type: chrf
62
+ value: 0.54829
63
+ - task:
64
+ name: Translation fas-ron
65
+ type: translation
66
+ args: fas-ron
67
+ dataset:
68
+ name: flores101-devtest
69
+ type: flores_101
70
+ args: fas ron devtest
71
+ metrics:
72
+ - name: BLEU
73
+ type: bleu
74
+ value: 19.7
75
+ - name: chr-F
76
+ type: chrf
77
+ value: 0.48821
78
+ - task:
79
+ name: Translation fas-spa
80
+ type: translation
81
+ args: fas-spa
82
+ dataset:
83
+ name: flores101-devtest
84
+ type: flores_101
85
+ args: fas spa devtest
86
+ metrics:
87
+ - name: BLEU
88
+ type: bleu
89
+ value: 19.4
90
+ - name: chr-F
91
+ type: chrf
92
+ value: 0.47722
93
+ - task:
94
+ name: Translation fas-fra
95
+ type: translation
96
+ args: fas-fra
97
+ dataset:
98
+ name: tatoeba-test-v2021-08-07
99
+ type: tatoeba_mt
100
+ args: fas-fra
101
+ metrics:
102
+ - name: BLEU
103
+ type: bleu
104
+ value: 37.5
105
+ - name: chr-F
106
+ type: chrf
107
+ value: 0.57949
108
+ ---
109
+ # opus-mt-tc-big-fa-itc
110
+
111
+ ## Table of Contents
112
+ - [Model Details](#model-details)
113
+ - [Uses](#uses)
114
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
115
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
116
+ - [Training](#training)
117
+ - [Evaluation](#evaluation)
118
+ - [Citation Information](#citation-information)
119
+ - [Acknowledgements](#acknowledgements)
120
+
121
+ ## Model Details
122
+
123
+ Neural machine translation model for translating from Persian (fa) to Italic languages (itc).
124
+
125
+ 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).
126
+ **Model Description:**
127
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
128
+ - **Model Type:** Translation (transformer-big)
129
+ - **Release**: 2022-07-23
130
+ - **License:** CC-BY-4.0
131
+ - **Language(s):**
132
+ - Source Language(s): fas
133
+ - Target Language(s): fra ita por spa
134
+ - Valid Target Language Labels: >>fra<< >>ita<< >>por<< >>spa<<
135
+ - **Original Model**: [opusTCv20210807_transformer-big_2022-07-23.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/fas-itc/opusTCv20210807_transformer-big_2022-07-23.zip)
136
+ - **Resources for more information:**
137
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
138
+ - More information about released models for this language pair: [OPUS-MT fas-itc README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/fas-itc/README.md)
139
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
140
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/
141
+
142
+ 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<<`
143
+
144
+ ## Uses
145
+
146
+ This model can be used for translation and text-to-text generation.
147
+
148
+ ## Risks, Limitations and Biases
149
+
150
+ **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.**
151
+
152
+ 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)).
153
+
154
+ ## How to Get Started With the Model
155
+
156
+ A short example code:
157
+
158
+ ```python
159
+ from transformers import MarianMTModel, MarianTokenizer
160
+
161
+ src_text = [
162
+ ">>lad<< اسلام زیباست.",
163
+ ">>spa<< ورود به کتابخانه رایگان است."
164
+ ]
165
+
166
+ model_name = "pytorch-models/opus-mt-tc-big-fa-itc"
167
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
168
+ model = MarianMTModel.from_pretrained(model_name)
169
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
170
+
171
+ for t in translated:
172
+ print( tokenizer.decode(t, skip_special_tokens=True) )
173
+
174
+ # expected output:
175
+ # O Islam é lindo.
176
+ # La entrada a la biblioteca es gratuita.
177
+ ```
178
+
179
+ You can also use OPUS-MT models with the transformers pipelines, for example:
180
+
181
+ ```python
182
+ from transformers import pipeline
183
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-fa-itc")
184
+ print(pipe(">>lad<< اسلام زیباست."))
185
+
186
+ # expected output: O Islam é lindo.
187
+ ```
188
+
189
+ ## Training
190
+
191
+ - **Data**: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
192
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
193
+ - **Model Type:** transformer-big
194
+ - **Original MarianNMT Model**: [opusTCv20210807_transformer-big_2022-07-23.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/fas-itc/opusTCv20210807_transformer-big_2022-07-23.zip)
195
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
196
+
197
+ ## Evaluation
198
+
199
+ * test set translations: [opusTCv20210807_transformer-big_2022-07-23.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/fas-itc/opusTCv20210807_transformer-big_2022-07-23.test.txt)
200
+ * test set scores: [opusTCv20210807_transformer-big_2022-07-23.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/fas-itc/opusTCv20210807_transformer-big_2022-07-23.eval.txt)
201
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
202
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
203
+
204
+ | langpair | testset | chr-F | BLEU | #sent | #words |
205
+ |----------|---------|-------|-------|-------|--------|
206
+ | fas-fra | tatoeba-test-v2021-08-07 | 0.57949 | 37.5 | 376 | 3377 |
207
+ | fas-fra | flores101-devtest | 0.55883 | 28.9 | 1012 | 28343 |
208
+ | fas-ita | flores101-devtest | 0.49512 | 19.7 | 1012 | 27306 |
209
+ | fas-por | flores101-devtest | 0.54829 | 27.6 | 1012 | 26519 |
210
+ | fas-ron | flores101-devtest | 0.48821 | 19.7 | 1012 | 26799 |
211
+ | fas-spa | flores101-devtest | 0.47722 | 19.4 | 1012 | 29199 |
212
+
213
+ ## Citation Information
214
+
215
+ * 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.)
216
+
217
+ ```
218
+ @inproceedings{tiedemann-thottingal-2020-opus,
219
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
220
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
221
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
222
+ month = nov,
223
+ year = "2020",
224
+ address = "Lisboa, Portugal",
225
+ publisher = "European Association for Machine Translation",
226
+ url = "https://aclanthology.org/2020.eamt-1.61",
227
+ pages = "479--480",
228
+ }
229
+
230
+ @inproceedings{tiedemann-2020-tatoeba,
231
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
232
+ author = {Tiedemann, J{\"o}rg},
233
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
234
+ month = nov,
235
+ year = "2020",
236
+ address = "Online",
237
+ publisher = "Association for Computational Linguistics",
238
+ url = "https://aclanthology.org/2020.wmt-1.139",
239
+ pages = "1174--1182",
240
+ }
241
+ ```
242
+
243
+ ## Acknowledgements
244
+
245
+ 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.
246
+
247
+ ## Model conversion info
248
+
249
+ * transformers version: 4.16.2
250
+ * OPUS-MT git hash: 8b9f0b0
251
+ * port time: Fri Aug 12 20:02:14 EEST 2022
252
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fas-fra flores101-dev 0.56248 29.3 997 26706
2
+ fas-ita flores101-dev 0.49919 19.8 997 25840
3
+ fas-por flores101-dev 0.54764 27.6 997 25287
4
+ fas-ron flores101-dev 0.48837 20.0 997 25616
5
+ fas-spa flores101-dev 0.46962 19.0 997 27793
6
+ fas-fra flores101-devtest 0.55883 28.9 1012 28343
7
+ fas-ita flores101-devtest 0.49512 19.7 1012 27306
8
+ fas-por flores101-devtest 0.54829 27.6 1012 26519
9
+ fas-ron flores101-devtest 0.48821 19.7 1012 26799
10
+ fas-spa flores101-devtest 0.47722 19.4 1012 29199
11
+ fas-fra tatoeba-test-v2020-07-28 0.57910 37.5 375 3371
12
+ fas-fra tatoeba-test-v2021-03-30 0.58078 37.6 383 3442
13
+ fas-fra tatoeba-test-v2021-08-07 0.57949 37.5 376 3377
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f61567d0643ada251f9c8fa9640f7990f7dce5e50095e85974e4be70bb5b1332
3
+ size 1873011
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
+ 60707
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": 60707,
21
+ "decoder_vocab_size": 60708,
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": 28803,
28
+ "forced_eos_token_id": 28803,
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": 60707,
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": 60708
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca94fd8ff4719fa83d49830d5b1103a3385b2b92ada3d145ae7cdd6c58caab17
3
+ size 601587843
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2cdb1dfbef9489aac7e9e9b752acf409b3321eb2ab1caea5fd9154a759b570c9
3
+ size 877776
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:7a85e9cbe146a4dd7bb0a39500d455fe3c44ff2ee3a018a6d2c1e85845b6db50
3
+ size 810253
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "fa", "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-23/fa-itc", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff