tiedeman commited on
Commit
08a4a59
1 Parent(s): a4a6d86

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,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - es
4
+ - eu
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-eu-itc
16
+ results:
17
+ - task:
18
+ name: Translation eus-spa
19
+ type: translation
20
+ args: eus-spa
21
+ dataset:
22
+ name: tatoeba-test-v2021-08-07
23
+ type: tatoeba_mt
24
+ args: eus-spa
25
+ metrics:
26
+ - name: BLEU
27
+ type: bleu
28
+ value: 50.3
29
+ - name: chr-F
30
+ type: chrf
31
+ value: 0.68019
32
+ ---
33
+ # opus-mt-tc-big-eu-itc
34
+
35
+ ## Table of Contents
36
+ - [Model Details](#model-details)
37
+ - [Uses](#uses)
38
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
39
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
40
+ - [Training](#training)
41
+ - [Evaluation](#evaluation)
42
+ - [Citation Information](#citation-information)
43
+ - [Acknowledgements](#acknowledgements)
44
+
45
+ ## Model Details
46
+
47
+ Neural machine translation model for translating from Basque (eu) to Italic languages (itc).
48
+
49
+ 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).
50
+ **Model Description:**
51
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
52
+ - **Model Type:** Translation (transformer-big)
53
+ - **Release**: 2022-07-23
54
+ - **License:** CC-BY-4.0
55
+ - **Language(s):**
56
+ - Source Language(s): eus
57
+ - Target Language(s): fra ita spa
58
+ - Valid Target Language Labels: >>fra<< >>ita<< >>spa<<
59
+ - **Original Model**: [opusTCv20210807_transformer-big_2022-07-23.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/eus-itc/opusTCv20210807_transformer-big_2022-07-23.zip)
60
+ - **Resources for more information:**
61
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
62
+ - More information about released models for this language pair: [OPUS-MT eus-itc README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/eus-itc/README.md)
63
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
64
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/
65
+
66
+ 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<<`
67
+
68
+ ## Uses
69
+
70
+ This model can be used for translation and text-to-text generation.
71
+
72
+ ## Risks, Limitations and Biases
73
+
74
+ **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.**
75
+
76
+ 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)).
77
+
78
+ ## How to Get Started With the Model
79
+
80
+ A short example code:
81
+
82
+ ```python
83
+ from transformers import MarianMTModel, MarianTokenizer
84
+
85
+ src_text = [
86
+ ">>fra<< Aberatsa da.",
87
+ ">>spa<< Zuzena?"
88
+ ]
89
+
90
+ model_name = "pytorch-models/opus-mt-tc-big-eu-itc"
91
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
92
+ model = MarianMTModel.from_pretrained(model_name)
93
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
94
+
95
+ for t in translated:
96
+ print( tokenizer.decode(t, skip_special_tokens=True) )
97
+
98
+ # expected output:
99
+ # Il est riche.
100
+ # ¿Directo?
101
+ ```
102
+
103
+ You can also use OPUS-MT models with the transformers pipelines, for example:
104
+
105
+ ```python
106
+ from transformers import pipeline
107
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-eu-itc")
108
+ print(pipe(">>fra<< Aberatsa da."))
109
+
110
+ # expected output: Il est riche.
111
+ ```
112
+
113
+ ## Training
114
+
115
+ - **Data**: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
116
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
117
+ - **Model Type:** transformer-big
118
+ - **Original MarianNMT Model**: [opusTCv20210807_transformer-big_2022-07-23.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/eus-itc/opusTCv20210807_transformer-big_2022-07-23.zip)
119
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
120
+
121
+ ## Evaluation
122
+
123
+ * test set translations: [opusTCv20210807_transformer-big_2022-07-23.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/eus-itc/opusTCv20210807_transformer-big_2022-07-23.test.txt)
124
+ * test set scores: [opusTCv20210807_transformer-big_2022-07-23.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/eus-itc/opusTCv20210807_transformer-big_2022-07-23.eval.txt)
125
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
126
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
127
+
128
+ | langpair | testset | chr-F | BLEU | #sent | #words |
129
+ |----------|---------|-------|-------|-------|--------|
130
+ | eus-spa | tatoeba-test-v2021-08-07 | 0.68019 | 50.3 | 1850 | 12469 |
131
+
132
+ ## Citation Information
133
+
134
+ * 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.)
135
+
136
+ ```
137
+ @inproceedings{tiedemann-thottingal-2020-opus,
138
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
139
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
140
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
141
+ month = nov,
142
+ year = "2020",
143
+ address = "Lisboa, Portugal",
144
+ publisher = "European Association for Machine Translation",
145
+ url = "https://aclanthology.org/2020.eamt-1.61",
146
+ pages = "479--480",
147
+ }
148
+
149
+ @inproceedings{tiedemann-2020-tatoeba,
150
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
151
+ author = {Tiedemann, J{\"o}rg},
152
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
153
+ month = nov,
154
+ year = "2020",
155
+ address = "Online",
156
+ publisher = "Association for Computational Linguistics",
157
+ url = "https://aclanthology.org/2020.wmt-1.139",
158
+ pages = "1174--1182",
159
+ }
160
+ ```
161
+
162
+ ## Acknowledgements
163
+
164
+ 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.
165
+
166
+ ## Model conversion info
167
+
168
+ * transformers version: 4.16.2
169
+ * OPUS-MT git hash: 8b9f0b0
170
+ * port time: Fri Aug 12 20:31:49 EEST 2022
171
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ eus-spa tatoeba-test-v2021-08-07 0.68019 50.3 1850 12469
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b75942e3385a8d889f54144a78729bdce4496366c3d2635f42e80e1c40034ff6
3
+ size 61299
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
+ 56986
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": 56986,
21
+ "decoder_vocab_size": 56987,
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": 47724,
28
+ "forced_eos_token_id": 47724,
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": 56986,
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": 56987
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0f3aa297bba26dfea3001c28b961d78e031c4f57f6172bb02e9c31c8d0b8486b
3
+ size 586339139
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ffe0d2076932020b3b1159e3f6eb7313650d334fabf7649464b2d9a21442942f
3
+ size 820261
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:a43dbfa7971d43e0ea87f02c6a494eeb93530a0a7c8bd1c6878a465cc4890fe3
3
+ size 816073
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "eu", "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/eu-itc", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff