tiedeman commited on
Commit
487d928
1 Parent(s): 9bec6dd

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,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ar
4
+ - gmq
5
+ language_bcp47:
6
+ - ar
7
+ - gmq
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-gmq
16
+ results:
17
+ - task:
18
+ name: Translation ara-dan
19
+ type: translation
20
+ args: ara-dan
21
+ dataset:
22
+ name: flores101-devtest
23
+ type: flores_101
24
+ args: ara dan devtest
25
+ metrics:
26
+ - name: BLEU
27
+ type: bleu
28
+ value: 28.8
29
+ - name: chr-F
30
+ type: chrf
31
+ value: 0.56203
32
+ - task:
33
+ name: Translation ara-nob
34
+ type: translation
35
+ args: ara-nob
36
+ dataset:
37
+ name: flores101-devtest
38
+ type: flores_101
39
+ args: ara nob devtest
40
+ metrics:
41
+ - name: BLEU
42
+ type: bleu
43
+ value: 20.5
44
+ - name: chr-F
45
+ type: chrf
46
+ value: 0.50833
47
+ - task:
48
+ name: Translation ara-swe
49
+ type: translation
50
+ args: ara-swe
51
+ dataset:
52
+ name: flores101-devtest
53
+ type: flores_101
54
+ args: ara swe devtest
55
+ metrics:
56
+ - name: BLEU
57
+ type: bleu
58
+ value: 27.3
59
+ - name: chr-F
60
+ type: chrf
61
+ value: 0.55512
62
+ ---
63
+ # opus-mt-tc-big-ar-gmq
64
+
65
+ ## Table of Contents
66
+ - [Model Details](#model-details)
67
+ - [Uses](#uses)
68
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
69
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
70
+ - [Training](#training)
71
+ - [Evaluation](#evaluation)
72
+ - [Citation Information](#citation-information)
73
+ - [Acknowledgements](#acknowledgements)
74
+
75
+ ## Model Details
76
+
77
+ Neural machine translation model for translating from Arabic (ar) to North Germanic languages (gmq).
78
+
79
+ 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).
80
+ **Model Description:**
81
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
82
+ - **Model Type:** Translation (transformer-big)
83
+ - **Release**: 2022-08-09
84
+ - **License:** CC-BY-4.0
85
+ - **Language(s):**
86
+ - Source Language(s):
87
+ - Target Language(s):
88
+ - Valid Target Language Labels:
89
+ - **Original Model**: [opusTCv20210807_transformer-big_2022-08-09.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/ara-gmq/opusTCv20210807_transformer-big_2022-08-09.zip)
90
+ - **Resources for more information:**
91
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
92
+ - More information about released models for this language pair: [OPUS-MT ara-gmq README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/ara-gmq/README.md)
93
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
94
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/
95
+
96
+ 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. `>><<`
97
+
98
+ ## Uses
99
+
100
+ This model can be used for translation and text-to-text generation.
101
+
102
+ ## Risks, Limitations and Biases
103
+
104
+ **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.**
105
+
106
+ 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)).
107
+
108
+ ## How to Get Started With the Model
109
+
110
+ A short example code:
111
+
112
+ ```python
113
+ from transformers import MarianMTModel, MarianTokenizer
114
+
115
+ src_text = [
116
+ ">>swe<< بكرا منشوف شو بدنا نعمل",
117
+ ">>swe<< عن ماذا يتحدث الكتاب؟"
118
+ ]
119
+
120
+ model_name = "pytorch-models/opus-mt-tc-big-ar-gmq"
121
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
122
+ model = MarianMTModel.from_pretrained(model_name)
123
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
124
+
125
+ for t in translated:
126
+ print( tokenizer.decode(t, skip_special_tokens=True) )
127
+
128
+ # expected output:
129
+ # - Vi jobbar på det.
130
+ # Vad handlar boken om?
131
+ ```
132
+
133
+ You can also use OPUS-MT models with the transformers pipelines, for example:
134
+
135
+ ```python
136
+ from transformers import pipeline
137
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-ar-gmq")
138
+ print(pipe(">>swe<< بكرا منشوف شو بدنا نعمل"))
139
+
140
+ # expected output: - Vi jobbar på det.
141
+ ```
142
+
143
+ ## Training
144
+
145
+ - **Data**: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
146
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
147
+ - **Model Type:** transformer-big
148
+ - **Original MarianNMT Model**: [opusTCv20210807_transformer-big_2022-08-09.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/ara-gmq/opusTCv20210807_transformer-big_2022-08-09.zip)
149
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
150
+
151
+ ## Evaluation
152
+
153
+ * test set translations: [opusTCv20210807_transformer-big_2022-08-09.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/ara-gmq/opusTCv20210807_transformer-big_2022-08-09.test.txt)
154
+ * test set scores: [opusTCv20210807_transformer-big_2022-08-09.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/ara-gmq/opusTCv20210807_transformer-big_2022-08-09.eval.txt)
155
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
156
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
157
+
158
+ | langpair | testset | chr-F | BLEU | #sent | #words |
159
+ |----------|---------|-------|-------|-------|--------|
160
+ | ara-dan | flores101-devtest | 0.56203 | 28.8 | 1012 | 24638 |
161
+ | ara-nob | flores101-devtest | 0.50833 | 20.5 | 1012 | 23873 |
162
+ | ara-swe | flores101-devtest | 0.55512 | 27.3 | 1012 | 23121 |
163
+
164
+ ## Citation Information
165
+
166
+ * 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.)
167
+
168
+ ```
169
+ @inproceedings{tiedemann-thottingal-2020-opus,
170
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
171
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
172
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
173
+ month = nov,
174
+ year = "2020",
175
+ address = "Lisboa, Portugal",
176
+ publisher = "European Association for Machine Translation",
177
+ url = "https://aclanthology.org/2020.eamt-1.61",
178
+ pages = "479--480",
179
+ }
180
+
181
+ @inproceedings{tiedemann-2020-tatoeba,
182
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
183
+ author = {Tiedemann, J{\"o}rg},
184
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
185
+ month = nov,
186
+ year = "2020",
187
+ address = "Online",
188
+ publisher = "Association for Computational Linguistics",
189
+ url = "https://aclanthology.org/2020.wmt-1.139",
190
+ pages = "1174--1182",
191
+ }
192
+ ```
193
+
194
+ ## Acknowledgements
195
+
196
+ 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.
197
+
198
+ ## Model conversion info
199
+
200
+ * transformers version: 4.16.2
201
+ * OPUS-MT git hash: 8b9f0b0
202
+ * port time: Fri Aug 12 14:48:40 EEST 2022
203
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ ara-dan flores101-dev 0.56223 29.7 997 23685
2
+ ara-nob flores101-dev 0.50948 21.8 997 23157
3
+ ara-swe flores101-dev 0.55754 28.2 997 22417
4
+ ara-dan flores101-devtest 0.56203 28.8 1012 24638
5
+ ara-nob flores101-devtest 0.50833 20.5 1012 23873
6
+ ara-swe flores101-devtest 0.55512 27.3 1012 23121
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c6c552f0f08ed797d25e81dd358e592bac30a03ceaf5357489ae6aae1827cb8
3
+ size 1022956
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
+ 60574
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": 60574,
21
+ "decoder_vocab_size": 60575,
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": 23935,
28
+ "forced_eos_token_id": 23935,
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": 60574,
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": 60575
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c033345acbae5a34e6df18b88d53317517a61afc71c8586bea0512429aafb94
3
+ size 601042755
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4d355475efd42170733d8ddc427ceac4c419274a58952b5959737d5a24d8ac7
3
+ size 898374
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:585205aad3cf6089b251451336d48bed24ec753d2c4b64684c10c402c55349fe
3
+ size 799056
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
1
+ {"source_lang": "ar", "target_lang": "gmq", "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-08-09/ar-gmq", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff