owned this note
owned this note
Published
Linked with GitHub
---
id: asv-kolloq-2020-ocrd
title: OCR-Workflows mit OCR-D
tags: OCR, OLR, OCR-D
slideOptions:
theme: white
slideNumber: true
---
<style>
/* reduce from default 48px: */
.reveal {
font-size: 24px;
text-align: left;
}
.reveal .slides {
text-align: left;
}
</style>
# OCR-Workflows mit OCR-D <!-- .element: style="text-align: center;" -->
Robert Sachunsky <!-- .element: style="text-align: center;" -->
Leipzig, 18. Dezember 2020 <!-- .element: style="text-align: center;" -->
---
## Übersicht
- [Projekt](#/2)
- [Ziele](#/3)
- [Architektur](#/4)
- [Anlaufpunkte](#/5)
---
## Projekt

- 2014: DFG-Expertenworkshop _Verfahren zur Verbesserung von OCR-Ergebnissen_
- 2015-17: 1. Phase (Bedarfe aufdecken, Konzepte erarbeiten, Ausschreibung
von Modulprojekten)
- 2018-20: 2. Phase (Spezifikation und Referenzimplementierung für
integriertes Workflowsystem, 8 gleichzeitige Modulprojekte, 1 Koordinierungsprojekt, Pilotierung in Bibliotheken)
- 2021-23: 3. Phase (Weiterentwicklung und Integration, Nutzungsszenarien und Workflows, ≤ 13 Implementierungsprojekte, 1 Koordinierungsprojekt)
(DFG, LIS)
---
## Ziele
- Massen-Volltexterfassung für ges. gedrucktes dt. Kulturerbe (VD16/17/18: 460.000 Bde. digitalis.)
- Lückenschluß von Forschung und Praxis:
- Referenzkorpora und Richtlinien
- Weiterentwicklung Layout-Analyse usw.
- Analyse/Integration vorhandener Tools
- Spezifikationen (Formate, Schnittstellen CLI/API)
- Workflows
---
## Architektur
- föderiertes System (maximale Flexibilität)
- bel. skalierbar u. erweiterbar
- freie Kombination von Werkzeugen/Modellen/Methoden für alle Schritte
- komplexe Workflows, Workflow-Management
- Entwicklung neue Module, Integration existierender Tools
- Formate: METS-XML, PAGE-XML, JSON
- Schnittstellen: CLI, Python-API
- Referenzimplementierung: Python, bash
----
## Architektur
### Workspaces
- _physische_ Repräsentation einer METS-XML
- Verzeichnis für Dokument
- `mets:fileGrp` Unterverzeichnisse
- `mets:file` Dateien (relative lokale Pfade / URLs)
- Verwaltung ähnl. Repository
```sh
ocrd workspace clone "https://digital.slub-dresden.de/oai/?verb=GetRecord&metadataPrefix=mets&identifier=oai:de:slub-dresden:db:id-50169238X"
ocrd workspace find --file-grp ORIGINAL --page-id PHYS_0001 --download
ocrd workspace list-page
ocrd workspace list-group
ocrd workspace add ...
```
- Gegenstand der Prozessierung
----
## Architektur
### Repräsentation
- METS-XML: Dokument-Struktur, Metadaten
- PAGE-XML: Seiten-Struktur (hierarchisch); Beschreibung von Segmenten mit (Polygon-)Koordinaten, Attributen, Text, Bild-Referenzen
- Bilder: Original und Bildderivate
- Prozessierung = schrittweise Anreicherung (Annotation)


----
## Architektur
### Prozessoren
- Implementierung für abstrakte Operation in einem OCR-Workflow
- operiert auf Workspace (Eingabe/Ausgabe-fileGrps)
- Parameter-Spezifikation (JSON-Schema)
- einheitliche CLI
```sh
ocrd-olena-binarize -I MAX -O BIN -P impl sauvola-ms-split
ocrd-tesserocr-segment -I BIN -O SEG -P find_tables false
ocrd-cis-ocropy-dewarp -I SEG -O DEW -P smoothness 0.1
ocrd-calamari-recognize -I DEW -O OCR -P model "gt4histocr/*.ckpt.json"
```
- derzeit _>_ 60 Prozessoren verfügbar
- Binarisierung / Denoising / Despeckling
- Cropping / Deskewing / Dewarping
- Segmentierung / Clipping / Alignment
- Texterkennung / Alignment / Nachkorrektur
- Evaluierung / Konvertierung / Archivierung
----
## Architektur
### Workflow
- Konfiguration der Folge von Prozessoren und Parametern
- Shell-Syntax, Makefile-Syntax
```make
MAX:
ocrd workspace find -G $@ --download
BIN: MAX
BIN: TOOL = ocrd-olena-binarize
BIN: PARAMS = "impl": "wolf" # sauvola-ms-split
SEG: BIN
SEG: TOOL = ocrd-tesserocr-segment
SEG: PARAMS = "find_tables": false, "shrink_polygons": true
DEW: SEG
DEW: TOOL = ocrd-cis-ocropy-dewarp
DEW: PARAMS = "smoothness": 0.1
OCR: DEW
OCR: TOOL = ocrd-calamari-recognize
OCR: PARAMS = "model": "gt4histocr/*.ckpt.json"
```
- auf Workspace(s) aufrufen und (parallel) abarbeiten:
```sh
make -j -f config.mk all
```
---
## Anlaufpunkte
### Installation
```sh
git clone https://github.com/OCR-D/ocrd_all
cd ocrd_all
sudo make deps-ubuntu
make all
```
```sh
docker pull ocrd/all:maximum-cuda
```
https://ocr-d.de/en/setup (Setup-Guide)
----
## Anlaufpunkte
### Benutzung
https://ocr-d.de/en/user_guide (User-Guide)
https://ocr-d.de/en/workflows (Workflow-Guide)
----
## Anlaufpunkte
### Entwicklung
https://ocr-d.de/en/spec/ (Spezifikationen)
https://ocr-d.de/core (API-Dokumentation)
https://github.com/OCR-D/ocrd-website/wiki (Wiki)
https://ocr-d.de/en/dev-best-practice
https://gitter.im/OCR-D/Lobby (Chat)