Skip to content

feat(report): add text extraction health check - #8

Merged
MMoney1988 merged 1 commit into
mainfrom
feat/text-extraction-health
May 14, 2026
Merged

feat(report): add text extraction health check#8
MMoney1988 merged 1 commit into
mainfrom
feat/text-extraction-health

Conversation

@MMoney1988

Copy link
Copy Markdown
Owner

Summary

  • Adds a warning-only Text Extraction Health check to the Markdown quality report.
  • The check measures extracted-text availability in normalized parser-output blocks.
  • Regenerates existing MDPI example reports and updates README/test coverage.

Why

  • PQR already checks required fields, provenance, bounding boxes, layout/noise, and local text usefulness.
  • It did not yet summarize whether the normalized output contains enough extracted text overall for human review.
  • This improves parser-output review without claiming OCR support or OCR accuracy.

What

  • Adds Text Extraction Health after Text Usefulness.
  • Reports text-bearing block counts, non-empty text blocks, empty text blocks, total text characters, image blocks, and empty-text ratio.
  • Keeps the check warning-only: no new hard-failure path and no CLI exit-code change for warnings.
  • Adds conservative report interpretation and README wording that distinguish text availability from text correctness.
  • Adds tests for PASS/WARN paths, warning-only behavior, CLI exit code, and conservative interpretation.

Tests

  • .venv/bin/python -m pytest -p no:cacheprovider tests -> 62 passed
  • .venv/bin/python -m ruff check src tests -> passed
  • git diff --check -> passed
  • .venv/bin/python -m pdf_quality_report.report --input examples/mdpi_pdf_elements/page_006/normalized_blocks.json --output /tmp/page_006_report.md -> passed
  • .venv/bin/python -m pdf_quality_report.report --input examples/mdpi_pdf_elements/page_012/normalized_blocks.json --output /tmp/page_012_report.md -> passed
  • Claim scan for OCR/support/readiness terms found only the existing negative README boundary: does not claim OCR quality.

Risks

  • Thresholds are conservative heuristics for review signals, not correctness guarantees.
  • The check can move an otherwise GO report to REVIEW, but it cannot produce BLOCK.
  • This PR does not add OCR fixtures, OCR benchmarking, invoice support, RAG, parser adapters, or product-readiness claims.

Rollback

  • Revert commit a085676 to remove the check, README/test updates, and regenerated example reports.

@MMoney1988
MMoney1988 merged commit 8c04295 into main May 14, 2026
1 check passed
@MMoney1988
MMoney1988 deleted the feat/text-extraction-health branch May 14, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant