CNR-ILC/gs-ithaca-tlg: Fine-Tuned Ithaca Model for Ancient Greek Text Restoration

Questo modello è una versione fine-tunata di Ithaca (sviluppato da Google DeepMind, Assael et al., Nature 2022) addestrato specificamente sul corpus TLG (Thesaurus Linguae Graecae) per il progetto GreekSchools.

Mentre il modello Ithaca originale è stato addestrato esclusivamente su iscrizioni epigrafiche (corpus PHI), questo checkpoint è stato adattato al registro linguistico, sintattico e lessicale della letteratura greca e dei trattati filosofici (tipici dei papiri ercolanesi).

Caratteristiche Principali

  • Architettura Character-Level: modella il testo a livello di singoli caratteri anziché subword (BPE/WordPiece), eliminando il problema del disallineamento morfologico nelle terminazioni flessive (desinenze).
  • Transformer BigBird: attenzione sparsa con supporto a finestre di contesto lunghe (fino a 768 caratteri).
  • Freezing Selettivo: durante il fine-tuning i rami di attribuzione geografica e temporale (e i blocchi iniziali dell'encoder selezionati tramite NSGA-II) sono stati congelati, focalizzando i gradienti sul restauro testuale (masked character prediction).
  • Decodifica con HCB Beam Search: impiega la correzione pseudo-likelihood HCB (Hammersley-Clifford-Besag Infilling) con strategia non-sequenziale Best-to-Worst, garantendo coerenza statistica e allineamento metodologico con i modelli BERT del framework.

Dettagli di Addestramento

  • Base Model: deepmind/ithaca
  • Corpus di Fine-Tuning: CNR-ILC/gs-dataset-tlg-uncased
  • Framework: JAX / Flax Linen / Optax
  • Ottimizzazione Iperparametri: Multi-Objective Genetic Algorithm NSGA-II (Optuna)
  • Convenzione lacune: Formato Leiden standard [...] o trattini ---- (testo normalizzato privo di accenti e spiriti).

Iperparametri Ottimali (Frontiera di Pareto NSGA-II)

Iperparametro Valore
batch_size 8
dropout_rate 0.1
epochs 5
lr 1.5355286838886852e-05
lr_scheduler_type cosine
num_layers_to_freeze 2
strategy hcb_left_to_right
temperature 0.7
warmup_ratio 0.15
weight_decay 0.001

Risultati di Valutazione Comparativa (Pre-FT vs Post-FT)

La seguente tabella riporta i risultati della valutazione sul test set TLG, suddiviso per policy di lacuna (default, word, suffix per le terminazioni flessive):

Policy Metrica Pre-FT (Ithaca Base) Post-FT (Ithaca TLG) Delta
OVERALL Top-1 Exact Match 46.67% 58.00% 🟢 +11.33%
OVERALL Top-5 Exact Match 71.67% 78.33% 🟢 +6.67%
OVERALL Top-20 Exact Match 78.67% 84.67% 🟢 +6.00%
OVERALL Mean Reciprocal Rank (MRR) 0.5737 0.6682 🟢 +0.0945
OVERALL Character Error Rate (CER) 0.4466 0.3317 🟢 -0.1149
OVERALL Cluster Inclusion Rate 91.00% 94.33% 🟢 +3.33%
OVERALL CosSim Max @1 72.63% 82.50% 🟢 +9.86%
Policy 'suffix' Top-1 Exact Match 60.00% 68.00% 🟢 +8.00%
Policy 'suffix' Top-5 Exact Match 85.00% 85.00% ⚪ +0.00%
Policy 'suffix' Top-20 Exact Match 88.00% 93.00% 🟢 +5.00%
Policy 'suffix' Mean Reciprocal Rank (MRR) 0.7047 0.7566 🟢 +0.0519
Policy 'suffix' Character Error Rate (CER) 0.3300 0.2353 🟢 -0.0947
Policy 'suffix' Cluster Inclusion Rate 96.00% 96.00% ⚪ +0.00%
Policy 'suffix' CosSim Max @1 81.14% 88.71% 🟢 +7.58%
Policy 'word' Top-1 Exact Match 25.00% 41.00% 🟢 +16.00%
Policy 'word' Top-5 Exact Match 50.00% 64.00% 🟢 +14.00%
Policy 'word' Top-20 Exact Match 62.00% 72.00% 🟢 +10.00%
Policy 'word' Mean Reciprocal Rank (MRR) 0.3626 0.5159 🟢 +0.1533
Policy 'word' Character Error Rate (CER) 0.6437 0.4828 🟢 -0.1608
Policy 'word' Cluster Inclusion Rate 86.00% 90.00% 🟢 +4.00%
Policy 'word' CosSim Max @1 58.85% 72.32% 🟢 +13.46%
Policy 'default' Top-1 Exact Match 55.00% 65.00% 🟢 +10.00%
Policy 'default' Top-5 Exact Match 80.00% 86.00% 🟢 +6.00%
Policy 'default' Top-20 Exact Match 86.00% 89.00% 🟢 +3.00%
Policy 'default' Mean Reciprocal Rank (MRR) 0.6537 0.7319 🟢 +0.0783
Policy 'default' Character Error Rate (CER) 0.3662 0.2770 🟢 -0.0892
Policy 'default' Cluster Inclusion Rate 91.00% 97.00% 🟢 +6.00%
Policy 'default' CosSim Max @1 77.91% 86.46% 🟢 +8.55%

Utilizzo tramite l'API di GreekSchools

Una volta scaricato o registrato nell'istanza dell'API, il modello può essere interrogato direttamente specificando il checkpoint:

from models.ithaca.inference.predict import fill_mask_ithaca

# Contesto con lacuna in formato Leiden [...] o Ithaca [---]
context = "ΚΑΙ ΤΩΝ ΦΙΛΟΣΟΦ[..] ΕΝ ΤΗΙ ΠΟΛΕΙ"

suggestions = fill_mask_ithaca(
    text=context,
    checkpoint="CNR-ILC/gs-ithaca-tlg",
    K=5
)

for cand, score in suggestions:
    print(f"Suggerimento: {cand} (Confidenza: {score:.4f})")

Citazione

Se utilizzi questo modello nei tuoi studi di papirologia o filologia classica, cita il paper originale di Ithaca e il progetto GreekSchools:

@article{assael2022restoring,
  title={Restoring and attributing ancient texts using deep neural networks},
  author={Assael, Yannis and Sommerschield, Thea and Shillingford, Brendan and Bordbar, Mahyar and Pavlopoulos, John and Chatzipanagiotou, Marita and Androutsopoulos, Ion and Prag, Jonathan and de Freitas, Nando},
  journal={Nature},
  volume={603},
  number={7900},
  pages={280--283},
  year={2022},
  publisher={Nature Publishing Group}
}
Downloads last month
25
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support