Translation
RicardoRei commited on
Commit
761e0dd
1 Parent(s): 1f6ffe6

cometinho model

Browse files
Files changed (3) hide show
  1. README.md +158 -0
  2. checkpoints/model.ckpt +3 -0
  3. hparams.yaml +20 -0
README.md CHANGED
@@ -1,3 +1,161 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  license: apache-2.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ pipeline_tag: translation
3
+ language:
4
+ - multilingual
5
+ - af
6
+ - am
7
+ - ar
8
+ - as
9
+ - az
10
+ - be
11
+ - bg
12
+ - bn
13
+ - br
14
+ - bs
15
+ - ca
16
+ - cs
17
+ - cy
18
+ - da
19
+ - de
20
+ - el
21
+ - en
22
+ - eo
23
+ - es
24
+ - et
25
+ - eu
26
+ - fa
27
+ - fi
28
+ - fr
29
+ - fy
30
+ - ga
31
+ - gd
32
+ - gl
33
+ - gu
34
+ - ha
35
+ - he
36
+ - hi
37
+ - hr
38
+ - hu
39
+ - hy
40
+ - id
41
+ - is
42
+ - it
43
+ - ja
44
+ - jv
45
+ - ka
46
+ - kk
47
+ - km
48
+ - kn
49
+ - ko
50
+ - ku
51
+ - ky
52
+ - la
53
+ - lo
54
+ - lt
55
+ - lv
56
+ - mg
57
+ - mk
58
+ - ml
59
+ - mn
60
+ - mr
61
+ - ms
62
+ - my
63
+ - ne
64
+ - nl
65
+ - 'no'
66
+ - om
67
+ - or
68
+ - pa
69
+ - pl
70
+ - ps
71
+ - pt
72
+ - ro
73
+ - ru
74
+ - sa
75
+ - sd
76
+ - si
77
+ - sk
78
+ - sl
79
+ - so
80
+ - sq
81
+ - sr
82
+ - su
83
+ - sv
84
+ - sw
85
+ - ta
86
+ - te
87
+ - th
88
+ - tl
89
+ - tr
90
+ - ug
91
+ - uk
92
+ - ur
93
+ - uz
94
+ - vi
95
+ - xh
96
+ - yi
97
+ - zh
98
  license: apache-2.0
99
  ---
100
+
101
+ This is a distilled [COMET](https://github.com/Unbabel/COMET) model: It receives a triplet with (source sentence, translation, reference translation) and returns a score that reflects the quality of the translation compared to both source and reference.
102
+
103
+ # Paper
104
+
105
+ [Searching for Cometinho: The Little Metric That Could](https://aclanthology.org/2022.eamt-1.9/)
106
+
107
+ # License
108
+
109
+ Apache-2.0
110
+
111
+ # Usage (unbabel-comet)
112
+
113
+ Using this model requires unbabel-comet to be installed:
114
+
115
+ ```bash
116
+ pip install --upgrade pip # ensures that pip is current
117
+ pip install unbabel-comet
118
+ ```
119
+
120
+ Then you can use it through comet CLI:
121
+
122
+ ```bash
123
+ comet-score -s {source-inputs}.txt -t {translation-outputs}.txt -r {references}.txt --model Unbabel/wmt22-comet-da
124
+ ```
125
+
126
+ Or using Python:
127
+
128
+ ```python
129
+ from comet import download_model, load_from_checkpoint
130
+
131
+ model_path = download_model("Unbabel/eamt22-cometinho-da")
132
+ model = load_from_checkpoint(model_path)
133
+ data = [
134
+ {
135
+ "src": "Dem Feuer konnte Einhalt geboten werden",
136
+ "mt": "The fire could be stopped",
137
+ "ref": "They were able to control the fire."
138
+ },
139
+ {
140
+ "src": "Schulen und Kindergärten wurden eröffnet.",
141
+ "mt": "Schools and kindergartens were open",
142
+ "ref": "Schools and kindergartens opened"
143
+ }
144
+ ]
145
+ model_output = model.predict(data, batch_size=8, gpus=1)
146
+ print (model_output)
147
+ ```
148
+
149
+ # Intended uses
150
+
151
+ Our model is intented to be used for **MT evaluation**.
152
+
153
+ Given a a triplet with (source sentence, translation, reference translation) outputs a single score between 0 and 1 where 1 represents a perfect translation.
154
+
155
+ # Languages Covered:
156
+
157
+ This model builds on top of XLM-R which cover the following languages:
158
+
159
+ Afrikaans, Albanian, Amharic, Arabic, Armenian, Assamese, Azerbaijani, Basque, Belarusian, Bengali, Bengali Romanized, Bosnian, Breton, Bulgarian, Burmese, Burmese, Catalan, Chinese (Simplified), Chinese (Traditional), Croatian, Czech, Danish, Dutch, English, Esperanto, Estonian, Filipino, Finnish, French, Galician, Georgian, German, Greek, Gujarati, Hausa, Hebrew, Hindi, Hindi Romanized, Hungarian, Icelandic, Indonesian, Irish, Italian, Japanese, Javanese, Kannada, Kazakh, Khmer, Korean, Kurdish (Kurmanji), Kyrgyz, Lao, Latin, Latvian, Lithuanian, Macedonian, Malagasy, Malay, Malayalam, Marathi, Mongolian, Nepali, Norwegian, Oriya, Oromo, Pashto, Persian, Polish, Portuguese, Punjabi, Romanian, Russian, Sanskri, Scottish, Gaelic, Serbian, Sindhi, Sinhala, Slovak, Slovenian, Somali, Spanish, Sundanese, Swahili, Swedish, Tamil, Tamil Romanized, Telugu, Telugu Romanized, Thai, Turkish, Ukrainian, Urdu, Urdu Romanized, Uyghur, Uzbek, Vietnamese, Welsh, Western, Frisian, Xhosa, Yiddish.
160
+
161
+ Thus, results for language pairs containing uncovered languages are unreliable!
checkpoints/model.ckpt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b7f8851e8e4a02082e9b3e3227162dd09c0596387143342eb795812b019f0a0
3
+ size 474246889
hparams.yaml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ activations: Tanh
2
+ batch_size: 8
3
+ class_identifier: regression_metric
4
+ dropout: 0.1
5
+ encoder_learning_rate: 1.0e-05
6
+ encoder_model: MiniLM
7
+ final_activation: null
8
+ hidden_sizes:
9
+ - 384
10
+ keep_embeddings_frozen: true
11
+ layer: 12
12
+ layerwise_decay: 0.95
13
+ learning_rate: 3.1e-05
14
+ load_weights_from_checkpoint: lightning_logs/cometinho_part-i/checkpoints/epoch=0-step=899999.ckpt
15
+ nr_frozen_epochs: 0.0
16
+ optimizer: AdamW
17
+ pool: avg
18
+ pretrained_model: microsoft/Multilingual-MiniLM-L12-H384
19
+ train_data: data/euro-distil.da.part_ii.csv
20
+ validation_data: data/2019-da-dev.csv