# A Lattice-Based HMM Approach to Aruz Scansion of Ottoman Poetry

A lattice-based HMM scans Ottoman poetry from modern spelling without scholarly marks

Mehmet Emre Tiryaki · arXiv · 2026-11-9

- **Problem** Existing Ottoman scanners need scholarly spellings with diacritics, so they break on modern Turkish text that leaves those marks out. The rule-based scanner reads syllable weights directly from edition letters.
- **Method** The authors score every reading of a line against meter positions. A restorer proposes spellings, and an HMM over the meter picks the spelling, linking and flaws jointly across one lattice of candidate paths.
- **Results** The model fully scans 77.6% of 500 annotated test lines, compared with 63.6% for Claude Opus 5.5 few-shot and 26.8% for the rule-based scanner.

![Figure 5: Full-line accuracy on the test set, for the clean test poems, their web copy and OCR’d book at the measured deviation rates (§4), and the same at twi…](https://refivu.com/papers/81004ad8-5641-430f-b487-3d295b983eee/figures/figure-e0cb6d6eacccedffe2be11579635e3aa.png?thumb=512)

**Figure 5** : Full-line accuracy on the test set, for the clean test poems, their web copy and OCR’d book at the measured deviation rates (§4), and the same at twice every rate.

[Original paper](https://arxiv.org/abs/2611.12691v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Mehmet Emre Tiryaki · A Lattice-Based HMM Approach to Aruz Scansion of Ottoman Poetry · Original paper figure · Extracted the figure area from page 9 of the original PDF.

## Why modern spelling breaks existing scanners

The Arabic alphabet records the long vowels and consonants that the meter counts, but modern Turkish spelling leaves most of those marks out. A scanner that reads ordinary text therefore has to restore the weights from letters that no longer carry them. So the scanner shouldn't depend on scholarly marks even when they are present.

The only Ottoman scanner the authors know of is the one by Kurt and Kara (2012). It is a deterministic rule-based algorithm that runs on scholarly edition strings. It reads the syllable weights directly off the letters of the edition, so it can't be used on the modern spelling. This over-dependence on the edition makes the system prone to mistakes.

The authors therefore rebuild this baseline on restored spellings, so that it can run on plain text.

A second difficulty is that a line rarely fits its meter syllable by syllable. Aruz tolerates departures from the expected weights, called flaws (kusur), and which flaws a line takes depends on the meter of the poem. Because the meter isn't given, a single line admits many readings.

## Keeping readings open until the meter decides

The key idea is to keep every plausible reading of a line open and let a meter model choose among them. The Kurt and Kara scanner works differently, because it reads the syllable weights directly off the edition's letters.

The model starts with a restorer that proposes up to five scholarly spellings for each plain word, each with a probability. The restorer blends a lexicon of training spellings, weighted 0.5 on development data, with a joint letter 5-gram model. On development data the restorer gives the gold spelling for 93.5% of 113,195 words. The lattice then keeps every reading these spellings allow, including the linking and medd alternatives.

Each word's spelling choice is a prior, so the restorer score of a path is the product of its word probabilities.

The meter HMM takes the lattice as input and scores each path against the positions of a meter. Inserts and skips let the model absorb a misprint or a copy error without leaving the template. The model stays inside one template, because the chains are joined only at BOS and EOS. Flaws are not hard-coded, since the rate of each unusual label is learned from data, as the example of the long fourth position shows.

The authors reason that a reading fixed early would commit to choices the meter has not yet settled. So the scoring has to see every reading of a line at once, rather than one syllable at a time. This is why the restorer's spellings, the linking choices and the meter are scored together in one joint search.

## How a line becomes a scansion

Each line becomes a lattice whose nodes are the points between syllables and whose arcs are syllables. An overlong syllable gives two parallel paths, L then H for medd, or one O when no medd is taken, and a word-final consonant before a vowel gives either a linked LS or an unlinked K. With the Turkish and Arabic/Persian classes, this gives ten labels.

A path selects one spelling per word, along with a linking and medd choice where one exists, and its restorer prior is the product of the word probabilities. \\\[ \\Theta(\\pi)=\\prod\_{i=1}^{n} r(f\_i \\mid w\_i) \\\] The joint score of a path and a state sequence multiplies that prior by the transitions and emissions of the meter HMM, as in the equation below.

\\\[ p(\\pi,q)=\\Theta(\\pi)\\,A(\\mathrm{BOS},q\_1)\\prod\_t B(q\_t,\\sigma\_t)\\Big(\\prod\_{t\>1}A(q\_{t-1},q\_t)\\Big)A(q\_T,\\mathrm{EOS}) \\\] Here the labels of the path are the sigma terms, A holds the transition probabilities and B holds the emissions.

The meter HMM has a match state for each position of a template, with an insert state after each match state and a skip over each match state. Emissions are tied by the kind of state, so long, short and free positions each have their own distribution over the ten labels. The Viterbi path of each line under that meter then gives its scansion.

## Training without scansion labels

The model learns its probabilities by EM, with the printed meter as the only supervision. Each training line is first turned into a lattice, but from the edition's own spelling rather than a restored one. That leaves a single spelling per word, so only the linking and medd choices remain open. The Viterbi path of each line then gives its scansion under the meter that was printed.

EM runs over the emission and transition probabilities, with add-λ smoothing where λ = 0.1. Training stops when the likelihood per line stops improving. The authors observed that training everything at once made the K emission collapse. Skipping a position was cheaper than emitting K once skip transitions were available from the start. As a result, the kept-consonant label never gathered counts.

To avoid this, the authors train in two stages.

The experimental setup uses this trained model on the training split, tuned on the development split.

## Corpus, split and annotated test lines

The scores rest on a corpus of 52,000 lines drawn from thirteen critical editions of Divan poets, taken from LATOC. The split is by poet, so no poet's vocabulary or metrical habits appear in both training and evaluation. Training uses six poets with 1,644 poems and 18,282 lines, development uses four poets with 1,133 poems and 18,090 lines, and test uses three poets with 1,731 poems and 15,992 lines.

The inputs are the editions' transcriptions with their marks removed, so the systems see plain letters.

No scansion annotation existed publicly, so the authors built one for this paper with an ensemble of three language models. Claude Opus 5.5, ChatGPT 6 and Gemini 3.1 Pro annotated with medium thinking, given the scholarly transcription, the gold meter, a labeling guide and few-shot examples. The annotation covers the linking, the medd and the flaw labels, because the scholarly transliteration and the gold meter already largely determine the rest.

The authors annotated 500 test lines, as whole couplets with at most one per poem, and 100 development lines. Per-syllable agreement is high, with Cohen's κ of 0.959 to 0.978 pairwise and Fleiss' κ of 0.969 over the 450 of the 500 test lines that all three answered validly. Whole-line agreement is lower, at 66 to 79% pairwise. A line is accepted as gold when two or more valid answers agree, which covers 478 lines.

The author, who reads aruz, decided the remaining 22 lines by hand. The author audited 200 settled lines, stratified by agreement and by the rare flaws, and accepted 95.5% of them (95% CI 93.0 to 98.0). Claude Opus 5.5 was one of the three annotators, which matters when it is later scored as a system.

## Main comparison on the annotated test lines

On the 500 annotated test lines, the model reads 77.6% of lines fully correctly, against 63.6% for Claude Opus 5.5. That is a gap of +14.0 points, with p below 0.001 and a 95% CI of +9.4 to +18.6. The authors ran an exact McNemar test over the 500 test lines, counting only the lines where the two systems disagree. The BiLSTM tagger averages 55.0% over five seeds, and it sits below the model on every seed.

DeepSeek V4.1 Flash reads 40.0% of lines, so the tagger also beats that language model on average.

![Table 2: Test results on plain Turkish letters with no meter given. Task 1: meter accuracy per poem and per line, on all test poems. Task 2: full-line accuracy…](https://refivu.com/papers/81004ad8-5641-430f-b487-3d295b983eee/figures/figure-1ce711c2d4bd070c74c39cf5fb3a2cf6.png?thumb=512)

**Table 2** : Test results on plain Turkish letters with no meter given. Task 1: meter accuracy per poem and per line, on all test poems. Task 2: full-line accuracy (full), pooled flaw F1 and syllable F1, on the 500 annotated test lines. The tagger is the mean of five seeds. A language model answers once per poem and has no per-line meter.

[Original paper](https://arxiv.org/abs/2611.12691v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

The rule-based scanner reads 26.8% of lines when it runs on restored spellings. On plain letters, the same algorithm falls to 2.4%, because every long vowel becomes an open syllable in a long position. Flaw F1 ranks the systems in the same order as full-line accuracy. The authors read the gap as showing that meter identification is the easier half of the work.

Scansion, with its per-syllable alignment and flaw labels, is the real task they target.

The model is generative, so it gives a probability for every decision, including the posterior of a reading under the meter. Ablations in Table 3 then test which parts of the model produce this gain. Removing the HMM, the restorer's probabilities, or the O and K labels each costs the model more than half of its fully read lines. The authors conclude that the gain comes from deciding the spelling, the scoring under the meter and the flaw labels together.

## Which parts carry the gain

Removing the HMM leaves the fewest-flaw rule of Kurt & Kara to choose among the restorer's five candidates over the same lattice. That change reads 44.2 points fewer lines than the full model. Removing the restorer's probabilities, so candidates enter the lattice with a flat prior, costs 49.2 points. Removing the O and K labels costs 42.4 points, because no medd and no linking are then emitted as plain closed syllables.

Each of these leaves less than half of the fully read lines, so the authors treat each part as necessary. They read the gain as coming from deciding the spelling, the meter scoring and the flaw labels together.

Replacing the restorer with the training lexicon, with no restorer at all, costs 40.0 points. That result shows that the restorer's generalization to unseen words matters for the model.

Giving the model the edition's scholarly transcription instead of plain letters raises full-line accuracy to 90.6%. Of the 22.4 points of error on plain letters, 13.0 come from spelling and 9.4 from linking, medd and the flaw labels. The 9.4 points remain even when the spelling is given, so the scansion rules themselves cause part of the error.

The error analysis counts each wrong line once, under its first difference from the reference in a fixed order. The flaw-label category can only affect the large language models, because the label follows from the form and position for other systems. The authors conclude that joint decoding of spelling, linking and position is critical for this task.

They didn't test a fully pipelined alternative beyond the fixed-first ablations shown here. The limitations note that a wider, multiply hand-annotated test set would help further error analysis.

## Noisy copies and the warning detector

Accuracy on copies a user might paste drops, and the authors measured it with a robustness benchmark built from real copies. The benchmark applies observed edits to clean lines at their measured rates, and the web copy and OCR'd book each reach the measured severity. Two more versions at twice every rate are also generated, while the reference scansion stays unchanged.

Full-line accuracy of our model falls by 18% on a web copy and 33% on an OCR'd book, relative to its clean test score. Per-line meter accuracy stays at 91 to 95% on both copies, because the meter is decided from the whole poem.

Figure 5 shows the full-line accuracy of each system on the clean poems, the two copies, and the doubled rates. Without the insert and skip states, the model falls below comparable models for some perturbations. The authors take this as the reason the insert and skip states are needed for robustness. Even before the rates are doubled, performance falls to levels the authors don't consider suitable for real-world use.

Modernized spelling alone, such as meni to beni, costs 6 to 14 points although it changes no weight. That cost arises because the restorer hasn't seen a modernized word, so the restorer matters here too.

The model's score also indicates how well a line fits its meter, so it can flag lines that a copy has corrupted. Its threshold is set on clean development lines at 5% false alarms. At that threshold, it catches 42% of the faulty web lines at 51% precision. On the OCR'd book it catches 54% of the faulty lines at 66% precision. Table 8 reports the detector on each noisy input, including the AUROC of 0.714 for web and 0.774 for OCR.

## What the learned flaw rates and errors show

The model's 112 wrong lines are mostly vowel lengths and linkings, not spellings. Vowel lengths account for 63 of them and linkings for 30. Spellings account for 17 of them and medd for 2. The wrong vowel lengths come from restorer errors that the meter could not overrule, because both readings fit a position.

The model learned a low emission rate for K, the label of a word-final consonant left unlinked before a vowel.

The other learned rates match the poets' practice as described in Appendix B. Zihaf is rare, at 0.04% and 1.1% of syllables in short positions. They learned these rates from the data alone, without annotation of flaws.

The main limit of this result is the scope of the flaw evidence. The model's errors also depend on the robustness setting, since noisy copies lower its full-line accuracy. Its per-line meter accuracy stays at 91 to 95% on those copies. The authors note that a wider test set annotated by multiple experts would help further error analysis.

## Limitations of the annotation, inventory and benchmark

The scansion annotations come from an ensemble of large language models working under a written guide, not from multiple hand annotators. The authors measured agreement across the annotators and hand-checked 200 lines. They say a wider test set, hand annotated by multiple experts, would help further error analysis and produce more robust models.

The meter inventory covers fourteen meters, so 124 of the 1,731 test poems fall outside it. Those 124 poems aren't scored, and the model doesn't report when a poem fits no meter. The inventory has 17 templates, and 1,511 of the 1,644 training poems are in it.

The benchmark is released as a pipeline instead of a full dataset, because the editions of the poems are protected. The copies themselves come from 33 web pages and 6 OCR'd books, so the measured rates rest on a small survey.

## Paper info

- **Authors**: Mehmet Emre Tiryaki
- **Venue**: arXiv · Preprint
- **First published**: 2026-11-9
- **Added**: 2026-11-11
- **Updated**: 2026-11-9
- **Version**: v1
- **arXiv**: 2611.12691
- **Category**: cs.CL
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2611.12691v1) · [PDF ↗](https://arxiv.org/pdf/2611.12691v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

Ottoman Divan poetry is composed in aruz, a quantitative meter based on the weights of syllables. The meter is sensitive to specific characters recorded in the original writing in the Arabic script. This work is concerned with automatic meter finding and scansion alignment for Ottoman Divan poetry, especially on modern Turkish spelling without the special diacritics that scholarly transliterations of Ottoman preserve. We define two tasks on this input, first identifying the meter used in the poem, and second aligning the meter's weights with the syllabification of the poem, identifying the flaws and freedoms the poet has taken along the way. We build a corpus of 52,000 lines split by poet, with scansion annotations for 500 test lines, and a robustness benchmark generated at the deviation rates measured on real web and OCR copies. Our model is a hidden Markov model over the positions of each meter, decoded over a lattice of every candidate path, and trained by EM from the printed meter, without scansion labels. On a held-out set it scans 77.6% of the test lines fully correctly, against 26.8% for the available rule-based scanner, 55.0% for a neural tagger trained with the same supervision and 63.6% for Claude Opus 5.5 few-shot. The code is open-sourced and the tool is released on the web.

## Quote from the paper

Mehmet Emre Tiryaki (2026). A Lattice-Based HMM Approach to Aruz Scansion of Ottoman Poetry. arXiv:2611.12691v1. https://arxiv.org/abs/2611.12691v1

**BibTeX**

```
@misc{tiryaki2026lattice,
  title = {{A Lattice-Based HMM Approach to Aruz Scansion of Ottoman Poetry}},
  author = {Mehmet Emre Tiryaki},
  year = {2026},
  eprint = {2611.12691},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.12691v1}
}
```

## Other paper commentary

- [A Large-Scale Dataset for Cross-Lingual Multi-Jurisdiction Patent Drafting from Patent Cooperation Treaty Applications](https://refivu.com/en/papers/5da56620-dd4e-4ab2-b4cf-3eeb73bf7ec4-a-large-scale-dataset-for-cross-lingual-multi.md)
- [Language processing in the autistic brain: A meta-analysis of neuroimaging studies across modalities and age](https://refivu.com/en/papers/f3e93a2c-c934-46c5-a3c7-db0f41ecb61e-language-processing-in-the-autistic-brain-a-meta.md)
- [Vietnamese Legal Ontology: Every legal answer, traced to the article that grounds it](https://refivu.com/en/papers/39e9b155-49f6-418a-8ba0-f2d1078d32ea-vietnamese-legal-ontology-every-legal-answer-traced-to.md)
- [Generating Diverse and Verified Synthetic Clinical Notes with Labels by Construction](https://refivu.com/en/papers/38221292-a102-4bbf-b6a9-96262c2a9e40-generating-diverse-and-verified-synthetic-clinical-notes.md)
- [Gendered Misclassification from Surname-Based Race Imputation](https://refivu.com/en/papers/0fca607c-6566-4aa3-a93d-57d2e54268c9-gendered-misclassification-from-surname-based-race.md)
- [Natural TTS Synthesis by Conditioning WaveNet on Mel Spectrogram Predictions](https://refivu.com/en/papers/596b5353-6c04-4ada-a92e-25d0fee13147-natural-tts-synthesis-by-conditioning-wavenet-on-mel.md)
- [Graph-Guided Bayesian Factor Analysis: A Fast Integrated EFA-CFA Approach for High-Dimensional Data](https://refivu.com/en/papers/5d2d391c-7613-40f5-b05b-d69ca40d0041-graph-guided-bayesian-factor-analysis-a-fast-integrated.md)
- [WanderBench: Can World Models Explore Dynamic Worlds from Video?](https://refivu.com/en/papers/7abb23d2-6e66-4d6d-975e-edf2604d3c4d-wanderbench-can-world-models-explore-dynamic-worlds-from.md)
- [Adaptive Quantization Preserves Fast Rates for TD Learning over Rate-Limited Channels](https://refivu.com/en/papers/d58bc294-7861-4c11-8973-582df8ea5981-adaptive-quantization-preserves-fast-rates-for-td-learning.md)
- [CoilStellaration: A Dataset and Benchmark for Engineering-Aware Stellarator Coilset Generation](https://refivu.com/en/papers/0405ed6f-3f59-46c6-8c28-0db38f55746a-coilstellaration-a-dataset-and-benchmark-for-engineering.md)
- [Is Persona Generalization Predictable?](https://refivu.com/en/papers/ae408b05-af42-4e04-bc37-7a735a9a0b4d-is-persona-generalization-predictable.md)
- [Unmasking Four Knapsack Problems in the Traveling Thief Benchmark](https://refivu.com/en/papers/bd6d2d1c-f59b-4859-83a3-ecdec9dda2f7-unmasking-four-knapsack-problems-in-the-traveling-thief.md)

## Terms in this paper

- [EM](https://refivu.com/en/terms/874857dd724e-em)
- [test set](https://refivu.com/en/terms/27c65cde384f-test-set)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/81004ad8-5641-430f-b487-3d295b983eee-a-lattice-based-hmm-approach-to-aruz-scansion)
