Syntax2dim-logistic
Syntax2dim-logistic is a closed-set Ancient Greek authorship classifier for
the four sentence-based tasks in
Urdatorn/sphragis.
It represents each example by rates of one- and two-way combinations of
word-level syntactic features and applies a single PyTorch affine layer: a
multinomial logistic-regression classifier with no hidden layers.
The 2,161-dimensional feature inventory contains dependency relations, the nine-position AGDT morphology of a word and its head, dependency direction, and dependency distance. Features were retained when their training-corpus support was at least 0.5% of the 792,233 syntactic words. Support was counted once on each of the 43,300 atomic training sentences before mixed-length training augmentation.
Results
Scores are held-out test macro-F1. Learning rate and epoch count were selected on validation data; test data were loaded only after refitting on train plus validation.
| Sphragis task | Validation macro-F1 | Test macro-F1 | Test accuracy | Selected learning rate | Refit epochs |
|---|---|---|---|---|---|
sentence_1 |
59.10% | 61.36% | 71.02% | 0.001 | 212 |
sentence_10 |
92.78% | 94.47% | 94.17% | 0.003 | 138 |
sentence_50 |
92.90% | 92.90% | 92.71% | 0.0001 | 1,600 |
sentence_100 |
92.82% | 98.18% | 95.83% | 0.0003 | 1,376 |
Each task used a five-point Optuna grid over learning rates 0.0001, 0.0003,
0.001, 0.003, and 0.01, with AdamW, coefficient weight decay 0.0001,
validation-loss early stopping, seed 2024, and a maximum of 4,000 epochs.
Files
inventory.pkl: the shared ordered 2,161-feature vocabulary.models/<task>/model.pt: CPU PyTorch state, class labels and training configuration for that task.models/<task>/metrics.json: configuration, per-epoch loss curves, Optuna trials and final metrics.models/<task>/predictions.jsonl: held-out test predictions.predict.py: a small JSONL inference command.syntax2dim/: the exact feature extraction and reusable classifier code.
The inventory SHA-256 recorded by every checkpoint is
84c7d9196af662036930ab060abe411c2df35775c8eafd98652bde389bbb6381.
Inference
Install PyTorch, NumPy, SciPy and PyArrow, then supply JSON Lines records with
an id and a Sphragis-style conllu field. The field may be ordinary CoNLL-U
or a JSON-encoded list of CoNLL-U documents.
python predict.py \
--task sentence_10 \
--input examples.jsonl \
--output predictions.jsonl
The model consumes syntactic annotations, not raw text. Input XPOS values must use the nine-position AGDT/Perseus convention used by Sphragis.
Limitations
The classifier predicts only the 17 authors represented in this Sphragis release. The benchmark split is stratified within author and work rather than strictly work-held-out, so scores should not be interpreted as performance on entirely unseen works. Performance also depends on the upstream syntactic annotation and may reflect treebank or genre differences. The 50- and 100-sentence test splits contain only 96 and 48 examples, respectively.
Sphragis combines sources with different licenses, including NonCommercial and ShareAlike material. Consult the dataset's row-level licensing metadata before reuse.