Best validation loss was achieved around Epoch 3.
Evaluation was performed on a held-out test set containing 604 English–Pnar sentence pairs. Metrics were computed in both translation directions.
1from transformers import MBartForConditionalGeneration, MBart50Tokenizer
2
3model = MBartForConditionalGeneration.from_pretrained("FithaAsma/mbart-pnar-gold")
4tokenizer = MBart50Tokenizer.from_pretrained("FithaAsma/mbart-pnar-gold")
5
6text = "Please arrange the chairs before the guests arrive."
7
8inputs = tokenizer(
9 text,
10 return_tensors="pt",
11 truncation=True,
12 max_length=160
13)
14
15outputs = model.generate(
16 **inputs,
17 max_length=160,
18 num_beams=4
19)
20
21translation = tokenizer.decode(
22 outputs[0],
23 skip_special_tokens=True
24)
25
26print(translation)
Please ensure compliance with the licenses of the original mBART model and the datasets used for training.