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.
A small transformer encoder (~0.9M parameters) operating over three character-level
"planes" per input position:
During training, the diacritic plane is randomly masked (accents stripped)
for a fraction of characters, so the model also learns to macronize
unaccented input.
1import sys
2sys.path.insert(0, "path/to/grc-macronizer/macron_model") # for predict.py
3from predict import MacronPredictor
4
5predictor = MacronPredictor("path/to/downloaded/checkpoint")
6macronized = predictor.macronize("ανθρωπος ανηρ")
7# -> "α^νθρωπος α_νηρ"
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.