Instructions to use Ericu950/Stoicheia-restoration-test8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ericu950/Stoicheia-restoration-test8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="Ericu950/Stoicheia-restoration-test8", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Ericu950/Stoicheia-restoration-test8", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Stoicheia -- documentary restoration (digit 8 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 8.
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-test8"
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