File size: 1,360 Bytes
df169b5
 
b9c9a3b
 
 
 
 
 
df169b5
b9c9a3b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9c371d1
b9c9a3b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
license: cc-by-nc-sa-4.0
language:
- hu
- en
tags:
- translation
- opennmt
---

inference: false
---

### Introduction

Hungarian - English translation model that was trained on the [Hunglish2](http://mokk.bme.hu/resources/hunglishcorpus/) dataset using OpenNMT. 

### Usage

Install the necessary dependencies:

```bash
pip3 install ctranslate2 pyonmttok
```

Simple tokenization & translation using Python:


```python
import ctranslate2
import pyonmttok
from huggingface_hub import snapshot_download
model_dir = snapshot_download(repo_id="SZTAKI-HLT/opennmt-hu-en", revision="main")

tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = model_dir + "/sp_m.model")
tokenized=tokenizer.tokenize("Hello világ")

translator = ctranslate2.Translator(model_dir)
translated = translator.translate_batch([tokenized[0]])
print(tokenizer.detokenize(translated[0].hypotheses[0]))
```


## Citation

If you use our model, please cite the following paper:
```

@inproceedings{nagy2022syntax,
  title={Syntax-based data augmentation for Hungarian-English machine translation},
  author={Nagy, Attila and Nanys, Patrick and Konr{\'a}d, Bal{\'a}zs Frey and Bial, Bence and {\'A}cs, Judit},
  booktitle = {XVIII. Magyar Számítógépes Nyelvészeti Konferencia (MSZNY 2022)},
  year={2022},
  publisher = {Szegedi Tudományegyetem, Informatikai Intézet},
}

```