improve receipt OCR detection via a real-receipt fixture corpus #75
Labels
No labels
area:backend
area:frontend
area:infra
area:ocr
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
phase:M1
phase:M2
phase:M3
phase:M4
phase:M5
phase:M6
phase:M7
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
TJC/bill-splitter#75
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
OCR accuracy is the project's named risk (docs/00-overview.md,
docs/adr/0001-self-hosted-ocr.md: ~70-85% line accuracy on real receipts). The
parser corpus still holds only the 7 synthetic seed fixtures and no real-receipt
coverage, and the Python sidecar does no image preprocessing. The docs mandate
growing the corpus "from real receipts from day one" and turning every misparse
into a fixture before fixing it (docs/11-testing-strategy.md) - this issue
establishes that loop and drives both OCR layers toward a green corpus.
Approach
Two layers, one deterministic test surface:
improve preprocessing (deskew / denoise / binarize / upscale / angle classifier).
(backend/src/BillSplitter.Domain/ReceiptParser.cs) - improve heuristics; its
fixture corpus is the real unit-test spec and can reach 100% green.
Per real receipt image:
backend/tests/BillSplitter.Tests/Fixtures/receipts/{name}/receipt.(jpg|png).
bytes to POST /ocr).
minor units).
sidecar preprocessing (and re-record ocr.json) for raw-text misses.
Scope / tasks
into app runtime.
a "named seeds present" check so the corpus can grow freely.
expected.json).
in ocr/app/config.py if needed); re-record affected ocr.json.
the /ocr response shape changes).
Privacy
Fixture images are permanent repo history. Use only receipts free of personal
data (no cardholder names, full PANs, emails, phones) - synthetic, self-owned, or
redacted. The runtime "never store image bytes" rule governs live sessions, not
test fixtures.
Acceptance criteria
author expected -> test).
green.
resolve captured as fixtures.