Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions evaluation/ocr/registers.csv
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
register,label,tetrak-hy v6 (ours)_chr,tetrak-hy v6 (ours)_wrd,hye-calfa-n_chr,hye-calfa-n_wrd,hye-paddle_chr,hye-paddle_wrd,marker_chr,marker_wrd,tesseract-hye_chr,tesseract-hye_wrd
totovents-works,"Totovents, Works",0.9868,0.9683,0.9844,0.9413,0.9849,0.9405,0.8142,0.8067,0.9383,0.7394
medical-encyclopedia,Medical encyclopedia,0.9646,0.9677,0.9753,0.8290,0.3025,0.9331,0.8882,0.9141,0.9730,0.8768
otyan-works,"Otyan, Works",0.9872,0.9647,0.9782,0.9291,0.9812,0.9343,0.9200,0.8372,0.9230,0.7270
baronian-vol10,"Baronian, Works",0.9863,0.9442,0.9817,0.9106,0.9834,0.9185,0.8639,0.7869,0.9425,0.7444
faustus-1968,Faustus of Byzantium (1968),0.9699,0.9163,0.9762,0.9138,0.9271,0.9222,0.9187,0.8602,0.9286,0.7157
tumanyan-elzh5,Tumanyan (academic edition),0.9558,0.9145,0.9503,0.9040,0.9697,0.9130,0.6584,0.7082,0.8887,0.7103
ase-vol2,Encyclopedia (ASE vol. 2),0.9703,0.9017,0.9600,0.8426,0.3342,0.8648,0.5262,0.8358,0.9456,0.7728
dictionary-hy-en,Dictionary (hy–en),0.8570,0.6883,0.4015,0.1092,0.4348,0.4574,0.6628,0.6781,0.3386,0.0462
mean,Mean over registers,0.9597,0.9082,0.9010,0.7974,0.7397,0.8605,0.7816,0.8034,0.8598,0.6666
register,label,tetrak-hy v7 (ours)_chr,tetrak-hy v7 (ours)_wrd,hye-calfa-n_chr,hye-calfa-n_wrd,marker_chr,marker_wrd,tesseract-hye_chr,tesseract-hye_wrd
totovents-works,"Totovents, Works",0.9871,0.9649,0.9844,0.9413,0.8143,0.8067,0.9383,0.7394
khrimian-works,"Khrimian, Works",0.9813,0.9576,0.9827,0.9383,0.9161,0.8884,0.9450,0.7983
medical-encyclopedia,Medical encyclopedia,0.9598,0.9513,0.9753,0.8290,0.8882,0.9141,0.9730,0.8768
otyan-works,"Otyan, Works",0.9854,0.9504,0.9782,0.9291,0.9200,0.8372,0.9229,0.7270
toranian-erkirner-ew-marder,"Toranian, Erkirner ew marder",0.9699,0.9386,0.9735,0.8380,0.9715,0.8858,0.9829,0.9014
baronian-vol10,"Baronian, Works",0.9857,0.9373,0.9817,0.9106,0.8638,0.7869,0.9425,0.7444
tumanyan-elzh5,Tumanyan (academic edition),0.9749,0.9366,0.9503,0.9040,0.6583,0.7082,0.8887,0.7129
aram-manukyan-documents,"Aram Manukyan, Documents",0.9576,0.9340,0.9598,0.9240,0.9421,0.9121,0.9335,0.8006
haykakan-tpagrutyun,Armenian printing (Teodik),0.9806,0.9269,0.9706,0.8937,0.7321,0.6753,0.8990,0.6368
ase-vol2,Encyclopedia (ASE vol. 2),0.9713,0.9109,0.9600,0.8426,0.5262,0.8358,0.9456,0.7728
kajaznuni-azg-ew-hayrenik,"Kajaznuni, Azg ew hayrenik",0.9743,0.9005,0.9569,0.8517,0.6658,0.5721,0.8773,0.6035
faustus-1968,Faustus of Byzantium (1968),0.9649,0.8979,0.9762,0.9138,0.9188,0.8602,0.9286,0.7157
baronian-azgayin-jojer,"Baronian, Azgayin jojer",0.9770,0.8880,0.9675,0.8528,0.7403,0.6847,0.8761,0.6112
aghbalyan-criticism,"Aghbalyan, Criticism",0.8963,0.8239,0.8630,0.8010,0.7711,0.6996,0.8004,0.5864
abovyan-vol1,"Abovyan, Works vol. 1",0.8999,0.7939,0.9199,0.8712,0.9028,0.8064,0.8320,0.6069
khatisian-memoirs,"Khatisian, Memoirs",0.9438,0.7616,0.9002,0.7476,0.7139,0.6167,0.7574,0.3874
dictionary-hy-en,Dictionary (hy–en),0.8234,0.6874,0.4008,0.1092,0.6628,0.6781,0.3386,0.0462
mean,Mean over registers,0.9549,0.8919,0.9236,0.8293,0.8005,0.7746,0.8695,0.6628
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ easyocr = ["easyocr>=1.7"]
# depends on easyocr itself, so this extra pulls that in too. 0.8 ships the
# v6 weights and the word list the backend decodes with (brief 013); the
# backend falls back to greedy decoding on older releases.
armenian = ["tetrak-easyocr-armenian>=0.11"]
armenian = ["tetrak-easyocr-armenian>=0.12"]
paddle = ["paddleocr>=3.0", "paddlepaddle>=3.0"]
# PaddleOCR-VL, the document vision-language model in the same package.
# The class lives in paddleocr, but the pipeline it builds needs paddlex's
Expand Down
75 changes: 46 additions & 29 deletions site/content/ocr/reference/engines.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,34 +94,46 @@ It has its own registry name rather than being folded into `easyocr`, for the
same reason `tesseract-auto` does: the harness scores backends, so the
difference between the two is a measurement instead of a claim.

