From 0926917d3613d1d0a9974e75bd98775f4ca51388 Mon Sep 17 00:00:00 2001 From: Stephen Masters Date: Wed, 18 Nov 2026 12:16:48 +0000 Subject: [PATCH] feat(armenian): read with v8, v7 fine-tuned on italic books Brief 023 Stage 4. The [armenian] extra's floor moves to tetrak-easyocr-armenian 0.13, which ships the v8 weights. - registers.csv is regenerated from v8's readings of the seventeen registers. Mean word recall goes 0.895 to 0.906; Khatisian's memoirs 0.762 to 0.838. - The engines page says what v8 leads and what it does not: twelve registers, level on one, behind Calfa's hye-paddle on four. - It also records the cost: 53 of the 81 Russian words on the Tumanyan pages are read where v7 read 61. The released library was checked against the cached readings on three pages: identical span for span. Co-authored-by: Yvette Mankerian Co-Authored-By: Claude Fable 5.2 --- evaluation/ocr/registers.csv | 38 +++++++++++----------- pyproject.toml | 5 +-- site/content/ocr/reference/engines.md | 46 +++++++++++++++------------ uv.lock | 8 ++--- 4 files changed, 51 insertions(+), 46 deletions(-) diff --git a/evaluation/ocr/registers.csv b/evaluation/ocr/registers.csv index cc79cce..3d3e158 100644 --- a/evaluation/ocr/registers.csv +++ b/evaluation/ocr/registers.csv @@ -1,19 +1,19 @@ -register,label,tetrak-hy v7 (ours)_chr,tetrak-hy v7 (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.9871,0.9649,0.9844,0.9413,0.9849,0.9405,0.8143,0.8067,0.9383,0.7394 -khrimian-works,"Khrimian, Works",0.9813,0.9576,0.9827,0.9383,0.9849,0.9431,0.9161,0.8884,0.9450,0.7983 -medical-encyclopedia,Medical encyclopedia,0.9533,0.9558,0.9753,0.8290,0.3025,0.9331,0.8882,0.9141,0.9730,0.8768 -otyan-works,"Otyan, Works",0.9854,0.9504,0.9782,0.9291,0.9812,0.9343,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.9839,0.9095,0.9715,0.8858,0.9829,0.9014 -baronian-vol10,"Baronian, Works",0.9857,0.9373,0.9817,0.9106,0.9834,0.9185,0.8638,0.7869,0.9425,0.7444 -tumanyan-elzh5,Tumanyan (academic edition),0.9749,0.9366,0.9503,0.9040,0.9697,0.9130,0.6583,0.7082,0.8887,0.7129 -aram-manukyan-documents,"Aram Manukyan, Documents",0.9576,0.9340,0.9598,0.9240,0.9629,0.9407,0.9421,0.9121,0.9335,0.8006 -haykakan-tpagrutyun,Armenian printing (Teodik),0.9806,0.9269,0.9706,0.8937,0.9763,0.8991,0.7321,0.6753,0.8990,0.6368 -ase-vol2,Encyclopedia (ASE vol. 2),0.9751,0.9170,0.9600,0.8426,0.3342,0.8648,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.9763,0.8857,0.6658,0.5721,0.8773,0.6035 -faustus-1968,Faustus of Byzantium (1968),0.9649,0.8979,0.9762,0.9138,0.9271,0.9222,0.9188,0.8602,0.9286,0.7157 -baronian-azgayin-jojer,"Baronian, Azgayin jojer",0.9770,0.8880,0.9675,0.8528,0.9806,0.8936,0.7403,0.6847,0.8761,0.6112 -abovyan-vol1,"Abovyan, Works vol. 1",0.9208,0.8346,0.9199,0.8712,0.9456,0.9096,0.9028,0.8064,0.8320,0.6069 -aghbalyan-criticism,"Aghbalyan, Criticism",0.8963,0.8239,0.8630,0.8010,0.8962,0.8456,0.7711,0.6996,0.8004,0.5864 -khatisian-memoirs,"Khatisian, Memoirs",0.9438,0.7616,0.9002,0.7476,0.9782,0.8564,0.7139,0.6167,0.7574,0.3874 -dictionary-hy-en,Dictionary (hy–en),0.8234,0.6874,0.4008,0.1092,0.4348,0.4574,0.6628,0.6781,0.3386,0.0462 -mean,Mean over registers,0.9560,0.8949,0.9236,0.8293,0.8590,0.8804,0.8005,0.7746,0.8695,0.6628 +register,label,tetrak-hy v8 (ours)_chr,tetrak-hy v8 (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.9882,0.9687,0.9844,0.9413,0.9849,0.9405,0.8143,0.8067,0.9383,0.7394 +medical-encyclopedia,Medical encyclopedia,0.9548,0.9602,0.9753,0.8290,0.3025,0.9331,0.8882,0.9141,0.9730,0.8768 +khrimian-works,"Khrimian, Works",0.9827,0.9581,0.9827,0.9383,0.9849,0.9431,0.9161,0.8884,0.9450,0.7983 +otyan-works,"Otyan, Works",0.9866,0.9575,0.9782,0.9291,0.9812,0.9343,0.9200,0.8372,0.9229,0.7270 +baronian-vol10,"Baronian, Works",0.9868,0.9450,0.9817,0.9106,0.9834,0.9185,0.8638,0.7869,0.9425,0.7444 +toranian-erkirner-ew-marder,"Toranian, Erkirner ew marder",0.9708,0.9432,0.9735,0.8380,0.9839,0.9095,0.9715,0.8858,0.9829,0.9014 +aram-manukyan-documents,"Aram Manukyan, Documents",0.9607,0.9413,0.9598,0.9240,0.9629,0.9407,0.9421,0.9121,0.9335,0.8006 +tumanyan-elzh5,Tumanyan (academic edition),0.9758,0.9346,0.9503,0.9040,0.9697,0.9130,0.6583,0.7082,0.8887,0.7129 +haykakan-tpagrutyun,Armenian printing (Teodik),0.9818,0.9327,0.9706,0.8937,0.9763,0.8991,0.7321,0.6753,0.8990,0.6368 +faustus-1968,Faustus of Byzantium (1968),0.9703,0.9137,0.9762,0.9138,0.9271,0.9222,0.9188,0.8602,0.9286,0.7157 +kajaznuni-azg-ew-hayrenik,"Kajaznuni, Azg ew hayrenik",0.9778,0.9109,0.9569,0.8517,0.9763,0.8857,0.6658,0.5721,0.8773,0.6035 +ase-vol2,Encyclopedia (ASE vol. 2),0.9745,0.9095,0.9600,0.8426,0.3342,0.8648,0.5262,0.8358,0.9456,0.7728 +baronian-azgayin-jojer,"Baronian, Azgayin jojer",0.9828,0.9008,0.9675,0.8528,0.9806,0.8936,0.7403,0.6847,0.8761,0.6112 +abovyan-vol1,"Abovyan, Works vol. 1",0.9296,0.8558,0.9199,0.8712,0.9456,0.9096,0.9028,0.8064,0.8320,0.6069 +khatisian-memoirs,"Khatisian, Memoirs",0.9658,0.8383,0.9002,0.7476,0.9782,0.8564,0.7139,0.6167,0.7574,0.3874 +aghbalyan-criticism,"Aghbalyan, Criticism",0.8979,0.8242,0.8630,0.8010,0.8962,0.8456,0.7711,0.6996,0.8004,0.5864 +dictionary-hy-en,Dictionary (hy–en),0.8386,0.7078,0.4008,0.1092,0.4348,0.4574,0.6628,0.6781,0.3386,0.0462 +mean,Mean over registers,0.9603,0.9060,0.9236,0.8293,0.8590,0.8804,0.8005,0.7746,0.8695,0.6628 diff --git a/pyproject.toml b/pyproject.toml index e634224..4191cf8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,8 +65,9 @@ easyocr = ["easyocr>=1.7"] # The project's own Armenian recogniser, as an EasyOCR custom network. It # 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.12"] +# backend falls back to greedy decoding on older releases. 0.13 ships v8, +# v7 fine-tuned on books set in italics (brief 023). +armenian = ["tetrak-easyocr-armenian>=0.13"] # 3.7 is the first release whose PaddleX registers the PP-OCRv6 recognisers # that custom models such as Calfa's paddle-calfa-tiny are exported as; an # older paddleocr fails at construction with "`PP-OCRv6_tiny_rec` is not diff --git a/site/content/ocr/reference/engines.md b/site/content/ocr/reference/engines.md index 8bc5703..c83dde0 100644 --- a/site/content/ocr/reference/engines.md +++ b/site/content/ocr/reference/engines.md @@ -105,7 +105,7 @@ comparison are in the {{< registers view="summary" >}} -The row labelled `tetrak-hy v7 (ours)` is `easyocr-hy` as it ships: the +The row labelled `tetrak-hy v8 (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 @@ -113,21 +113,23 @@ ever run on the encyclopedia pages (the 0.03 above); 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 eleven -of the seventeen registers. The other six go to Calfa's `hye-paddle`, and -five of them are classical: - -- **Khatisian's memoirs and Abovyan's collected works:** `hye-paddle` is - well ahead on both, by 0.10 and 0.08 of word recall. Khatisian is set in - a heavy cursive italic the recogniser has seen little of; Abovyan is a - faint grey photograph, and was 0.04 further behind before the pipeline - began stretching such pages (below). These are the registers to study - before the next run. -- **Aghbalyan's criticism, Aram Manukyan's documents and Baronian's - *Azgayin jojer*:** `hye-paddle` ahead by between 0.006 and 0.02, within - the run-to-run noise on the last two. +Since v7, `easyocr-hy` leads both means. With v8, which is v7 fine-tuned +on crops from three books set in italics, it leads word recall on twelve +of the seventeen registers and is level with Calfa's `hye-paddle` on a +thirteenth, Aram Manukyan's documents. The other four go to `hye-paddle`: + +- **Abovyan's collected works:** `hye-paddle` is well ahead, by 0.05 of + word recall. The evaluation pages are Grabar verse set in a light + italic and photographed faint, some of them out of focus. The gap was + 0.12 before the pipeline began stretching such pages (below) and before + v8. This is the register to study before the next run. +- **Khatisian's memoirs:** set from cover to cover in a heavy cursive + italic. v7 had seen little of it and was 0.10 behind; v8 was trained on + crops from the rest of the book and is 0.02 behind. +- **Aghbalyan's criticism:** `hye-paddle` ahead by 0.02. - **Faustus of Byzantium:** the index and notes are set in a bold italic - whose digits the recogniser confuses, and `hye-paddle` reads it better. + whose digits the recogniser confuses, and `hye-paddle` reads it a + little 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. @@ -137,12 +139,14 @@ recall because the metric is order-sensitive: on the dictionary and the encyclopedias its stock detector reads multi-column pages partly straight across, and the characters are right in the wrong order. -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. +The recogniser also reads the Russian that Soviet editions quote in their +apparatus. v8 reads 53 of the 81 Russian words on the Tumanyan pages, +where v7 read 61 and v6, with no Cyrillic in its charset, read none: the +italic crops v8 was fine-tuned on carry almost no Russian, and the +fine-tune cost eight words. On three of the eight registers v6 was +measured on, v8 is still a little behind v6 by word recall, by 0.003 to +0.008, where v7 was behind on five; the trade was made knowingly for the +classical registers. 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. diff --git a/uv.lock b/uv.lock index b3fe1ee..604ad5e 100644 --- a/uv.lock +++ b/uv.lock @@ -5254,7 +5254,7 @@ requires-dist = [ { name = "sillybos", specifier = ">=6.0.3,<7" }, { name = "sphinx", marker = "extra == 'apidocs'", specifier = ">=8.0" }, { name = "sphinx-argparse", marker = "extra == 'apidocs'", specifier = ">=0.6.1" }, - { name = "tetrak-easyocr-armenian", marker = "extra == 'armenian'", specifier = ">=0.12" }, + { name = "tetrak-easyocr-armenian", marker = "extra == 'armenian'", specifier = ">=0.13" }, { name = "torch", marker = "extra == 'all'", specifier = ">=2.0" }, { name = "torch", marker = "extra == 'ocr'", specifier = ">=2.0" }, { name = "torch", marker = "extra == 'qa'", specifier = ">=2.0" }, @@ -5266,15 +5266,15 @@ provides-extras = ["all", "apidocs", "armenian", "claude", "dev", "docs", "easyo [[package]] name = "tetrak-easyocr-armenian" -version = "0.12.0" +version = "0.13.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "easyocr" }, { name = "requests" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/70/ab/26350e707f16b9df9cab234231e940db5e5afd3b0a2955978820091430ff/tetrak_easyocr_armenian-0.12.0.tar.gz", hash = "sha256:da72ba56035ca08ddf79a6c4f5d03b423dc4c64d9ac649f24a4fb9a62d6b7813", size = 170478, upload-time = "2026-11-16T14:01:53.693Z" } +sdist = { url = "https://files.pythonhosted.org/packages/0b/c1/5caac07972e196552bdce9c39b6896a22717ebd69a7aab0438b62336e95b/tetrak_easyocr_armenian-0.13.0.tar.gz", hash = "sha256:61e6337137817ae7f698271c2ed05cbe0062ab1887da87fb8fc21276fa8af4ce", size = 170845, upload-time = "2026-11-18T12:04:43.908Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/f6/34/c7e922cffd29a31d66055fc321b7323914ece6575be109fc9cff44f1a35f/tetrak_easyocr_armenian-0.12.0-py3-none-any.whl", hash = "sha256:880746de1c1e507aafc3f185b911b63dee87ecde4d598210ba2fe4f13e9569f8", size = 29689, upload-time = "2026-11-16T14:01:52.246Z" }, + { url = "https://files.pythonhosted.org/packages/33/8d/868ff5086b356ee643979f9b0bf613dd5bd9a5e55700ce4865dd276f369a/tetrak_easyocr_armenian-0.13.0-py3-none-any.whl", hash = "sha256:716edc6cd52fb0340fea330918b2f42177ddae6e759c9b3e5f34f5941671f1e9", size = 29908, upload-time = "2026-11-18T12:04:42.607Z" }, ] [[package]]