Claude commited on
Commit
781cbe9
·
unverified ·
1 Parent(s): d40d01e

docs(readme): recadrer Picarones comme banc d'essai d'IA sur golden datasets

Browse files

L'intro précédente présentait Picarones comme un outil pour évaluer un
corpus ALTO existant — *« an institution that already has a corpus in
ALTO XML and wants to evaluate post-correction strategies »*. Cadrage
faux : sans vérité terrain, aucune métrique ne peut être calculée. Le
produit n'évalue pas un corpus de production, il évalue une IA sur des
golden datasets dont le profil ressemble au corpus de production.

Réécriture des 124 premières lignes (sous-titres bilingues + intro EN +
intro FR + cas d'usage EN + cas d'usage FR) avec trois contrats
explicites :

1. **Contrat d'entrée** — paires (image, vérité terrain) : texte brut
(.gt.txt), ALTO XML, ou PAGE XML, annotées à la main.
2. **Contrat d'évaluation** — chaque métrique est calculée contre la
GT de la paire en entrée. Un benchmark sur un corpus sans GT est
impossible par design.
3. **Contrat de décision** — le chercheur constitue un golden dataset
représentatif de son corpus de production cible, benchmarke ses IA
candidates dessus, lit les chiffres factuels et décide quelle IA
passer en prod sur le vrai corpus (non annoté).

Mention explicite que **chaque chercheur amène son propre dataset** :
Picarones ne maintient pas (encore) de bibliothèque curatée de golden
datasets standards. Les importers (IIIF, Gallica, HuggingFace,
HTR-United, eScriptorium, ZIP) aident à récupérer / ingérer des
datasets existants ; le choix et la curation restent à la charge du
chercheur.

Cas d'usage type recadré (EN + FR) : registres paroissiaux XVIIᵉ,
presse XIXᵉ, manuscrits glosés médiévaux comme exemples de corpus
cibles ; chacun nécessite un golden dataset matching pour évaluer les
IA candidates avant déploiement en prod.

Aucun changement de code. Le reste du README (Features, Quick Start,
Installation, Usage…) restait factuel et n'a pas été touché.

https://claude.ai/code/session_01Hsd7kL8yeCbXn1mA7GQK9L

Files changed (1) hide show
  1. README.md +135 -58
README.md CHANGED
@@ -9,9 +9,9 @@ pinned: false
9
 
10
  # Picarones
11
 
12
- > **OCR Post-Correction Benchmarking Platform for Existing ALTO XML Corpora**
13
 
14
- > **Plateforme d'évaluation de pipelines de post-correction OCR sur corpus ALTO XML**
15
 
