Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +63 -0
- flores_200_eval.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
flores_200_eval.png filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ModernMT-en-ru-EXP
|
| 2 |
+
|
| 3 |
+
Экспериментальная модель для перевода с английского на русский на базе deepvk/RuModernBert-small. Модель была инициализирована методом Bert2Bert, подробнее описанным в этой [статье](https://arxiv.org/abs/1907.12461).
|
| 4 |
+
|
| 5 |
+
An experimental model for translating from English to Russian based on deepvk/RuModernBert-small. The model was initialized using the Bert2Bert method, described in more detail in this [article](https://arxiv.org/abs/1907.12461 ).
|
| 6 |
+
|
| 7 |
+

|
| 8 |
+
## Usage
|
| 9 |
+
|
| 10 |
+
```python
|
| 11 |
+
from transformers import AutoModel, AutoTokenizer
|
| 12 |
+
|
| 13 |
+
model_name = "PruhaNLP/ModernMT-en-ru-EXP"
|
| 14 |
+
|
| 15 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 16 |
+
model = AutoModel.from_pretrained(model_name, trust_remote_code=True)
|
| 17 |
+
model.to("cuda").eval()
|
| 18 |
+
|
| 19 |
+
text = "The quick brown fox jumps over the lazy dog."
|
| 20 |
+
inputs = tokenizer(text, return_tensors="pt").to("cuda")
|
| 21 |
+
|
| 22 |
+
output_ids = model.generate(
|
| 23 |
+
inputs["input_ids"],
|
| 24 |
+
attention_mask=inputs["attention_mask"],
|
| 25 |
+
max_length=256,
|
| 26 |
+
num_beams=4,
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
translation = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
| 30 |
+
print(translation)
|
| 31 |
+
```
|
| 32 |
+
## Evaluation
|
| 33 |
+
|
| 34 |
+
| Model | Params | FLORES-200 | WMT13 | WMT14 | WMT15 | WMT16 | WMT17 | WMT18 | WMT19 | WMT20 | WMT21 |
|
| 35 |
+
|:---|:---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|
|
| 36 |
+
| facebook/wmt19-en-ru | ~300M | 30.4 | 29.7 | 43.1 | 40.3 | 35.8 | 42.2 | 34.9 | 33.4 | 23.8 | — |
|
| 37 |
+
| **PruhaNLP/ModernMT-en-ru-EXP** | **66M** | **29.5** | **24.8** | **38.9** | **32.0** | **30.1** | **33.9** | **29.9** | **29.8** | **23.2** | **25.3** |
|
| 38 |
+
| facebook/nllb-200-3.3B | 3.3B | 29.3 | 27.4 | 39.8 | 33.2 | 32.6 | 34.9 | 31.3 | 32.0 | 23.6 | 37.5 |
|
| 39 |
+
| facebook/nllb-200-distilled-1.3B | 1.3B | 28.5 | 27.4 | 39.5 | 33.5 | 32.8 | 34.8 | 31.7 | 32.2 | 23.6 | 37.3 |
|
| 40 |
+
| facebook/nllb-200-1.3B | 1.3B | 28.3 | 26.7 | 38.5 | 33.1 | 32.0 | 34.3 | 30.6 | 31.6 | 23.4 | 36.5 |
|
| 41 |
+
| facebook/m2m100_1.2B | 1.2B | 28.1 | 24.3 | 37.0 | 30.5 | 28.9 | 32.5 | 28.1 | 28.2 | 22.7 | — |
|
| 42 |
+
| gsarti/opus-mt-tc-base-en-ru | ~76M | 27.6 | 23.4 | 34.7 | 29.0 | 27.5 | 30.6 | 27.1 | 26.8 | 20.8 | — |
|
| 43 |
+
| facebook/nllb-200-distilled-600M | 600M | 25.6 | 25.0 | 35.4 | 29.9 | 29.1 | 31.4 | 27.8 | 29.1 | 21.6 | 32.7 |
|
| 44 |
+
| facebook/m2m100_418M | 418M | 22.5 | 20.5 | 30.4 | 25.6 | 24.0 | 26.4 | 22.7 | 23.4 | 18.6 | — |
|
| 45 |
+
|
| 46 |
+
## Training
|
| 47 |
+
Энкодер был целиком инициализирован RuModernBert-small, декодер - каждым вторым слоем энкодера. lr трапециевидный - 5% warmup, 20% decay. В конце были смерджены последние 7 чекпоинтов.
|
| 48 |
+
|
| 49 |
+
The encoder was initialized entirely by RuModernBert-small, and the decoder was initialized by every second layer of the encoder. Trapezoidal lr - 5% warmup, 20% decay. At the end, the last 7 checkpoints were merged.
|
| 50 |
+
|
| 51 |
+
### Data
|
| 52 |
+
Модель была обучена на 100млн случайных пар из датасета Helsinki-NLP/tatoeba_mt_train без какой либо умной фильтрации - только по числу символов дабы исключить обрезанные text.
|
| 53 |
+
|
| 54 |
+
The model was trained on 100 million random pairs from the Helsinki-NLP/tatoeba_mt_train dataset without any clever filtering - only by the number of characters in order to exclude cropped text.
|
| 55 |
+
|
| 56 |
+
### Hardware
|
| 57 |
+
Одна V100)))
|
| 58 |
+
|
| 59 |
+
Single V100
|
| 60 |
+
|
| 61 |
+
## Лицензия
|
| 62 |
+
|
| 63 |
+
Apache 2.0
|
flores_200_eval.png
ADDED
|
Git LFS Details
|