jordimas commited on
Commit
de1acd7
·
1 Parent(s): 9594b14

Initial version

Browse files
Files changed (6) hide show
  1. README.md +58 -3
  2. config.json +2 -0
  3. model.bin +3 -0
  4. model_description.txt +9 -0
  5. shared_vocabulary.txt +0 -0
  6. sp_m.model +3 -0
README.md CHANGED
@@ -1,3 +1,58 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ca
4
+ - it
5
+
6
+ tags:
7
+ - translation
8
+
9
+ library_name: opennmt
10
+ license: mit
11
+ metrics:
12
+ - bleu
13
+
14
+ inference: false
15
+ ---
16
+
17
+ ### Introduction
18
+
19
+ Catalan - Italian translation model for OpenNMT. These are the same models that we have in production at https://www.softcatala.org/traductor/.
20
+ The models are quantified for low latency.
21
+
22
+ ### Usage
23
+
24
+ Install the necessary dependencies:
25
+
26
+
27
+ ```bash
28
+ pip3 install ctranslate2 pyonmttok
29
+ ```
30
+
31
+
32
+ Simple tokenization & translation using Python:
33
+
34
+
35
+ ```python
36
+ import ctranslate2
37
+ import pyonmttok
38
+ from huggingface_hub import snapshot_download
39
+ model_dir = snapshot_download(repo_id="softcatala/translate-cat-ita", revision="main")
40
+
41
+ tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = model_dir + "/sp_m.model")
42
+ tokenized=tokenizer.tokenize("Hola amics")
43
+
44
+ translator = ctranslate2.Translator(model_dir)
45
+ translated = translator.translate_batch([tokenized[0]])
46
+ print(tokenizer.detokenize(translated[0][0]['tokens']))
47
+ ```
48
+
49
+ ## Benchmarks
50
+
51
+ | testset | BLEU |
52
+ |---------------------------------------|-------|
53
+ | test dataset (from train/dev/test) | 36.2 |
54
+ | Flores200 dataset | 24.5 |
55
+
56
+ ## Additional information
57
+ * https://github.com/Softcatala/nmt-models
58
+ * https://github.com/Softcatala/parallel-catalan-corpus
config.json ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ {
2
+ }
model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc3f0990763e7f2e6f41896c9c3cfcc20f14c8a613be41f34c5b9cead48fa6eb
3
+ size 70727761
model_description.txt ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ Model description: cat-ita
2
+ Date: 2022-11-15
3
+ TF version 2.10.0, OpenNMT version 2.29.1, CTranslate2 version 2.24.0
4
+ Test data set
5
+ BLEU|nrefs:1|case:mixed|eff:no|tok:13a|smooth:exp|version:2.1.0 = 36.2 64.1/42.4/30.7/22.7 (BP = 0.974 ratio = 0.975 hyp_len = 139207 ref_len = 142832)
6
+ chrF2|nrefs:1|case:mixed|eff:yes|nc:6|nw:0|space:no|version:2.1.0 = 62.9
7
+ Flores data set
8
+ BLEU|nrefs:1|case:mixed|eff:no|tok:13a|smooth:exp|version:2.1.0 = 24.5 58.1/32.3/19.4/12.0 (BP = 0.952 ratio = 0.953 hyp_len = 26034 ref_len = 27306)
9
+ chrF2|nrefs:1|case:mixed|eff:yes|nc:6|nw:0|space:no|version:2.1.0 = 54.6
shared_vocabulary.txt ADDED
The diff for this file is too large to render. See raw diff
 
sp_m.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:17adbdc0d9f2593177a7274e1d928828fff2ebb17d488355b328d4e707a47d47
3
+ size 1167983