Views
No views yet
| Language Pair | BLEU-4 | Accuracy | Samples |
|---|---|---|---|
| Ancient Egyptian → German | 29.96 | 76.54% | 125 |
| Ancient Egyptian → English | 15.80 | 57.89% | 75 |
1from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
2import torch
3
4# Load model
5model = AutoModelForSeq2SeqLM.from_pretrained("bumblelbee/nllb-600m-ancient-egyptian-hieroglyphics")
6tokenizer = AutoTokenizer.from_pretrained("bumblelbee/nllb-600m-ancient-egyptian-hieroglyphics")
7model = model.to('cuda')
8model.eval()
9
10# Example: Translate hieroglyphics to German
11hieroglyphic_input = "M17 G43 V28 N41 G43 S29 X1 F29 F29 F29 X1 X1"
12
13tokenizer.src_lang = "arb_Arab" # Ancient Egyptian uses Arabic encoding
14tokenizer.tgt_lang = "deu_Latn" # German target
15forced_bos_token_id = tokenizer.lang_code_to_id["deu_Latn"]
16
17inputs = tokenizer([hieroglyphic_input], return_tensors="pt").to('cuda')
18
19with torch.no_grad():
20 outputs = model.generate(
21 **inputs,
22 forced_bos_token_id=forced_bos_token_id,
23 num_beams=5,
24 max_length=128,
25 early_stopping=True
26 )
27
28translation = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
29print(f"German: {translation}")
30# Output: "Unas' Zunge ist unter seinen Füßen."
31
32# For English translation
33tokenizer.tgt_lang = "eng_Latn"
34forced_bos_token_id = tokenizer.lang_code_to_id["eng_Latn"]
35# ... same processforced_bos_token_id: Without it, the model outputs Arabic instead of German/Englisharb_Arab (Ancient Egyptian)deu_Latn (German) or eng_Latn (English)| Model | German BLEU | English BLEU |
|---|---|---|
| Our NLLB-600M | 29.96 | 15.80 |
| Paper's M2M-100 (published) | 13.47 | 10.59 |
| Improvement | +16.49 (+122%) | +5.21 (+49%) |
1@misc{nllb-hieroglyphics-2026,
2 title={NLLB-600M for Ancient Egyptian Hieroglyphics Translation},
3 author={Your Name},
4 year={2026},
5 url={https://huggingface.co/bumblelbee/nllb-600m-ancient-egyptian-hieroglyphics}
6}