Repository navigation
Conversation
Adds a "Test Regions" button to the Document change page that lets operators upload a real document image and immediately see extracted values per attribute without running a full analysis job
_generic_fallback had its own inline copy of the label→value parsing logic from OCRAttributeExtractor.extract_attribute, calling find_single directly. Future improvements to the extractor (bilingual label handling, LLM fallback) would silently not apply to the generic path. Replace the duplicate block with a single extract_attribute(image, name, None) call, passing the already-constructed extractor instead of the processor.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #65 +/- ##
========================================
Coverage 99.18% 99.18%
========================================
Files 76 76
Lines 1832 1851 +19
Branches 146 147 +1
========================================
+ Hits 1817 1836 +19
Misses 8 8
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add two tests that mock OCRAttributeExtractor.extract_attribute to exercise the re.fullmatch path, which was unreachable when OCR returned an empty string. Brings admin.py patch coverage to 100%.
This branch has not been deployed
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
coordinates stay in image space so saved regions are unaffected by zoom level
run OCR extraction synchronously, and see extracted values overlaid on
the image with per-attribute pass/fail validation (regex shown on fail)
_generic_fallbackin tasks.py throughOCRAttributeExtractorto eliminate duplicate label→value parsing logic
Notes
in original image pixel space regardless of zoom level
_generic_fallbackrefactor means future improvements toOCRAttributeExtractor (LLM fallback, better parsing) automatically
apply to both extraction paths
Legal Boilerplate
Look, I get it.
Contributing to HOPE Payment Gateway, I retain all rights, title and interest in and to my contributions, and by keeping
this boilerplate intact I confirm that HOPE Workspace can use, modify, copy, and redistribute my contributions,
under HOPE's choice of terms.