Initial version
Browse files- README.md +58 -3
- config.json +2 -0
- model.bin +3 -0
- model_description.txt +9 -0
- shared_vocabulary.txt +0 -0
- sp_m.model +3 -0
README.md
CHANGED
@@ -1,3 +1,58 @@
|
|
1 |
-
---
|
2 |
-
|
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 |
+
Italian - Catalan translation model based on OpenNMT. These are the same models that we have in production at https://www.softcatala.org/traductor/.
|
20 |
+
|
21 |
+
|
22 |
+
### Usage
|
23 |
+
|
24 |
+
|
25 |
+
```bash
|
26 |
+
pip3 install ctranslate2 pyonmttok
|
27 |
+
```
|
28 |
+
|
29 |
+
Simple translation using Python:
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
```python
|
34 |
+
import ctranslate2
|
35 |
+
import pyonmttok
|
36 |
+
from huggingface_hub import snapshot_download
|
37 |
+
model_dir = snapshot_download(repo_id="softcatala/translate-ita-cat", revision="main")
|
38 |
+
|
39 |
+
tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = model_dir + "/sp_m.model")
|
40 |
+
tokenized=tokenizer.tokenize("Buon giorno a tutti")
|
41 |
+
|
42 |
+
import ctranslate2
|
43 |
+
translator = ctranslate2.Translator(model_dir)
|
44 |
+
translated = translator.translate_batch([tokenized[0]])
|
45 |
+
print(tokenizer.detokenize(translated[0][0]['tokens']))
|
46 |
+
```
|
47 |
+
|
48 |
+
## Benchmarks
|
49 |
+
|
50 |
+
| testset | BLEU |
|
51 |
+
|---------------------------------------|-------|
|
52 |
+
| test dataset (from train/dev/test) | 39.7 |
|
53 |
+
| Flores200 dataset | 26.5 |
|
54 |
+
|
55 |
+
## Additional information
|
56 |
+
* https://github.com/Softcatala/nmt-models
|
57 |
+
* https://github.com/Softcatala/parallel-catalan-corpus
|
58 |
+
|
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:7f1d1be796eb583fedfb95181fec421329c85d4af0bcab74fdfde775a309b67c
|
3 |
+
size 70727761
|
model_description.txt
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Model description: ita-cat
|
2 |
+
Date: 2022-11-11
|
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 = 39.7 67.2/46.1/34.3/26.0 (BP = 0.973 ratio = 0.974 hyp_len = 147508 ref_len = 151502)
|
6 |
+
chrF2|nrefs:1|case:mixed|eff:yes|nc:6|nw:0|space:no|version:2.1.0 = 63.2
|
7 |
+
Flores data set
|
8 |
+
BLEU|nrefs:1|case:mixed|eff:no|tok:13a|smooth:exp|version:2.1.0 = 26.5 58.1/32.6/20.2/12.8 (BP = 1.000 ratio = 1.028 hyp_len = 28075 ref_len = 27304)
|
9 |
+
chrF2|nrefs:1|case:mixed|eff:yes|nc:6|nw:0|space:no|version:2.1.0 = 56.1
|
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
|