grc-macronizer-char: a small char-level model for Ancient Greek vowel-length annotation
This model predicts the phonemic length (long/short/undetermined) of the three Ancient Greek "dichrona" -- alpha (α), iota (ι), and upsilon (υ) -- whose length is not disambiguated by the standard Greek script. It was trained on Ancient Greek text automatically macronized by the rule-based grc-macronizer, applied to the Opera Graeca Adnotata corpus (Celano 2024), and is intended as a complementary, corpus-general alternative to that rule-based system.
Architecture
A small transformer encoder (~0.9M parameters) operating over three character-level "planes" per input position:
- plane 1 (letter): which of the 24 Greek letters (final/medial sigma folded together), or space, or "other" (punctuation/digits/foreign chars)
- plane 2 (diacritic): the combination of accent/breathing/diaeresis marks on that letter, if any (a small vocabulary fit from the training data)
- target (macron): none / short / long -- predicted only at positions that are genuine ambiguous dichrona (diphthong members and circumflexed vowels are excluded, matching the rule-based system's own definition)
During training, the diacritic plane is randomly masked (accents stripped) for a fraction of characters, so the model also learns to macronize unaccented input.
Usage
import sys
sys.path.insert(0, "path/to/grc-macronizer/macron_model") # for predict.py
from predict import MacronPredictor
predictor = MacronPredictor("path/to/downloaded/checkpoint")
macronized = predictor.macronize("ανθρωπος ανηρ")
# -> "α^νθρωπος α_νηρ"
MacronPredictor expects the checkpoint directory (containing
config.json/model.safetensors) plus a sibling or parent diacritic_vocab.json
(see predict.py for the exact lookup logic). The predict.py/tokenizer.py
source lives in grc-macronizer/macron_model.
- Downloads last month
- -