Update README.md
Browse files
README.md
CHANGED
|
@@ -23,9 +23,13 @@ The configuration file fed into OpusDistillery can be found [here](https://githu
|
|
| 23 |
|
| 24 |
## How to run
|
| 25 |
```python
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
```
|
| 30 |
|
| 31 |
## Benchmarks
|
|
@@ -39,5 +43,5 @@ The configuration file fed into OpusDistillery can be found [here](https://githu
|
|
| 39 |
|
| 40 |
| testset | BLEU | chr-F | COMET |
|
| 41 |
|-----------------------|-------|-------|-------|
|
| 42 |
-
| Flores+ |
|
| 43 |
-
| Bouquet |
|
|
|
|
| 23 |
|
| 24 |
## How to run
|
| 25 |
```python
|
| 26 |
+
from transformers import MarianMTModel, MarianTokenizer
|
| 27 |
+
model_name = "Helsinki-NLP/opus-mt_tiny_eng-rus"
|
| 28 |
+
tokenizer = MarianTokenizer.from_pretrained(model_name)
|
| 29 |
+
model = MarianMTModel.from_pretrained(model_name)
|
| 30 |
+
tok = tokenizer("Hello, how are you?", return_tensors="pt").input_ids
|
| 31 |
+
output = model.generate(tok)[0]
|
| 32 |
+
tokenizer.decode(output, skip_special_tokens=True)
|
| 33 |
```
|
| 34 |
|
| 35 |
## Benchmarks
|
|
|
|
| 43 |
|
| 44 |
| testset | BLEU | chr-F | COMET |
|
| 45 |
|-----------------------|-------|-------|-------|
|
| 46 |
+
| Flores+ | 24.4 | 52.0 | 0.8122 |
|
| 47 |
+
| Bouquet | 28.0 |53.0 | 0.8243 |
|