Views
No views yet
Helsinki-NLP/opus-mt-en-uk, донавчена на наборі даних Helsinki-NLP/opus-100.| Параметр | Значення |
|---|---|
| Learning rate | 2e-5 |
| Batch size | 16 |
| Gradient accumulation | 2 |
| Effective batch size | 32 |
| Epochs | 3 |
| Weight decay | 0.01 |
| Warmup steps | 500 |
| Mixed precision | fp16 |
| Метрика | Базова модель | Донавчена модель | Приріст |
|---|---|---|---|
| SacreBLEU | 23.29 | 24.00 | +0.71 |
| chrF | 41.87 | 42.52 | +0.65 |
| METEOR | 0.4332 | 0.4315 | -0.0017 |
1from transformers import MarianMTModel, MarianTokenizer
2
3model_name = "Serhi-2026/marianmt-en-uk-finetuned"
4tokenizer = MarianTokenizer.from_pretrained(model_name)
5model = MarianMTModel.from_pretrained(model_name)
6
7text = "Machine learning is fascinating."
8inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True)
9outputs = model.generate(**inputs, max_length=128, num_beams=4)
10translation = tokenizer.decode(outputs[0], skip_special_tokens=True)
11print(translation)