Nomad changes
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s

This commit is contained in:
Henrik Jess Nielsen
2026-06-01 23:40:55 +02:00
parent 72b1a0a6ed
commit b4c07d3693
5723 changed files with 1130655 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
---
priority: critical
---
- Pluggable backend architecture: all backends implement the OcrBackend trait
- Backend independence: switching backends must not require API changes
- Tesseract is the default backend (native C FFI via leptess)
- Python backends (EasyOCR, PaddleOCR): use tokio::task::spawn_blocking, release GIL for Rust work
- Graceful degradation: if preferred backend unavailable, fall back to next available
- All backends must return structured results with confidence scores
- Document installation requirements and troubleshooting for each backend

View File

@@ -0,0 +1,9 @@
---
priority: medium
---
- Validate language packs exist before OCR execution — fail fast with helpful message
- Support ISO 639 language codes, map to backend-specific formats
- Configuration cascade: CLI args > environment > config file > defaults
- Provide troubleshooting guides for common issues (missing tessdata, backend not found)
- Language pack installation: document per-platform instructions

View File

@@ -0,0 +1,10 @@
---
priority: high
---
- Cache OCR results: key = hash(image_bytes + language + config)
- Invalidate cache when OCR config changes (backend, language, PSM mode)
- Batch processing: process multiple images concurrently with configurable parallelism
- Resource management: limit concurrent OCR operations to avoid memory exhaustion
- Performance targets: <2s for single page, <10s for 10-page document
- Monitor and log OCR processing times for regression detection

View File

@@ -0,0 +1,10 @@
---
priority: high
---
- Track confidence scores on all OCR results — expose in API
- Image preprocessing (denoise, deskew, binarize) should improve accuracy by 10-30%
- PSM mode selection: auto-detect layout, allow user override (single block, single line, sparse text, etc.)
- Language detection: validate requested languages are available, provide install hints if not
- Multi-language support: allow multiple languages per OCR request
- Test OCR accuracy against ground-truth documents in CI

View File

@@ -0,0 +1,10 @@
---
priority: high
---
- hOCR parsing: extract word-level bounding boxes, confidence scores, and text content
- Preserve spatial relationships from hOCR output for layout reconstruction
- Table detection: use cell boundary detection (line detection + intersection analysis)
- Validate grid structure before treating detected regions as tables
- OCR each cell individually for better accuracy
- Convert tables to markdown format with proper column alignment