Update README.md
Browse files
README.md
CHANGED
|
@@ -24,9 +24,13 @@ The configuration file fed into OpusDistillery can be found [here](https://githu
|
|
| 24 |
|
| 25 |
## How to run
|
| 26 |
```python
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
```
|
| 31 |
|
| 32 |
## Benchmarks
|
|
@@ -40,7 +44,7 @@ The configuration file fed into OpusDistillery can be found [here](https://githu
|
|
| 40 |
|
| 41 |
| testset | BLEU | chr-F | COMET |
|
| 42 |
|-----------------------|-------|-------|-------|
|
| 43 |
-
| Flores+ |
|
| 44 |
-
| Bouquet |
|
| 45 |
|
| 46 |
|
|
|
|
| 24 |
|
| 25 |
## How to run
|
| 26 |
```python
|
| 27 |
+
from transformers import MarianMTModel, MarianTokenizer
|
| 28 |
+
model_name = "Helsinki-NLP/opus-mt_tiny_deu-eng"
|
| 29 |
+
tokenizer = MarianTokenizer.from_pretrained(model_name)
|
| 30 |
+
model = MarianMTModel.from_pretrained(model_name)
|
| 31 |
+
tok = tokenizer("Hallo, wie geht es dir?", return_tensors="pt").input_ids
|
| 32 |
+
output = model.generate(tok)[0]
|
| 33 |
+
tokenizer.decode(output, skip_special_tokens=True)
|
| 34 |
```
|
| 35 |
|
| 36 |
## Benchmarks
|
|
|
|
| 44 |
|
| 45 |
| testset | BLEU | chr-F | COMET |
|
| 46 |
|-----------------------|-------|-------|-------|
|
| 47 |
+
| Flores+ | 37.6 | 64.4 | 0.8623 |
|
| 48 |
+
| Bouquet | 37.6 | 59.9 | 0.8556 |
|
| 49 |
|
| 50 |
|