Measured on eight evaluation registers — 65 proofread pages from seven
works on Armenian Wikisource plus ten from volume 2 of the Armenian Soviet
Encyclopedia, every page held out from training. The figures are means over
the eight registers; the per-register tables are in the
[latest comparison]({{< relref "/articles/2026/10/2026-10-02-beating-the-baselines.md" >}}):
Measured on seventeen evaluation registers — 155 proofread pages from
sixteen works on Armenian Wikisource plus ten from volume 2 of the Armenian
Soviet Encyclopedia, every page held out from training. Nine of the works
are in classical orthography, the spelling of the diaspora and of
everything printed before 1922. The figures are means over the seventeen
registers; the per-register tables of the earlier, eight-register
comparison are in the
[article on beating the baselines]({{< relref "/articles/2026/10/2026-10-02-beating-the-baselines.md" >}}):

{{< registers view="summary" >}}

The row labelled `tetrak-hy v6 (ours)` is `easyocr-hy` as it ships: the
recogniser, its word list, the script fold and the layout below. The table
names the recogniser rather than the backend, because the harness that
emits it scores models. Stock EasyOCR is absent because it was only ever
run on the encyclopedia pages (the 0.03 above), and the table admits only
engines measured on every register — the rule that keeps a column's mean
over the same pages as the column beside it.

Since v6, `easyocr-hy` leads both means, and leads both metrics on most
registers. It does not lead everywhere, and the exceptions have names:

The row labelled `tetrak-hy v7 (ours)` is `easyocr-hy` as it ships: the
recogniser, its two word lists, the script fold and the layout below. The
table names the recogniser rather than the backend, because the harness
that emits it scores models. Stock EasyOCR is absent because it was only
ever run on the encyclopedia pages (the 0.03 above), and Calfa's
`hye-paddle`, the strongest rival on the reformed-orthography registers,
has not yet been run on the classical ones; the table admits only engines
measured on every register — the rule that keeps a column's mean over the
same pages as the column beside it.

Since v7, `easyocr-hy` leads both means, and leads word recall on fifteen
of the seventeen registers. It does not lead everywhere, and the
exceptions have names:

- **Abovyan's collected works:** the one classical register where Calfa's
Tesseract model still reads more words.
- **Faustus of Byzantium:** the index and notes are set in a bold italic
whose digits the recogniser confuses.
- **Tumanyan's academic edition:** the apparatus quotes Russian, and the
recogniser has no Cyrillic. Its Armenian pages are level with the
leaders.
whose digits the recogniser confuses, and `hye-paddle` reads it better.
- **The medical encyclopedia, on character similarity:** EasyOCR's
detector draws no box around the en dash its index prints between each
term and its page number, so no recogniser behind it can read one.

v7 also reads the Russian that Soviet editions quote in their apparatus:
61 of the 81 Russian words on the Tumanyan pages, where v6, with no
Cyrillic in its charset, read none. On five of the eight registers v6 was
measured on it is a little behind v6 by word recall, by 0.003 to 0.018; the
trade was made knowingly for the classical registers, where it gains
between 0.04 and 0.10.

Calfa's two models are the strongest of the others. Both are CC BY-NC
4.0, so Tetrak can measure them but cannot ship or bundle either.
`easyocr-hy` can be shipped commercially: its code and weights are Apache
Expand All @@ -131,15 +143,20 @@ require.
Three steps sit between the raw recogniser and those figures, and none is
retraining:

- **A word list.** The recognition head has no language model. A word
whose reading is not in a list of Armenian words, built from proofread
Wikisource transcripts and the Nayiri Armenian Lexicon, takes the most
probable listed reading from the recogniser's own alternatives for it,
when that reading is nearly as probable.
- **A script fold.** Inside an Armenian word, the head can emit the
visually identical Latin twin of a character: `h` for `հ`, a colon for
the Armenian full stop `։`. The fold turns these back. Inside a number,
it also reads `Չ` and `շ` as the digit 2.
- **Two word lists.** The recognition head has no language model. A word
whose reading is in neither list, one built from the reformed-orthography
transcripts and one from the classical ones with the Nayiri Armenian
Lexicon, takes the most probable listed reading from the recogniser's own
alternatives for it, when that reading is nearly as probable. A spelling
in either list is accepted as written, so a classical page is never
"corrected" into reformed spelling or the reverse.
- **A script fold.** Every token is read in one script. Inside an Armenian
word, the head can emit the visually identical Latin or Cyrillic twin of
a character: `h` for `հ`, `о` for `օ`, a colon for the Armenian full
stop `։`. The fold turns these back; a token with no Armenian letter is
written in the one script, Latin or Cyrillic, it belongs to, decided by
the page around it when its own glyphs cannot say. Inside a number, it
also reads `Չ` and `շ` as the digit 2.
- **Reading order.** Output is serialised through `tetrak_ocr.layout`, a
recursive XY-cut that reads each column and band to its foot before
starting the next, and rejoins words a line break hyphenated. On the
Expand Down
4 changes: 2 additions & 2 deletions src/tetrak_ocr/backends/armenian.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
Latin or Cyrillic, it belongs to; a token made only of glyphs the two
share (`роог` for `poor`) is decided by the text around it, so each
region is folded with the whole page as `context`. That needs
`tetrak-easyocr-armenian` 0.9 or later; the extra pins 0.11, the release
with the three-way script decision.
`tetrak-easyocr-armenian` 0.9 or later; the extra pins 0.12, the release
that ships the v7 weights with both word lists.

**The word list.** Where the installed `tetrak-easyocr-armenian` has
released one, `tetrak_hy.lexicon` corrects out-of-vocabulary words from
Expand Down
8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading