tiedeman commited on
Commit
4df0b67
1 Parent(s): 79ad2e6

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,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - ko
5
+
6
+ tags:
7
+ - translation
8
+ - opus-mt-tc
9
+
10
+ license: cc-by-4.0
11
+ model-index:
12
+ - name: opus-mt-tc-big-en-ko
13
+ results:
14
+ ---
15
+ # opus-mt-tc-big-en-ko
16
+
17
+ ## Table of Contents
18
+ - [Model Details](#model-details)
19
+ - [Uses](#uses)
20
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
21
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
22
+ - [Training](#training)
23
+ - [Evaluation](#evaluation)
24
+ - [Citation Information](#citation-information)
25
+ - [Acknowledgements](#acknowledgements)
26
+
27
+ ## Model Details
28
+
29
+ Neural machine translation model for translating from English (en) to Korean (ko).
30
+
31
+ 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).
32
+ **Model Description:**
33
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
34
+ - **Model Type:** Translation (transformer-big)
35
+ - **Release**: 2022-07-28
36
+ - **License:** CC-BY-4.0
37
+ - **Language(s):**
38
+ - Source Language(s):
39
+ - Target Language(s):
40
+ - Valid Target Language Labels:
41
+ - **Original Model**: [opusTCv20210807-sepvoc_transformer-big_2022-07-28.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-kor/opusTCv20210807-sepvoc_transformer-big_2022-07-28.zip)
42
+ - **Resources for more information:**
43
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
44
+ - More information about released models for this language pair: [OPUS-MT eng-kor README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/eng-kor/README.md)
45
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
46
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/
47
+
48
+ 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. `>><<`
49
+
50
+ ## Uses
51
+
52
+ This model can be used for translation and text-to-text generation.
53
+
54
+ ## Risks, Limitations and Biases
55
+
56
+ **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.**
57
+
58
+ 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)).
59
+
60
+ ## How to Get Started With the Model
61
+
62
+ A short example code:
63
+
64
+ ```python
65
+ from transformers import MarianMTModel, MarianTokenizer
66
+
67
+ src_text = [
68
+ "2, 4, 6 etc. are even numbers.",
69
+ "Yes."
70
+ ]
71
+
72
+ model_name = "pytorch-models/opus-mt-tc-big-en-ko"
73
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
74
+ model = MarianMTModel.from_pretrained(model_name)
75
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
76
+
77
+ for t in translated:
78
+ print( tokenizer.decode(t, skip_special_tokens=True) )
79
+
80
+ # expected output:
81
+ # 2, 4, 6 등은 짝수입니다.
82
+ # 그래
83
+ ```
84
+
85
+ You can also use OPUS-MT models with the transformers pipelines, for example:
86
+
87
+ ```python
88
+ from transformers import pipeline
89
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-ko")
90
+ print(pipe("2, 4, 6 etc. are even numbers."))
91
+
92
+ # expected output: 2, 4, 6 등은 짝수입니다.
93
+ ```
94
+
95
+ ## Training
96
+
97
+ - **Data**: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
98
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
99
+ - **Model Type:** transformer-big
100
+ - **Original MarianNMT Model**: [opusTCv20210807-sepvoc_transformer-big_2022-07-28.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-kor/opusTCv20210807-sepvoc_transformer-big_2022-07-28.zip)
101
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
102
+
103
+ ## Evaluation
104
+
105
+ * test set translations: [opusTCv20210807-sepvoc_transformer-big_2022-07-28.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-kor/opusTCv20210807-sepvoc_transformer-big_2022-07-28.test.txt)
106
+ * test set scores: [opusTCv20210807-sepvoc_transformer-big_2022-07-28.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-kor/opusTCv20210807-sepvoc_transformer-big_2022-07-28.eval.txt)
107
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
108
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
109
+
110
+ | langpair | testset | chr-F | BLEU | #sent | #words |
111
+ |----------|---------|-------|-------|-------|--------|
112
+
113
+ ## Citation Information
114
+
115
+ * 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.)
116
+
117
+ ```
118
+ @inproceedings{tiedemann-thottingal-2020-opus,
119
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
120
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
121
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
122
+ month = nov,
123
+ year = "2020",
124
+ address = "Lisboa, Portugal",
125
+ publisher = "European Association for Machine Translation",
126
+ url = "https://aclanthology.org/2020.eamt-1.61",
127
+ pages = "479--480",
128
+ }
129
+
130
+ @inproceedings{tiedemann-2020-tatoeba,
131
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
132
+ author = {Tiedemann, J{\"o}rg},
133
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
134
+ month = nov,
135
+ year = "2020",
136
+ address = "Online",
137
+ publisher = "Association for Computational Linguistics",
138
+ url = "https://aclanthology.org/2020.wmt-1.139",
139
+ pages = "1174--1182",
140
+ }
141
+ ```
142
+
143
+ ## Acknowledgements
144
+
145
+ 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.
146
+
147
+ ## Model conversion info
148
+
149
+ * transformers version: 4.16.2
150
+ * OPUS-MT git hash: 8b9f0b0
151
+ * port time: Fri Aug 12 11:02:03 EEST 2022
152
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ eng-kor flores101-dev 0.37051 13.3 997 17570
2
+ eng-kor flores101-devtest 0.36399 13.7 1012 18427
3
+ eng-kor tatoeba-test-v2020-07-28 0.33225 13.2 2414 13244
4
+ eng-kor tatoeba-test-v2021-03-30 0.33225 13.2 2414 13244
5
+ eng-kor tatoeba-test-v2021-08-07 0.33221 13.2 2400 13174
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb47db462b7edce7c5d7611e17cb678e00fe96fdd4fbca428252f7247e2d7abe
3
+ size 643073
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
+ 32000
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": 32000,
21
+ "decoder_vocab_size": 32001,
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": 2,
28
+ "forced_eos_token_id": 2,
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": 32000,
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": 32001
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:171047b1b29fd9e9ee616f189d4d66b4c4971dda11abb1e5f0515a2eccde2247
3
+ size 483946563
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d0591e65c49541d82f48df33d7b322c3d4ee7aa0ee8747f9a7f9355dbf22c95
3
+ size 789870
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:3d2aa641a0890d8966ab8703b109895a4e522713ce99b4a0192bfacb495bc97c
3
+ size 815483
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "en", "target_lang": "ko", "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-sepvoc_transformer-big_2022-07-28/en-ko", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff