How corrections from Hugging Face Space flow back to improve the OCR system.
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ 1. GT Import │────▶│ 2. Benchmarks │────▶│ 3. Trainer │
│ │ │ │ │ │
│ ABBYY/ReadIRIS │ │ CER/WER/Medical │ │ Streamlit UI │
│ → Ground Truth │ │ Term Accuracy │ │ Ensemble OCR │
│ │ │ │ │ Interactive Fix │
│ Repo: │ │ Repo: │ │ Repo: │
│ medical-ocr- │ │ medical-ocr- │ │ medical-ocr- │
│ ground-truth │ │ benchmarks │ │ trainer │
└─────────────────┘ └──────────────────┘ └────────┬────────┘
│
│ corrections
▼
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ 6. Platform │◀────│ 5. Benchmarks │◀────│ 4. HF Space │
│ │ │ (Re-evaluate) │ │ │
│ omni-medical- │ │ │ │ Online Demo │
│ suite │ │ Baseline │ │ User Corrections│
│ │ │ Regression Check │ │ Quick Feedback │
│ Full Pipeline │ │ │ │ │
│ Production Use │ │ Repo: │ │ Repo: │
│ │ │ medical-ocr- │ │ medical-ocr- │
│ │ │ benchmarks │ │ trainer-hf │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
│ improved models/dictionaries
▼
┌─────────────────┐
│ 7. Training Hub │
│ │
│ Bridge: HF ↔ GitHub
│ Continuous Model
│ Improvement │
│ │
│ Repo: │
│ medical-ocr- │
│ training-hub │
└─────────────────┘
Repository: medical-ocr-ground-truth
# Import from ABBYY FineReader
python import_ground_truth.py abbyy_output.docx --output gt_page588.txt
# Import from ReadIRIS
python import_ground_truth.py readiris_output.rtf --output gt_readiris.txt
# Compare OCR with GT and generate correction dictionary
python gt_comparison_engine.py --gt gt_page588.txt --ocr ocr_output.txt \
--generate-dict --output report.jsonOutput: Ground truth files, correction dictionaries, training pairs.
Repository: medical-ocr-benchmarks
# Run benchmarks against current engines
medocr-bench --engines paddleocr,tesseract --check-ci
# Results saved to results/ with CER/WER/medical accuracyOutput: Baseline metrics for regression detection.
Repository: medical-ocr-trainer
streamlit run app.py
# 1. Upload medical documents
# 2. Run ensemble OCR (5 engines)
# 3. Review and correct errors
# 4. Export training dataOutput: Corrected pairs, training datasets (JSONL/CSV/Parquet).
Hugging Face: DrAbdulmalek/medical-ocr-trainer
Users try the demo, upload documents, and make corrections. These corrections are captured and can be bridged back to GitHub.
Repository: medical-ocr-training-hub
HF Space corrections → Training Hub → GitHub training data → Model improvement
The Training Hub acts as the bridge between online user feedback and offline training.
Repository: medical-ocr-benchmarks
# Re-run benchmarks after improvement
medocr-bench --engines paddleocr --check-ci
# Compare against previous baselines
medocr-bench --compare-baseline results/baseline_v1.jsonCI automatically detects regressions (≥5% degradation).
Repository: omni-medical-suite
# Update postprocessor dictionary
cp improved_dict.json omni-medical-suite/data/correction_dict.json
# Deploy
cd omni-medical-suite && make deploy| Trigger | Action | Repository |
|---|---|---|
Push to ground-truth data files |
Run GT validation → notify benchmarks | ground-truth |
| Weekly Monday 4AM | Full benchmark suite | benchmarks |
| PR to any repo | Quick benchmark check | benchmarks |
Push to postprocessor |
Publish to PyPI | postprocessor |
Push to suite |
Full CI (lint + test + build) | omni-medical-suite |
| Step | Frequency | Effort |
|---|---|---|
| Import new GT data | Monthly | 30 min |
| Review HF Space corrections | Weekly | 15 min |
| Export training data from trainer | As needed | 5 min |
| Re-baseline after changes | Per release | 10 min |
| Deploy updated dictionaries | Per improvement | 5 min |
Before any release reaches the platform:
-
medical-ocr-benchmarksCI passes (no regression > 5%) -
medical-ocr-postprocessortests pass (37+ tests) 3 [ ] New dictionary entries validated against GT - No default credentials in
omni-medical-suite - Audit event model checksums verified
omni-medical-suite ← Main Platform (production use)
├── medical-ocr-postprocessor ← Core correction library (pip install)
├── medical-handwriting-ocr ← Production OCR (GPU/Lite modes)
├── medical-ocr-trainer ← Data collection & correction
├── medical-ocr-trainer-hf ← HF Space (demo only)
├── medical-ocr-benchmarks ← Quality measurement
├── medical-ocr-ground-truth ← Golden truth source
├── medical-ocr-training-hub ← HF ↔ GitHub bridge
├── OmniFile_Processor ← Legacy (read-only)
└── medical-doc-processor ← Legacy (read-only)
This pipeline creates a closed loop: GT → Measure → Correct → Train → Re-measure → Deploy
Part of the Medical OCR Ecosystem