feat(recognition): expose Tesseract confidence in OCR matches#1327
Merged
mikahanninen merged 2 commits intorobocorp:masterfrom May 3, 2026
Merged
feat(recognition): expose Tesseract confidence in OCR matches#1327mikahanninen merged 2 commits intorobocorp:masterfrom
mikahanninen merged 2 commits intorobocorp:masterfrom
Conversation
The OCR matcher already returned text similarity confidence but threw away Tesseract's own word confidence data. Preserve the existing confidence semantics for compatibility, attach an averaged ocr_confidence to each match, and lock the parsing and aggregation behavior with focused unit tests. Constraint: existing callers already depend on confidence meaning text similarity Rejected: Rename confidence to text_confidence | would break current match consumers Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep confidence mapped to text similarity unless a major-version API change is planned Tested: python -m pytest packages/recognition/tests/python/test_ocr_confidence.py -q -p no:cacheprovider --no-cov Not-tested: End-to-end OCR against a local Tesseract binary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
confidencevalue for compatibilityocr_confidenceto each match using the underlying Tesseract confidence dataCloses #1303.
Test plan
python -m pytest packages/recognition/tests/python/test_ocr_confidence.py -q -p no:cacheprovider --no-cov