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_eng-fra"
|
| 29 |
+
tokenizer = MarianTokenizer.from_pretrained(model_name)
|
| 30 |
+
model = MarianMTModel.from_pretrained(model_name)
|
| 31 |
+
tok = tokenizer("Good morning, how are you?", 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+ | 44.2 | 67.6 | 0.8321 |
|
| 48 |
+
| Bouquet | 40.4 | 63.6 | 0.8390 |
|
| 49 |
|
| 50 |
|