Skip to content

Measure both extractors on unseen bill layouts - #5

Merged
CodeAvk merged 3 commits into
mainfrom
feat/unseen-layouts
Nov 30, 2026
Merged

CodeAvk merged 3 commits into
mainfrom
feat/unseen-layouts

Conversation

@CodeAvk

@CodeAvk CodeAvk commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Tests whether Gemini's lack of per-format rules is a real advantage over the OCR + regex baseline.

  • Adds three held-out bill layouts to the synthetic generator (two-line rows, reordered columns with day-first dates, labelled blocks) with new total and EOB labels. They were committed before either extractor was run on them, and neither the baseline rules nor the Gemini prompt was changed afterwards. Existing test sets regenerate byte-identical.
  • Result on 20 cases (82 bill lines): Gemini line F1 0.963, all totals and flags right, 15/15 injected errors found, 0/5 false alarms. The unchanged baseline reads nothing (F1 0), which is expected since its rules do not cover these layouts.
  • Gemini's only misses: one case where it copied the description printed after the code into the code field.
  • Records results and caveats in docs/GATE1_RESULTS.md, README and PLAN. Synthetic data only; time to write new baseline rules is not measured.
  • Also updates the token note in CLAUDE.md.

Tests: 59 pass locally. pip-audit: no known vulnerabilities.

Styles 3-5 change the row structure, date format and total labels. They are
frozen before either extractor is run on them; neither the baseline rules nor
the Gemini prompt may be tuned against them. Existing test sets regenerate
byte-identical.
On 20 cases in three held-out layouts, frozen before any run, Gemini reads
line items at F1 0.963 with every flag right; the unchanged OCR + regex
baseline reads nothing. Record the result, caveats and reproduce commands in
GATE1_RESULTS, README and PLAN, and add generator tests (59 pass).
@CodeAvk
CodeAvk merged commit 31acc9c into main Nov 30, 2026
3 checks passed
@CodeAvk
CodeAvk deleted the feat/unseen-layouts branch November 30, 2026 18:08
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