Receipts, statements and tax forms
Thermal receipts, bank statements and the fixed-box tax forms where a field's meaning is defined by a government schema rather than a layout.
These documents divide into two kinds and almost every extraction mistake comes from treating one as the other. A tax form has a schema: the number printed next to a box is a reference into a document the IRS publishes, and the meaning of that box does not depend on where it appears on the page or what the surrounding text says. A receipt has no schema at all. It has a merchant’s idea of a receipt, printed on paper that is actively decaying, with the one field you most want — what kind of business this was — never printed on it anywhere.
What the two halves share is arithmetic. A receipt’s line items sum to its subtotal, a statement’s closing balance equals its opening balance plus its transactions, a payslip’s gross minus its deductions equals its net, and a Schedule C’s parts foot into each other. That arithmetic is the only thing on any of these documents that can tell you an extraction is wrong without a human reading it, so these pages are built around it: what the identity is, what breaks it legitimately, and what the size of the residual tells you about which field you misread.
Extracting Data From a Blurry Phone Photo of a Receipt
Why blur destroys the amounts before it destroys the words, and how to use the receipt's own arithmetic to find the digit you misread.
9 min read
Extracting Tip and Gratuity Amounts From a Restaurant Receipt
Why the printed total on a card receipt is the pre-tip total, and how to recover a handwritten tip from the settled amount instead of the pen stroke.
8 min read
Categorizing Receipt Line Items for Expense Reports
Build a category mapping onto expense categories that already exist in tax law, and allocate tax and tip across the categories rather than dumping them in one.
9 min read
Extracting Merchant Category From a Receipt When the Logo Is the Only Clue
The merchant category code lives in the card network's data and is never printed on the paper, so the receipt only supports an inference you should make with a lookup you control.
8 min read
Extracting Data From a Faded Thermal-Printer Receipt
Thermal fading is a chemical change in the paper's coating, not lost ink, so the strategy is partial extraction with explicit missing-field flags rather than restoration.
8 min read
Extracting Recurring Transactions From a Bank Statement
Normalise the descriptor, then cluster on the interval rather than the amount, so a price rise and a four-weekly billing cycle stop breaking the grouping.
9 min read
Extracting Opening and Closing Balances From a Multi-Page Bank Statement
The identity that closing equals opening plus transactions is the only check that catches a page you never knew was missing, and the size of the residual says which failure you have.
9 min read
Extracting Check Images and Numbers Referenced in a Bank Statement
Check numbers appear in two different places on a statement with different conventions, and the asterisk marking a sequence gap is the only signal a naive extractor throws away.
8 min read
Categorizing Bank Statement Transactions Into a Chart of Accounts
Keep extraction and classification as separate stages so the chart of accounts can change without re-reading the statement, and set the auto-post threshold per account rather than globally.
9 min read
Extracting Gross Pay, Deductions and Net Pay From a Payslip
A payslip has no standard layout but two arithmetic identities that must close, and employer-side contributions are the reason most naive extractions fail one of them.
9 min read
Extracting Year-to-Date Totals From a Payslip
Current-period and year-to-date figures are the same fields printed twice, indistinguishable in January, and the only check that proves you assigned them correctly needs two payslips.
8 min read
Extracting Tax Withholding Codes From a Payslip
A tax code is a jurisdiction's private shorthand with a defined grammar, so it should be validated structurally against a supplied table rather than interpreted by a model.
8 min read
Extracting Box Values From a W-2 Form
Every numbered box means one defined thing, boxes 1, 3 and 5 are supposed to differ, and box 12's four slots are positions rather than fields.
10 min read
Extracting Income Figures From a 1099-NEC or 1099-MISC
A box number on a 1099 means nothing without the form variant and the revision, because nonemployee compensation moved between forms and boxes have been renumbered since.
9 min read
Extracting Data From a Schedule K-1
Three different forms share the name, their box numbers disagree with each other, and the values you want are frequently not on the K-1 at all but on an attached statement it points to.
10 min read
Extracting Filing Status and Dependents From a Form 1040
Five mutually exclusive checkboxes resolve to one enum, but the text field beside them means different things depending on which box is ticked, and the dependents grid stops at four rows.
9 min read
Extracting Expense Categories From a Schedule C
The parts of a Schedule C foot into each other, which makes the extraction self-checking, and the line numbers move between tax years, which makes keying a ledger on them a mistake.
9 min read
Other topics
- LLM fundamentals & architecture
- Tokens, tokenization & context windows
- Prompt engineering
- Reasoning models & test-time compute
- Multimodal AI: vision, audio, video
- RAG & retrieval
- Embeddings & vector search
- AI agents & tool use
- Structured output & function calling
- Fine-tuning & post-training
- Local inference errors, string by string
- Running local models day to day
- Testing code that calls an LLM
- Snapshot and property testing for model output
- Regression suites for prompts
- Eval gates in CI
- Flaky tests against a model
- Determinism and the cost of testing
- Contract and streaming tests
- Testing tool calls and retrieval
- Inference, serving & latency
- Rolling out a prompt change
- Testing AI systems in practice
- Forecasting a time series
- Machine learning on tabular data
- Geospatial data and models
- Understanding audio that is not speech
- Understanding video
- Core computer vision tasks
- Machine learning on graphs
- Point clouds and 3D
- Evaluation, benchmarks & LLM-as-judge
- Sensor and IoT data
- Logs and event streams
- Models over biological sequences
- Machine learning on molecules
- Embedding and searching code
- Extracting invoices and purchase orders
- Insurance policies and contracts
- Deeds, court filings and patents
- Extracting from medical records
- Observability & LLMOps
- CVs, certificates and identity documents
- Shipping, customs and technical documents
- Meetings, email, chat and filled-in forms
- Building an extraction pipeline
- Business, property and inspection documents
- Contract clauses and insurance claims
- Regulated and compliance documents
- Consumer, travel and closing documents
- Mapping one chat API onto another
- SDK and framework migrations
- Hallucination & failure modes
- Re-embedding and model deprecation
- Cutting over between providers
- Parity gaps, shims and legacy endpoints
- Moving between model versions
- Migrating vector stores and caches
- Mapping capabilities and parameters
- Migrating pipelines and agents
- Contracts, runbooks and rollback
- Auditing a codebase before a cutover
- Compliance and fine-tune migration
- LLM cost engineering
- Routing, cost tracking and multi-tenancy
- What a migration does to your prompts
- AI security & prompt injection
- Privacy, compliance & data residency
- AI governance, policy & society
- Building reliable AI applications
- AI hardware, GPUs & compute
- Open-weight models & local inference
- AI for developers & coding agents
- AI in industry: vertical playbooks
- AGI, superintelligence, alignment & the long future
- Machine learning foundations
- NLP fundamentals & classical tasks
- Data engineering for AI
- Synthetic data & dataset curation
- AI product design & UX
- Search, ranking & recommendation
- Enterprise adoption & change management
- AI careers, skills & teams
- Reading AI research
- AI in science & discovery
- Robotics & embodied AI
- AI economics, markets & business models
- AI myths, hype & media literacy
- Context engineering
- Shipping AI features: patterns & anti-patterns
- Build it: end-to-end AI tutorials
- Python for AI: hands-on recipes
- TypeScript, React and the web
- Frameworks and SDKs
- Errors and troubleshooting
- AI facts, numbers and statistics
- The history of AI
- The maths behind AI
- Architectures beyond the transformer
- Reinforcement learning
- Diffusion and generative media
- Speech, audio and voice engineering
- Benchmarks, one at a time
- AI search visibility
- Infrastructure and operations
- Databases and storage for AI
- Knowledge graphs and structured knowledge
- Classical ML in production
- Regulation, jurisdiction by jurisdiction
- Prompt recipes and pattern library
- AI for people who do not write code
- Writing, media and creative work
- Edge and on-device AI
- Interpretability and model internals
- Field notes
- OpenAI model behaviour
- Claude model behaviour
- Gemini model behaviour
- Llama model behaviour
- Mistral model behaviour
- Qwen model behaviour
- DeepSeek model behaviour
- Cohere model behaviour
- Grok model behaviour
- Small model behaviour
- Hybrid model architectures
- Token cost by language and script
- Transliteration, romanization and script handling
- Locale-correct output
- Multilingual generation quality
- Multilingual pipelines
- The EU AI Act, article by article
- AI under the GDPR and EU data law
- US AI regulation, state and sector
- International AI governance and standards
- AI litigation and enforcement
- Running AI workloads on AWS
- Running AI workloads on Google Cloud
- Running AI workloads on Azure
- AI at the edge: Workers, Vercel and Netlify
- Serving models on Kubernetes
- Operating AI infrastructure
- Quantization formats and what they cost
- llama.cpp, flag by flag
- Ollama and the desktop local-model runtimes
- Local models on Apple Silicon
- Hardware for local inference
- Running speech and embedding models locally
- Model files, adapters and conversion
- VRAM arithmetic for local models