Views
No views yet
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.Stoicheia-doc_clean extends the same discipline to documentary text: every inscription and
papyrus is excluded, along with anything a contamination screen flags as quoting one.1import torch
2from transformers import AutoModel
3from huggingface_hub import hf_hub_download
4
5REPO = "Ericu950/Stoicheia-fold-9"
6model = AutoModel.from_pretrained(REPO, trust_remote_code=True).eval()
7
8# `trust_remote_code` loads the model classes, but the processor is a separate helper:
9# fetch it into the working directory before importing it.
10hf_hub_download(repo_id=REPO, filename="processing_char_bert.py", local_dir=".")
11from processing_char_bert import CharBertProcessor
12
13proc = CharBertProcessor()
14
15# a gap of uncertain width in unaccented scriptio continua: "[N±M]" scores every width
16# in N-M..N+M by the model's own confidence, and restores accents and word division too
17text = "εναρχηηνο[5±3]καιολογοςηνπροστονθεον"
18best, width, candidates = proc.restore_elastic(model, text, mask_dia_boundary=True)
19print(best) # ἐν ἀρχῇ ἦν ὁ λόγος, καὶ ὁ λόγος ἦν πρὸς τὸν θεόν.
20print(width) # 5 -- the width the model judged most likely