CoolFace
Modelpublic

bumblelbee/nllb-600m-ancient-egyptian-hieroglyphics

sourceHugging Facecc-by-sa-4.0updated 8mo agoView on Hugging Face
1likes21downloads
Model Card

NLLB-600M for Ancient Egyptian Hieroglyphics Translation

Fine-tuned NLLB-200-distilled-600M model for translating Ancient Egyptian hieroglyphics to German and English.

🎯 Model Performance

Language PairBLEU-4AccuracySamples
Ancient Egyptian β†’ German29.9676.54%125
Ancient Egyptian β†’ English15.8057.89%75

πŸ“Š Training Details

  • β€”Base Model: facebook/nllb-200-distilled-600M
  • β€”Training Steps: 7,000 steps (20 epochs)
  • β€”Best Validation Loss: 1.4976 (at step 6,000)
  • β€”Training Data: 80,375 German + 10,525 English samples
  • β€”Data Source: Thesaurus Linguae Aegyptiae (TLA) database
  • β€”Hardware: 4Γ— NVIDIA RTX A4000 GPUs
  • β€”Training Time: ~12-14 hours

πŸš€ Quick Start

python
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
import torch

# Load model
model = AutoModelForSeq2SeqLM.from_pretrained("bumblelbee/nllb-600m-ancient-egyptian-hieroglyphics")
tokenizer = AutoTokenizer.from_pretrained("bumblelbee/nllb-600m-ancient-egyptian-hieroglyphics")
model = model.to('cuda')
model.eval()

# Example: Translate hieroglyphics to German
hieroglyphic_input = "M17 G43 V28 N41 G43 S29 X1 F29 F29 F29 X1 X1"

tokenizer.src_lang = "arb_Arab"  # Ancient Egyptian uses Arabic encoding
tokenizer.tgt_lang = "deu_Latn"  # German target
forced_bos_token_id = tokenizer.lang_code_to_id["deu_Latn"]

inputs = tokenizer([hieroglyphic_input], return_tensors="pt").to('cuda')

with torch.no_grad():
    outputs = model.generate(
        **inputs,
        forced_bos_token_id=forced_bos_token_id,
        num_beams=5,
        max_length=128,
        early_stopping=True
    )

translation = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
print(f"German: {translation}")
# Output: "Unas' Zunge ist unter seinen Füßen."

# For English translation
tokenizer.tgt_lang = "eng_Latn"
forced_bos_token_id = tokenizer.lang_code_to_id["eng_Latn"]
# ... same process

⚠️ Important Notes

  1. 1.Always use `forced_bos_token_id`: Without it, the model outputs Arabic instead of German/English
  2. 2.Input format: Space-separated Gardiner codes (e.g., "M17 G43 V28")
  3. 3.Language codes:
  4. 4.Source: arb_Arab (Ancient Egyptian)
  5. 5.Target: deu_Latn (German) or eng_Latn (English)

πŸ“ˆ Comparison vs Baseline

ModelGerman BLEUEnglish BLEU
Our NLLB-600M29.9615.80
Paper's M2M-100 (published)13.4710.59
Improvement+16.49 (+122%)+5.21 (+49%)

πŸ“š Dataset

Trained on data from the Thesaurus Linguae Aegyptiae (TLA):

  • β€”Old Egyptian and Middle Egyptian texts
  • β€”80,375 hieroglyphic-German pairs
  • β€”10,525 hieroglyphic-English pairs
  • β€”Data preprocessing: 280+ cleaning operations applied

πŸ† Achievements

  • β€”βœ… Outperforms baseline M2M-100 model by 122% on German
  • β€”βœ… High token-level accuracy (76.54% on German)
  • β€”βœ… Low perplexity (3.93 on German - confident predictions)
  • β€”βœ… Fully reproducible with complete training logs

πŸ“ Citation

bibtex
@misc{nllb-hieroglyphics-2026,
  title={NLLB-600M for Ancient Egyptian Hieroglyphics Translation},
  author={Your Name},
  year={2026},
  url={https://huggingface.co/bumblelbee/nllb-600m-ancient-egyptian-hieroglyphics}
}

πŸ“„ License

This model is released under CC-BY-SA-4.0, consistent with the TLA database license.

πŸ”— Links

  • β€”Dataset: TLA Database
  • β€”Baseline Paper: De Cao et al. (2024) "Deep Learning Meets Egyptology"

πŸ™ Acknowledgments

  • β€”Base model: Meta AI's NLLB-200
  • β€”Dataset: Berlin-Brandenburgische Akademie der Wissenschaften (TLA)