16
  [![CI](https://github.com/maribakulj/Picarones/actions/workflows/ci.yml/badge.svg)](https://github.com/maribakulj/Picarones/actions/workflows/ci.yml)
17
  [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
@@ -20,17 +20,48 @@ pinned: false
20
 
21
  ---
22
 
23
- **Picarones** is an open-source platform designed for an **institutional
24
- context** heritage services, archives, digital libraries that already
25
- have a **corpus in ALTO XML** (output of a prior OCR pipeline) and want
26
- to **rigorously evaluate** post-correction strategies: alternative re-OCR,
27
- LLM correction, specialised ALTO mappers, ensemble voting, etc.
28
 
29
- This is a **benchmarking platform, not a production workshop**. Picarones
30
- loads an existing ALTO corpus, runs the pipelines the researcher brings,
31
- measures every relevant metric, and produces a self-contained HTML report
32
- that is **factual and reproducible**. No prescriptions, no automatic
33
- verdicts: the report shows the numbers, the researcher decides.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  Heritage-specific metrics (diplomatic CER, ligature and diacritic scores,
36
  medieval abbreviations, Roman numerals, foliation, fuzzy full-text
@@ -38,9 +69,7 @@ searchability, philological marker fidelity), composable pipelines, a
38
  **factual narrative synthesis** at the top of the report, **multi-engine
39
  Friedman/Nemenyi significance tests** with a **critical difference
40
  diagram**, **cost / speed / CO₂ Pareto analysis**, **per-junction error
41
- absorption**, **multi-run stability**, **controlled per-slot comparison**,
42
- and several corpus import sources (IIIF, HuggingFace, HTR-United,
43
- eScriptorium, ZIP upload).
44
 
45
  > *Version française ci-dessous.*
46
 
@@ -48,14 +77,18 @@ eScriptorium, ZIP upload).
48
 
49
  ## Use case
50
 
51
- An institution (archive, digital library, heritage service) has **already
52
- OCR'd** a corpus of several thousand pagesoutput in **ALTO XML** with
53
- zone, line and word coordinates. The output has a decent but imperfect
54
- CER, with the typical defects on historical ligatures, unexpanded
55
- abbreviations and badly recognised proper names.
 
56
 
57
- The institution wants to **rigorously compare** several post-correction
58
- strategies on that existing corpus:
 
 
 
59
 
60
  - alternative re-OCR (Pero OCR, Kraken, Mistral OCR…);
61
  - LLM correction (GPT-4o, Claude, Mistral) in text-only or image+text mode;
@@ -63,29 +96,66 @@ strategies on that existing corpus:
63
  diplomatic normalisation);
64
  - composed pipelines: alternative OCR → LLM correction → ALTO mapper.
65
 
66
- Picarones loads the ALTO corpus, runs each pipeline, measures the
67
- relevant metrics (CER gain, recovered fuzzy searchability, preserved
68
- numerical sequences, **errors introduced by the post-corrector**
69
- critical for LLMs that silently modernise) and produces a factual HTML
70
- report that is **directly citable in a scientific publication**: every
71
- number is traceable to its source payload, no prescription imposed.
 
 
 
 
72
 
73
  ---
74
 
75
  ## En français
76
 
77
- **Picarones** est une plateforme open source conçue pour un **contexte
78
- institutionnel** services patrimoniaux, archives, bibliothèques numériques
79
- qui disposent déjà d'un **corpus en XML ALTO** (issu d'une chaîne d'OCR
80
- historique) et qui veulent **évaluer rigoureusement** des pipelines de
81
- **post-correction** : re-OCR alternatif, correction LLM, mappeurs ALTO
82
- spécialisés, voting d'ensembles, etc.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
- C'est un **banc d'essai, pas un atelier de production**. Picarones charge un
85
- corpus ALTO existant, exécute les pipelines que le chercheur amène, mesure
86
- toutes les métriques pertinentes et produit un rapport HTML autonome
87
- **factuel et reproductible**. Pas de prescription, pas de classement
88
- automatique imposé : le rapport expose les chiffres, le chercheur arbitre.
89
 
90
  Métriques spécifiques aux corpus patrimoniaux (CER diplomatique, scores de
91
  ligatures, abréviations médiévales, numéraux romains, foliotation,
@@ -93,21 +163,24 @@ recherchabilité fuzzy plein-texte, fidélité aux marqueurs philologiques),
93
  pipelines composables, **synthèse narrative factuelle** au sommet du rapport,
94
  **tests Friedman/Nemenyi multi-moteurs** avec **diagramme de différence
95
  critique**, analyse **Pareto coût/vitesse/CO₂**, **absorption d'erreur par
96
- jonction**, **stabilité multi-runs**, **comparaison contrôlée par slot**, et
97
- plusieurs sources d'import (IIIF, HuggingFace, HTR-United, eScriptorium,
98
- upload ZIP).
99
 
100
  ### Cas d'usage type
101
 
102
- Une institution (archive, bibliothèque numérique, service patrimonial) a
103
- **déjà OCRisé** un corpus de plusieurs milliers de pagessortie au format
104
- **ALTO XML** avec coordonnées de zones, lignes et mots. Cette sortie a un
105
- CER honorable mais imparfait, des erreurs typiques sur les ligatures
106
- historiques, des abréviations non développées, des noms propres mal
107
- reconnus.
108
-
109
- L'institution veut **comparer rigoureusement** plusieurs stratégies de
110
- post-correction sur ce corpus existant :
 
 
 
 
 
