Adapting Small Language Models for Schema-Constrained TEI Document Encoding
Year: 2026
Type: preprint
Abstract: The Text Encoding Initiative (TEI) is widely used for scholarly digital editions, yet converting OCR-derived text into valid TEI remains labor-intensive and requires specialised editorial knowledge. We formulate TEI encoding as a schema-constrained document generation task, introduce a reusable pipeline for deriving aligned text-TEI supervision from existing collections, and evaluate two open-source small language models across two structurally distinct domains: French literary editions and Ancient Greek critical editions. Supervised adaptation raises validity from 9.0% and 23.7% zero-shot to 97.3% and 99.3%, with adapted 0.6B models matching or exceeding much larger untuned models. Separating well-formedness from schema validity shows that untuned models often produce syntactically valid XML without satisfying corpus-specific TEI constraints; adaptation largely closes this gap. Additional in-distribution data provide limited further gains in the more homogeneous corpus, while synthetically augmented supervision is most useful when combined with examples derived synthetically from existing documents in the broader one. Indistribution errors are concentrated in a small tail of degenerate generations, but transfer across collections is substantially weaker: textual fidelity is largely retained while structural accuracy declines. These results suggest that small adapted models can support TEI encoding within a learned editorial tradition, while cross-collection generalization remains an open question involving model scale, adaptation, and diversity of encoding practice.
Source: HAL
Language: English
Subfield: Literature and Literary Theory
Field: Arts and Humanities
Domain: Social Sciences
Open Access status: green
Funder: Agence Nationale de la Recherche
Award: PIQ
OpenAlex ID: W7207952637
