Spaces:
Running
readme: repositionnement institutionnel post-correction OCR sur corpus ALTO
Browse filesLe README ciblait initialement les "documents patrimoniaux" en général
avec mentions explicites BnF/Gallica. Il est repositionné autour du cas
d'usage réel : un service institutionnel qui dispose déjà d'un corpus
ALTO XML et veut évaluer des pipelines de post-correction.
- Tagline FR + EN : "Plateforme d'évaluation de pipelines de
post-correction OCR sur corpus ALTO XML".
- Introduction reformulée : contexte institutionnel, banc d'essai pas
atelier de production, le chercheur arbitre.
- Nouvelle section "Cas d'usage type" : institution avec corpus ALTO
existant qui veut comparer ré-OCR, correction LLM, mappeurs ALTO,
pipelines composées.
- Mentions BnF retirées (gallica.py reste comme connecteur tiers
parmi d'autres).
- Mise en avant des fonctionnalités axe B (absorption d'erreur,
stabilité multi-runs, comparaison contrôlée).
https://claude.ai/code/session_01RusTQYcSfXqTsbFNvwmCV7
|
@@ -9,9 +9,9 @@ pinned: false
|
|
| 9 |
|
| 10 |
# Picarones
|
| 11 |
|
| 12 |
-
> **
|
| 13 |
|
| 14 |
-
> **
|
| 15 |
|
| 16 |
[](https://github.com/maribakulj/Picarones/actions/workflows/ci.yml)
|
| 17 |
[](https://www.python.org/downloads/)
|
|
@@ -20,16 +20,56 @@ pinned: false
|
|
| 20 |
|
| 21 |
---
|
| 22 |
|
| 23 |
-
**Picarones**
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
---
|
| 35 |
|
|
@@ -97,7 +137,7 @@ Gallica, HuggingFace, HTR-United, and eScriptorium.
|
|
| 97 |
| Source | Method |
|
| 98 |
|--------|--------|
|
| 99 |
| Local folder | `picarones run --corpus ./corpus/` |
|
| 100 |
-
| IIIF manifests (
|
| 101 |
| Gallica API (SRU + OCR) | `GallicaClient` / `picarones import iiif` |
|
| 102 |
| HuggingFace Datasets | `picarones import hf <dataset-id>` |
|
| 103 |
| HTR-United catalogue | `picarones import htr-united` |
|
|
@@ -246,7 +286,7 @@ See [INSTALL.md](INSTALL.md) for detailed instructions on Linux, macOS, Windows,
|
|
| 246 |
| `picarones serve` | Launch the FastAPI web interface |
|
| 247 |
| `picarones history` | Query longitudinal benchmark history (SQLite) |
|
| 248 |
| `picarones robustness` | Run robustness analysis with degraded images |
|
| 249 |
-
| `picarones import iiif` | Import corpus from an IIIF manifest (
|
| 250 |
|
| 251 |
**Examples:**
|
| 252 |
|
|
@@ -258,8 +298,8 @@ picarones run --corpus ./manuscripts/ --engines tesseract --lang fra --psm 6 \
|
|
| 258 |
# Compare two text files
|
| 259 |
picarones metrics --reference ground_truth.txt --hypothesis ocr_output.txt
|
| 260 |
|
| 261 |
-
# Import 10 pages from
|
| 262 |
-
picarones import iiif https://
|
| 263 |
|
| 264 |
# HuggingFace and HTR-United imports are available via the web UI at
|
| 265 |
# http://localhost:8000/ (endpoints POST /api/huggingface/import and /api/htr-united/import)
|
|
@@ -474,7 +514,7 @@ picarones/
|
|
| 474 |
│
|
| 475 |
└── importers/
|
| 476 |
├── iiif.py # IIIF manifest importer
|
| 477 |
-
├── gallica.py # Gallica API client (
|
| 478 |
├── htr_united.py # HTR-United catalogue importer
|
| 479 |
├── huggingface.py # HuggingFace Datasets importer
|
| 480 |
└── escriptorium.py # eScriptorium client
|
|
|
|
| 9 |
|
| 10 |
# Picarones
|
| 11 |
|
| 12 |
+
> **Plateforme d'évaluation de pipelines de post-correction OCR sur corpus ALTO XML**
|
| 13 |
|
| 14 |
+
> **OCR Post-Correction Benchmarking Platform for Existing ALTO XML Corpora**
|
| 15 |
|
| 16 |
[](https://github.com/maribakulj/Picarones/actions/workflows/ci.yml)
|
| 17 |
[](https://www.python.org/downloads/)
|
|
|
|
| 20 |
|
| 21 |
---
|
| 22 |
|
| 23 |
+
**Picarones** est une plateforme open source conçue pour un **contexte
|
| 24 |
+
institutionnel** — services patrimoniaux, archives, bibliothèques numériques
|
| 25 |
+
qui disposent déjà d'un **corpus en XML ALTO** (issu d'une chaîne d'OCR
|
| 26 |
+
historique) et qui veulent **évaluer rigoureusement** des pipelines de
|
| 27 |
+
**post-correction** : re-OCR alternatif, correction LLM, mappeurs ALTO
|
| 28 |
+
spécialisés, voting d'ensembles, etc.
|
| 29 |
+
|
| 30 |
+
C'est un **banc d'essai, pas un atelier de production**. Picarones charge un
|
| 31 |
+
corpus ALTO existant, exécute les pipelines que le chercheur amène, mesure
|
| 32 |
+
toutes les métriques pertinentes et produit un rapport HTML autonome
|
| 33 |
+
**factuel et reproductible**. Pas de prescription, pas de classement
|
| 34 |
+
automatique imposé : le rapport expose les chiffres, le chercheur arbitre.
|
| 35 |
+
|
| 36 |
+
Métriques spécifiques aux corpus patrimoniaux (CER diplomatique, scores de
|
| 37 |
+
ligatures, abréviations médiévales, numéraux romains, foliotation,
|
| 38 |
+
recherchabilité fuzzy plein-texte, fidélité aux marqueurs philologiques),
|
| 39 |
+
pipelines composables, **synthèse narrative factuelle** au sommet du rapport,
|
| 40 |
+
**tests Friedman/Nemenyi multi-moteurs** avec **diagramme de différence
|
| 41 |
+
critique**, analyse **Pareto coût/vitesse/CO₂**, **absorption d'erreur par
|
| 42 |
+
jonction**, **stabilité multi-runs**, **comparaison contrôlée par slot**, et
|
| 43 |
+
plusieurs sources d'import (IIIF, HuggingFace, HTR-United, eScriptorium,
|
| 44 |
+
upload ZIP).
|
| 45 |
|
| 46 |
+
---
|
| 47 |
+
|
| 48 |
+
## Cas d'usage type
|
| 49 |
+
|
| 50 |
+
Une institution (archive, bibliothèque numérique, service patrimonial) a
|
| 51 |
+
**déjà OCRisé** un corpus de plusieurs milliers de pages — sortie au format
|
| 52 |
+
**ALTO XML** avec coordonnées de zones, lignes et mots. Cette sortie a un
|
| 53 |
+
CER honorable mais imparfait, des erreurs typiques sur les ligatures
|
| 54 |
+
historiques, des abréviations non développées, des noms propres mal
|
| 55 |
+
reconnus.
|
| 56 |
+
|
| 57 |
+
L'institution veut **comparer rigoureusement** plusieurs stratégies de
|
| 58 |
+
post-correction sur ce corpus existant :
|
| 59 |
+
|
| 60 |
+
- ré-OCR avec un moteur alternatif (Pero OCR, Kraken, Mistral OCR…) ;
|
| 61 |
+
- correction LLM (GPT-4o, Claude, Mistral) en mode texte seul ou image+texte ;
|
| 62 |
+
- mappeurs ALTO spécialisés (re-segmentation des lignes, fusion des
|
| 63 |
+
abréviations, normalisation diplomatique) ;
|
| 64 |
+
- pipelines composées : OCR alternatif → correction LLM → mappeur ALTO.
|
| 65 |
+
|
| 66 |
+
Picarones charge le corpus ALTO, exécute chaque pipeline, mesure les
|
| 67 |
+
métriques pertinentes (gain CER, recherchabilité fuzzy gagnée, séquences
|
| 68 |
+
numériques préservées, **erreurs introduites par le post-correcteur** —
|
| 69 |
+
critique pour les LLM qui modernisent silencieusement) et produit un
|
| 70 |
+
rapport HTML factuel **directement citable dans une publication
|
| 71 |
+
scientifique** : chaque chiffre est traçable au payload source, aucune
|
| 72 |
+
prescription n'est imposée.
|
| 73 |
|
| 74 |
---
|
| 75 |
|
|
|
|
| 137 |
| Source | Method |
|
| 138 |
|--------|--------|
|
| 139 |
| Local folder | `picarones run --corpus ./corpus/` |
|
| 140 |
+
| IIIF manifests (institutional repositories) | `picarones import iiif <manifest-url>` |
|
| 141 |
| Gallica API (SRU + OCR) | `GallicaClient` / `picarones import iiif` |
|
| 142 |
| HuggingFace Datasets | `picarones import hf <dataset-id>` |
|
| 143 |
| HTR-United catalogue | `picarones import htr-united` |
|
|
|
|
| 286 |
| `picarones serve` | Launch the FastAPI web interface |
|
| 287 |
| `picarones history` | Query longitudinal benchmark history (SQLite) |
|
| 288 |
| `picarones robustness` | Run robustness analysis with degraded images |
|
| 289 |
+
| `picarones import iiif` | Import corpus from an IIIF manifest (any institutional repository). HTR-United and HuggingFace imports are exposed through the web interface (`/api/htr-united/import`, `/api/huggingface/import`). |
|
| 290 |
|
| 291 |
**Examples:**
|
| 292 |
|
|
|
|
| 298 |
# Compare two text files
|
| 299 |
picarones metrics --reference ground_truth.txt --hypothesis ocr_output.txt
|
| 300 |
|
| 301 |
+
# Import 10 pages from any IIIF manifest URL
|
| 302 |
+
picarones import iiif https://institution.example/iiif/xxx/manifest.json --pages 1-10
|
| 303 |
|
| 304 |
# HuggingFace and HTR-United imports are available via the web UI at
|
| 305 |
# http://localhost:8000/ (endpoints POST /api/huggingface/import and /api/htr-united/import)
|
|
|
|
| 514 |
│
|
| 515 |
└── importers/
|
| 516 |
├── iiif.py # IIIF manifest importer
|
| 517 |
+
├── gallica.py # Gallica API client (institutional digital library)
|
| 518 |
├── htr_united.py # HTR-United catalogue importer
|
| 519 |
├── huggingface.py # HuggingFace Datasets importer
|
| 520 |
└── escriptorium.py # eScriptorium client
|