111
 
112
  - ré-OCR avec un moteur alternatif (Pero OCR, Kraken, Mistral OCR…) ;
113
  - correction LLM (GPT-4o, Claude, Mistral) en mode texte seul ou image+texte ;
@@ -115,13 +188,17 @@ post-correction sur ce corpus existant :
115
  abréviations, normalisation diplomatique) ;
116
  - pipelines composées : OCR alternatif → correction LLM → mappeur ALTO.
117
 
118
- Picarones charge le corpus ALTO, exécute chaque pipeline, mesure les
119
- métriques pertinentes (gain CER, recherchabilité fuzzy gagnée, séquences
120
- numériques préservées, **erreurs introduites par le post-correcteur** —
121
- critique pour les LLM qui modernisent silencieusement) et produit un
122
- rapport HTML factuel **directement citable dans une publication
123
- scientifique** : chaque chiffre est traçable au payload source, aucune
124
- prescription n'est imposée.
 
 
 
 
125
 
126
  ---
127
 
 
9
 
10
  # Picarones
11
 
12
+ > **Heritage OCR / HTR / VLM and post-correction benchmarking bring your golden dataset, plug in the AIs.**
13
 
14
+ > **Banc d'essai d'OCR / HTR / VLM et de post-correction pour documents patrimoniaux amenez votre golden dataset, branchez vos IA.**
15
 
