Initial version
Browse files- README.md +61 -3
- config.json +9 -0
- model.bin +3 -0
- model_description.txt +9 -0
- shared_vocabulary.json +0 -0
- sp_m.model +3 -0
README.md
CHANGED
|
@@ -1,3 +1,61 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- ca
|
| 4 |
+
- eu
|
| 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 - Basque 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-fra", 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 |
+
## Data used
|
| 49 |
+
|
| 50 |
+
Build using https://huggingface.co/datasets/projecte-aina/CA-EU_Parallel_Corpus corpus.
|
| 51 |
+
|
| 52 |
+
## Benchmarks
|
| 53 |
+
|
| 54 |
+
| testset | BLEU |
|
| 55 |
+
|---------------------------------------|-------|
|
| 56 |
+
| test dataset (from train/dev/test) | 27.3 |
|
| 57 |
+
| Flores200 dataset | 17.1 |
|
| 58 |
+
|
| 59 |
+
## Additional information
|
| 60 |
+
* https://github.com/Softcatala/nmt-models
|
| 61 |
+
* https://github.com/Softcatala/parallel-catalan-corpus
|
config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_source_bos": false,
|
| 3 |
+
"add_source_eos": false,
|
| 4 |
+
"bos_token": "<s>",
|
| 5 |
+
"decoder_start_token": "<s>",
|
| 6 |
+
"eos_token": "</s>",
|
| 7 |
+
"layer_norm_epsilon": null,
|
| 8 |
+
"unk_token": "<unk>"
|
| 9 |
+
}
|
model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b6a5e7d954548c606fac5120dc4fdaf37920a9edbdc20b93269b70a7f3528647
|
| 3 |
+
size 70727741
|
model_description.txt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Model description: cat-eus
|
| 2 |
+
Date: 2024-08-12
|
| 3 |
+
TF version 2.10.0, OpenNMT version 2.29.1, CTranslate2 version 3.22.0
|
| 4 |
+
Test data set
|
| 5 |
+
BLEU|nrefs:1|bs:1000|seed:12345|case:mixed|eff:no|tok:13a|smooth:exp|version:2.1.0 = 27.3 (μ = 27.3 ± 0.3) 59.6/33.6/21.4/14.4 (BP = 0.973 ratio = 0.973 hyp_len = 310620 ref_len = 319206)
|
| 6 |
+
chrF2|nrefs:1|bs:1000|seed:12345|case:mixed|eff:yes|nc:6|nw:0|space:no|version:2.1.0 = 63.1 (μ = 63.1 ± 0.2)
|
| 7 |
+
Flores data set
|
| 8 |
+
BLEU|nrefs:1|bs:1000|seed:12345|case:mixed|eff:no|tok:13a|smooth:exp|version:2.1.0 = 17.1 (μ = 17.1 ± 0.9) 49.8/22.5/11.8/6.6 (BP = 0.998 ratio = 0.998 hyp_len = 20755 ref_len = 20788)
|
| 9 |
+
chrF2|nrefs:1|bs:1000|seed:12345|case:mixed|eff:yes|nc:6|nw:0|space:no|version:2.1.0 = 56.2 (μ = 56.1 ± 0.6)
|
shared_vocabulary.json
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:463a5d91a855d512edebcdddd98ca9aa4e5ee72674d87924f86c65e0353b4188
|
| 3 |
+
size 1160319
|