Papadopoulos, Dimitris
commited on
Commit
•
6b4776a
1
Parent(s):
39b6abb
Added model weights, vocabs, readme.
Browse files- README.md +78 -0
- config.json +37 -0
- merges.txt +0 -0
- pytorch_model.bin +3 -0
- tokenizer_config.json +8 -0
- vocab-src.json +0 -0
- vocab-tgt.json +0 -0
README.md
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
- el
|
5 |
+
tags:
|
6 |
+
- translation
|
7 |
+
widget:
|
8 |
+
- text: "Not all those who wander are lost."
|
9 |
+
license: apache-2.0
|
10 |
+
metrics:
|
11 |
+
- bleu
|
12 |
+
---
|
13 |
+
|
14 |
+
## English to Greek NMT (lower-case output)
|
15 |
+
## By the Hellenic Army Academy (SSE) and the Technical University of Crete (TUC)
|
16 |
+
|
17 |
+
* source languages: en
|
18 |
+
* target languages: el
|
19 |
+
* licence: apache-2.0
|
20 |
+
* dataset: Opus, CCmatrix
|
21 |
+
* model: transformer(fairseq)
|
22 |
+
* pre-processing: tokenization + lowercasing + BPE segmentation
|
23 |
+
* metrics: bleu, chrf
|
24 |
+
* output: lowercase only, for mixed-cased model use this: https://huggingface.co/lighteternal/SSE-TUC-mt-en-el-cased
|
25 |
+
|
26 |
+
### Model description
|
27 |
+
|
28 |
+
Trained using the Fairseq framework, transformer_iwslt_de_en architecture.\
|
29 |
+
BPE segmentation (10k codes).\
|
30 |
+
Lower-case model.
|
31 |
+
|
32 |
+
### How to use
|
33 |
+
|
34 |
+
```
|
35 |
+
from transformers import FSMTTokenizer, FSMTForConditionalGeneration
|
36 |
+
|
37 |
+
mname = " <your_downloaded_model_folderpath_here> "
|
38 |
+
|
39 |
+
tokenizer = FSMTTokenizer.from_pretrained(mname)
|
40 |
+
model = FSMTForConditionalGeneration.from_pretrained(mname)
|
41 |
+
|
42 |
+
text = "Not all those who wander are lost."
|
43 |
+
|
44 |
+
encoded = tokenizer.encode(text, return_tensors='pt')
|
45 |
+
|
46 |
+
outputs = model.generate(encoded, num_beams=5, num_return_sequences=5, early_stopping=True)
|
47 |
+
for i, output in enumerate(outputs):
|
48 |
+
i += 1
|
49 |
+
print(f"{i}: {output.tolist()}")
|
50 |
+
|
51 |
+
decoded = tokenizer.decode(output, skip_special_tokens=True)
|
52 |
+
print(f"{i}: {decoded}")
|
53 |
+
```
|
54 |
+
|
55 |
+
|
56 |
+
## Training data
|
57 |
+
|
58 |
+
Consolidated corpus from Opus and CC-Matrix (~6.6GB in total)
|
59 |
+
|
60 |
+
|
61 |
+
## Eval results
|
62 |
+
|
63 |
+
|
64 |
+
Results on Tatoeba testset (EN-EL):
|
65 |
+
|
66 |
+
| BLEU | chrF |
|
67 |
+
| ------ | ------ |
|
68 |
+
| 77.3 | 0.739 |
|
69 |
+
|
70 |
+
|
71 |
+
Results on XNLI parallel (EN-EL):
|
72 |
+
|
73 |
+
| BLEU | chrF |
|
74 |
+
| ------ | ------ |
|
75 |
+
| 66.1 | 0.606 |
|
76 |
+
|
77 |
+
### BibTeX entry and citation info
|
78 |
+
TODO
|
config.json
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"FSMTForConditionalGeneration"
|
4 |
+
],
|
5 |
+
"model_type": "fsmt",
|
6 |
+
"activation_dropout": 0.0,
|
7 |
+
"activation_function": "relu",
|
8 |
+
"attention_dropout": 0.0,
|
9 |
+
"d_model": 512,
|
10 |
+
"dropout": 0.3,
|
11 |
+
"init_std": 0.02,
|
12 |
+
"max_position_embeddings": 1024,
|
13 |
+
"num_hidden_layers": 6,
|
14 |
+
"src_vocab_size": 9936,
|
15 |
+
"tgt_vocab_size": 12896,
|
16 |
+
"langs": [
|
17 |
+
"en",
|
18 |
+
"el"
|
19 |
+
],
|
20 |
+
"encoder_attention_heads": 4,
|
21 |
+
"encoder_ffn_dim": 1024,
|
22 |
+
"encoder_layerdrop": 0,
|
23 |
+
"encoder_layers": 6,
|
24 |
+
"decoder_attention_heads": 4,
|
25 |
+
"decoder_ffn_dim": 1024,
|
26 |
+
"decoder_layerdrop": 0,
|
27 |
+
"decoder_layers": 6,
|
28 |
+
"bos_token_id": 0,
|
29 |
+
"pad_token_id": 1,
|
30 |
+
"eos_token_id": 2,
|
31 |
+
"is_encoder_decoder": true,
|
32 |
+
"scale_embedding": true,
|
33 |
+
"tie_word_embeddings": false,
|
34 |
+
"num_beams": 5,
|
35 |
+
"early_stopping": false,
|
36 |
+
"length_penalty": 1.0
|
37 |
+
}
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:04df29cda5952138f6dd7e03361f0e3cb1219625791b7c61f5b8475de20f2311
|
3 |
+
size 172976478
|
tokenizer_config.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"langs": [
|
3 |
+
"en",
|
4 |
+
"el"
|
5 |
+
],
|
6 |
+
"model_max_length": 1024,
|
7 |
+
"do_lower_case": true
|
8 |
+
}
|
vocab-src.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
vocab-tgt.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|