16
  [![CI](https://github.com/maribakulj/Picarones/actions/workflows/ci.yml/badge.svg)](https://github.com/maribakulj/Picarones/actions/workflows/ci.yml)
17
  [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
 
20
 
21
  ---
22
 
23
+ **Picarones** is an open-source benchmarking platform for OCR, HTR, VLM and
24
+ post-correction pipelines on heritage documents.
 
 
 
25
 
26
+ ### Input contract: pairs of (image, ground truth)
27
+
28
+ The user provides a **golden dataset** a folder of pairs `image.{jpg,png,…}`
29
+ + ground truth, where the ground truth is plain text (`image.gt.txt`),
30
+ **ALTO XML** (`image.xml`), or **PAGE XML** (`image.xml`). The ground truth
31
+ must be hand-annotated (or come from a curated reference corpus); Picarones
32
+ auto-detects the format and converts ALTO/PAGE to plain text for the
33
+ text-level metrics while keeping the structured GT for the ALTO/PAGE/entity
34
+ metrics.
35
+
36
+ ### Evaluation contract: every metric is computed against the GT in the input pair
37
+
38
+ The user plugs in one or several AIs to evaluate — OCR engines, VLMs,
39
+ OCR+LLM correction pipelines, alternative re-OCR + LLM + ALTO mappers
40
+ chained, etc. Picarones runs each AI on every page of the dataset,
41
+ compares the output to the ground truth at every relevant level (text,
42
+ ALTO, PAGE, entities, reading order), and produces a self-contained HTML
43
+ report with factual numbers, statistical tests and a reproducibility
44
+ snapshot. **A benchmark on a corpus without GT is impossible by design**:
45
+ Picarones measures how well an AI matches a known annotated reference,
46
+ not how well it transcribes an arbitrary document.
47
+
48
+ ### Decision contract: the researcher reads the numbers and decides
49
+
50
+ This is a **benchmarking platform, not a production workshop**. The
51
+ typical workflow is: build a small golden dataset whose script type,
52
+ period and language match the production corpus you eventually want to
53
+ process; benchmark candidate AIs on that dataset; read the report and
54
+ decide which AI is reliable enough to deploy on your real (unlabelled)
55
+ production corpus. No prescriptions, no automatic verdicts.
56
+
57
+ ### Each researcher brings their own dataset
58
+
59
+ Picarones does not yet maintain a curated library of standard golden
60
+ datasets. The corpus importers (IIIF, Gallica, HuggingFace, HTR-United,
61
+ eScriptorium, ZIP upload) help **fetch and ingest** existing datasets,
62
+ but the **choice and curation** are the researcher's responsibility.
63
+
64
+ ---
65
 
66
  Heritage-specific metrics (diplomatic CER, ligature and diacritic scores,
67
  medieval abbreviations, Roman numerals, foliation, fuzzy full-text
 
69
  **factual narrative synthesis** at the top of the report, **multi-engine
70
  Friedman/Nemenyi significance tests** with a **critical difference
71
  diagram**, **cost / speed / CO₂ Pareto analysis**, **per-junction error
72
+ absorption**, **multi-run stability**, **controlled per-slot comparison**.
 
 
73
 
74
  > *Version française ci-dessous.*
75
 
 
77
 
78
  ## Use case
79
 
80
+ A heritage institution wants to choose an OCR / HTR / post-correction
81
+ pipeline to deploy on a future production corpus say, several thousand
82
+ 17th-century parish registers, or 19th-century newspapers, or medieval
83
+ glossed manuscripts. They cannot benchmark candidate AIs directly on that
84
+ production corpus: there is no ground truth for it, so no metric can be
85
+ computed.
86
 
87
+ Instead, they assemble (or borrow) a **golden dataset** of a few hundred
88
+ hand-annotated pages whose script type, period and language match the
89
+ target corpus. Each page is a pair: the image, plus a ground truth in
90
+ plain text, ALTO XML, or PAGE XML. They feed the dataset to Picarones and
91
+ plug in the AIs to compare:
92
 
93
  - alternative re-OCR (Pero OCR, Kraken, Mistral OCR…);
94
  - LLM correction (GPT-4o, Claude, Mistral) in text-only or image+text mode;
 
96
  diplomatic normalisation);
97
  - composed pipelines: alternative OCR → LLM correction → ALTO mapper.
98
 
99
+ Picarones runs each AI on every page of the golden dataset, compares the
100
+ output to the ground truth at every relevant level, measures the metrics
101
+ (CER gain, recovered fuzzy searchability, preserved numerical sequences,
102
+ **errors introduced by the post-corrector** critical for LLMs that
103
+ silently modernise) and produces a factual HTML report that is **directly
104
+ citable in a scientific publication**: every number is traceable to its
105
+ source payload, no prescription imposed.
106
+
107
+ The researcher reads the numbers and decides which pipeline is reliable
108
+ enough to deploy on the actual (unlabelled) production corpus.
109
 
110
  ---
111
 
112
  ## En français
113
 
114
+ **Picarones** est une plateforme open source de banc d'essai pour des IA
115
+ d'OCR, HTR, VLM et des pipelines de post-correction sur documents
116
+ patrimoniaux.
117
+
118
+ ### Contrat d'entrée : paires (image, vérité terrain)
119
+
120
+ L'utilisateur amène un **golden dataset** — un dossier de paires
121
+ `image.{jpg,png,…}` + vérité terrain, où la VT est en texte brut
122
+ (`image.gt.txt`), en **ALTO XML** (`image.xml`), ou en **PAGE XML**
123
+ (`image.xml`). La VT doit être annotée à la main (ou provenir d'un corpus
124
+ de référence curaté) ; Picarones détecte automatiquement le format et
125
+ convertit l'ALTO / PAGE en texte brut pour les métriques textuelles tout
126
+ en conservant la VT structurée pour les métriques ALTO / PAGE / entités.
127
+
128
+ ### Contrat d'évaluation : chaque métrique est calculée contre la VT de la paire en entrée
129
+
130
+ L'utilisateur branche une ou plusieurs IA à évaluer — moteurs OCR, VLM,
131
+ pipelines OCR+LLM, ré-OCR alternatif + LLM + mappeur ALTO chaînés, etc.
132
+ Picarones exécute chaque IA sur chaque page du dataset, compare la sortie
133
+ à la vérité terrain à tous les niveaux pertinents (texte, ALTO, PAGE,
134
+ entités, ordre de lecture) et produit un rapport HTML autonome avec
135
+ chiffres factuels, tests statistiques et snapshot de reproductibilité.
136
+ **Un benchmark sur un corpus sans VT est impossible par design** :
137
+ Picarones mesure à quel point une IA matche une référence annotée connue,
138
+ pas à quel point elle transcrit un document quelconque.
139
+
140
+ ### Contrat de décision : le chercheur lit les chiffres et arbitre
141
+
142
+ C'est un **banc d'essai, pas un atelier de production**. Le workflow type
143
+ est : constituer un golden dataset de quelques pages annotées dont le
144
+ type d'écriture, la période et la langue correspondent au corpus de
145
+ production qu'on veut traiter ; benchmarker les IA candidates sur ce
146
+ dataset ; lire le rapport et décider quelle IA est assez fiable pour la
147
+ passer en prod sur le vrai corpus (non annoté). Pas de prescription, pas
148
+ de verdict automatique.
149
+
150
+ ### Chaque chercheur amène son propre dataset
151
+
152
+ Picarones ne maintient pas (encore) de bibliothèque curatée de golden
153
+ datasets standards. Les importers de corpus (IIIF, Gallica, HuggingFace,
154
+ HTR-United, eScriptorium, upload ZIP) aident à **récupérer et ingérer**
155
+ des datasets existants, mais le **choix et la curation** restent à la
156
+ charge du chercheur.
157
 
158
+ ---
 
 
 
 
159
 
160
  Métriques spécifiques aux corpus patrimoniaux (CER diplomatique, scores de
161
  ligatures, abréviations médiévales, numéraux romains, foliotation,
 
163
  pipelines composables, **synthèse narrative factuelle** au sommet du rapport,
164
  **tests Friedman/Nemenyi multi-moteurs** avec **diagramme de différence
165
  critique**, analyse **Pareto coût/vitesse/CO₂**, **absorption d'erreur par
166
+ jonction**, **stabilité multi-runs**, **comparaison contrôlée par slot**.
 
 
167
 
168
  ### Cas d'usage type
169
 
170
+ Une institution patrimoniale veut choisir un pipeline OCR / HTR /
171
+ post-correction à déployer sur un futur corpus de productionpar
172
+ exemple plusieurs milliers de registres paroissiaux du XVIIᵉ siècle, ou
173
+ de presse du XIXᵉ, ou de manuscrits glosés médiévaux. Elle ne peut pas
174
+ benchmarker les IA candidates directement sur ce corpus de production :
175
+ il n'y a pas de vérité terrain pour lui, donc aucune métrique ne peut
176
+ être calculée.
177
+
178
+ À la place, elle constitue (ou récupère) un **golden dataset** de
179
+ quelques centaines de pages annotées à la main dont le type d'écriture,
180
+ la période et la langue correspondent au corpus cible. Chaque page est
181
+ une paire : l'image, plus une vérité terrain en texte brut, ALTO XML, ou
182
+ PAGE XML. Elle alimente Picarones avec ce dataset et branche les IA à
183
+ comparer :
184
 
185
  - ré-OCR avec un moteur alternatif (Pero OCR, Kraken, Mistral OCR…) ;
186
  - correction LLM (GPT-4o, Claude, Mistral) en mode texte seul ou image+texte ;
 
188
  abréviations, normalisation diplomatique) ;
189
  - pipelines composées : OCR alternatif → correction LLM → mappeur ALTO.
190
 
191
+ Picarones exécute chaque IA sur chaque page du golden dataset, compare la
192
+ sortie à la vérité terrain à tous les niveaux pertinents, mesure les
193
+ métriques (gain CER, recherchabilité fuzzy gagnée, séquences numériques
194
+ préservées, **erreurs introduites par le post-correcteur** critique
195
+ pour les LLM qui modernisent silencieusement) et produit un rapport HTML
196
+ factuel **directement citable dans une publication scientifique** :
197
+ chaque chiffre est traçable au payload source, aucune prescription n'est
198
+ imposée.
199
+
200
+ Le chercheur lit les chiffres et décide quel pipeline est assez fiable
201
+ pour le déployer sur son corpus de production réel (non annoté).
202
 
203
  ---
204