Stoicheia -- documentary restoration (digit 4 held out)

Stoicheia is a 405M-parameter character-level masked-diffusion encoder for Ancient Greek (d_model 1024, depth 32, banded attention: three of every four blocks attend within a 256-character window, the fourth globally). Its input is factored into five aligned planes -- letters, word/sentence boundaries, diacritics, capitalization, punctuation -- each of which can be masked independently to an explicit unknown state at inference. That is what lets one model read an edited text, scriptio continua, and a lacuna of unknown length without changing anything but its input.

Anonymous release accompanying a paper under review.

Fine-tuned from Stoicheia-doc_clean to restore damaged inscriptions and papyri, on every document except those whose PHI/TM identifier ends in 4.

Ten such checkpoints are released, one per digit, because a fixed split makes a model useless for exactly the documents an editor cares about: whatever inscription or papyrus you are working on, one of the ten has provably never read it. Pick that one and the reading it proposes cannot be a memory of the edition you are trying to check.

Usage

Write one - per missing character when the extent of the break is known, or [N±M] when its width is uncertain, and let restore_respaced do the reading.

import torch
from transformers import AutoModel
from huggingface_hub import hf_hub_download

REPO = "Ericu950/Stoicheia-restoration-test4"
model = AutoModel.from_pretrained(REPO, trust_remote_code=True).eval()

hf_hub_download(repo_id=REPO, filename="processing_char_bert.py", local_dir=".")
from processing_char_bert import CharBertProcessor

proc = CharBertProcessor()

# note the input: no accents on τηβου, and no word division either -- the model
# recovers the missing letters, the accents and the spacing together
print(proc.restore_respaced(model, "ἔδοξεν τηβου-- καὶ τῷ δήμῳ"))
# ἔδοξεν τῇ βουλῇ καὶ τῷ δήμῳ

print(proc.restore_respaced(model, "στεφανῶσαι αὐτὸν χρυσῷ στεφα[3±1]ετης ἕνεκα"))
# στεφανῶσαι αὐτὸν χρυσῷ στεφάνῳ ἀρετῆς ἕνεκα

restore_respaced works in the order an editor would: it fills the letters first, then throws the spacing away and runs the model again over the resulting scriptio continua with word division and accents unknown everywhere -- the regime it was pretrained on. Nothing in the input has to be normalized first: accents and word division are predictions, not requirements, so a bare majuscule transcript is as readable to this model as a modern critical text, and the gap is filled in the same pass that decides where the words end. Deciding the letters and the segmentation in a single pass, which decode_restoration does, leaves the boundary head hedging against a half-known segmentation, and a correctly restored word can come back cut in two. The evaluation harness in the code repository goes further still, enumerating the division inside the gap and scoring it jointly with the letters; that is the decoder behind the paper's numbers.

Downloads last month
13
Safetensors
Model size
0.4B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including Ericu950/Stoicheia-restoration-test4