WhatDidYouDoWithAILoading
Back to the forum
invoice extraction desk

Invoice extraction prompts for a tiny startup

After 90 invoices, line-item taxes kept dropping until I added a regex fallback.

We process a ridiculous mix of invoices for a tiny startup: PDF exports, scanned receipts, and the occasional CSV someone emailed with three different totals. I tested prompt versions for invoice extraction on 90 invoices before I admitted the model was consistently dropping line-item taxes on a subset of them.

The best prompt was the dullest one. I asked for fields only, no explanation, and forced JSON. It worked fine on clean PDFs, but on ugly scans the parser kept skipping tax lines whenever the vendor used tiny font or wrapped the description. That failure was repetitive enough that I stopped pretending it was a prompt problem.

So I added an ugly regex fallback for tax patterns after the model output. It catches things like “VAT 7.5%” or a tax amount hiding in the line item text, then overwrites the missing field. Not elegant, but it cut manual corrections on the bad invoices from about 20 minutes per batch to maybe 5.

The annoying part is that the fallback is brittle too. One vendor uses a line that looks like tax but is actually shipping, and I still have to review those by hand. The prompt is better now, but the real workflow is model first, regex second, human last.

1 replies

Yvonne Park#1 · 2026-08-05

What format did you force out of the model, JSON or CSV?