Initial commit
Browse files- .gitattributes +2 -0
- README.md +56 -3
- model.bin +3 -0
- sp_m.model +3 -0
.gitattributes
CHANGED
@@ -25,3 +25,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
model.bin filter=lfs diff=lfs merge=lfs -text
|
29 |
+
sp_m.model filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
@@ -1,3 +1,56 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- ca
|
4 |
+
- en
|
5 |
+
|
6 |
+
tags:
|
7 |
+
- translation
|
8 |
+
- opennmt
|
9 |
+
|
10 |
+
license: mit
|
11 |
+
metrics:
|
12 |
+
- bleu
|
13 |
+
---
|
14 |
+
|
15 |
+
### Introduction
|
16 |
+
|
17 |
+
English - Catalan translation models based on OpenNMT.
|
18 |
+
|
19 |
+
### Usage
|
20 |
+
|
21 |
+
|
22 |
+
```pip3 install ctranslate2 pyonmttok```
|
23 |
+
|
24 |
+
Simple translation using Python:
|
25 |
+
|
26 |
+
```python
|
27 |
+
|
28 |
+
import ctranslate2
|
29 |
+
translator = ctranslate2.Translator("ctranslate2/")
|
30 |
+
translator.translate_batch([["▁Hello", "▁world", "!"]])
|
31 |
+
[[{'tokens': ['▁Hola', '▁món', '!']}]]
|
32 |
+
|
33 |
+
```
|
34 |
+
|
35 |
+
Simple tokenization & translation using Python:
|
36 |
+
|
37 |
+
|
38 |
+
```python
|
39 |
+
|
40 |
+
import pyonmttok
|
41 |
+
tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = "tokenizer/sp_m.model")
|
42 |
+
tokenized=tokenizer.tokenize("Hello world!")
|
43 |
+
|
44 |
+
import ctranslate2
|
45 |
+
translator = ctranslate2.Translator("ctranslate2/")
|
46 |
+
translated = translator.translate_batch([tokenized[0]])
|
47 |
+
print(tokenizer.detokenize(translated[0][0]['tokens']))
|
48 |
+
Hola món!
|
49 |
+
```
|
50 |
+
|
51 |
+
## Benchmarks
|
52 |
+
|
53 |
+
| testset | BLEU |
|
54 |
+
|-----------------------|-------|
|
55 |
+
| Tatoeba-test.zho.eng | 45.2 |
|
56 |
+
|
model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dc75eff7e5976b04ea15c0bc5232989bda1e29234e6b7d3b9bd8d0b827f93f09
|
3 |
+
size 122582230
|
sp_m.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f4d30a95cc16610280dbce9f2802532a7441b608f12442fddace6de93ae52477
|
3 |
+
size 1146685
|