Views
No views yet
facebook/nllb-200-distilled-600M.oci_Latn language tag<arn> / <oci> used in training to distinguish the targets| Language | BLEU | ChrF | TER |
|---|---|---|---|
| Aranese | 30.1 | 49.8 | 71.5 |
| Aragonese | 61.9 | 79.5 | 26.8 |
oci_Latn as the shared language tag<arn> or <oci> to distinguish them1from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
2import torch
3
4# Load model and tokenizer
5model_name = "jonathanmutal/WMT24-spanish-to-aranese-aragonese"
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
8
9# Input in Spanish
10spanish_sentence = "¿Cómo se encuentra usted hoy?"
11
12# Tokenize input
13inputs = tokenizer(spanish_sentence, return_tensors="pt")
14
15# Target language: Aranese uses 'oci_Latn' in NLLB
16translated_tokens = model.generate(
17 **inputs,
18 forced_bos_token_id=tokenizer.convert_tokens_to_ids("oci_Latn"),
19 max_length=50,
20 num_beams=5
21)
22
23# Decode and print output
24translation = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)[0]
25print(translation)Com se trape vos aué?oci_Latn token for both Occitan and Aranese, disambiguation may require special prompts1@inproceedings{mutal2024timunige,
2 title = "{TIM-UNIGE}: Translation into Low-Resource Languages of Spain for {WMT24}",
3 author = {Mutal, Jonathan and Ormaechea, Lucía},
4 booktitle = "Proceedings of the Ninth Conference on Machine Translation",
5 year = {2024},
6 pages = {862--870}
7}