Lab 02
Document Intelligence
Turn a receipt into data
Read a receipt or invoice and pull out the date, total and line items, without uploading it.
Overview
Someone has to retype what is already on a receipt.
How this could help a business
A document reader that finds the date, total and line items can feed expense tools or back-office workflows directly. A production version would add review queues for low-confidence fields and integration with the team's software.
What I built
- A LayoutLM model I fine-tuned on receipts and generated invoices, published with its model card and run in the browser.
- A pipeline that reads the text, rebuilds reading order, finds the fields and checks the arithmetic, all on the visitor's device.
Live demo
Try the example receipt, or choose an English image or a PDF with selectable text.
What I built
Implementation, decisions and evidence.
What Sebastian built
The application around the technology.
- A LayoutLM model I fine-tuned on receipts and generated invoices, published with its model card and run in the browser.
- A pipeline that reads the text, rebuilds reading order, finds the fields and checks the arithmetic, all on the visitor's device.
- A synthetic invoice generator with exact labels, used to train and evaluate the field model.
One engineering decision
Read documents on the visitor's device so the application does not need to upload their files.
What to check yourself
Try the generated receipt, inspect the actual extracted text, then open Measured output and pipeline details in What I built to see the reader's raw output.
Tools and model credits. Tesseract reads image text and pdf.js reads PDF text. The field model is a LayoutLM fine-tune, served from Hugging Face at a pinned commit.
These are portfolio demonstrations. Explore professional experience separately, or discuss how the approach could fit your team.
Learn
Understand what the application is doing.
Compare the fields the model found with the original. Check the total and a line item, then look at the extracted text underneath.
Pause and predict
If a reader finds the words ‘Total 9.00’, has it checked the bill's maths?
A learning question, not a score. Try this in the working demo.
Try changing something
Now make it your experiment.
Try a clear English image of your own. Compare the spelling, spacing and amounts with the original before using the text.
Field finding runs on images today. PDF pages get their text read but do not go through the field model yet, and scanned PDFs are not read. A found total is a strong hint, not an audited figure.
A few words, explained
- Text recognition
- Software looks at an image and turns the shapes of letters into text you can select and copy.
Data handling & current limitations
Fields are found on images. PDFs get their text read; field finding on PDF pages comes next.
Demo only. Each lab below explains which inputs stay on your device and which data is sent for server-backed features. Model files are downloaded and may remain in your browser cache. Hosting and security services also receive the network requests needed to serve the site.
Your document is parsed in this tab and is not uploaded. Its text is kept only in this page's memory; the downloaded OCR files may remain in your browser cache.
Field finding runs on images today. PDF pages get their text read but do not go through the field model yet, and scanned PDFs are not read. A found total is a strong hint, not an audited figure.