PDF Data Extractor

  • Freelance, UK client
  • 2024
  • role: backend developer

Command-line tool for a UK company that uses LLMs to pull 20 to 50+ datapoints out of unstructured PDFs running from 10 to over 100 pages.

results

  • Thousands of PDFs processed, from 10 to over 100 pages each
  • 20 to 50+ datapoints per document, filled into a fixed schema instead of free text
  • Results compared against documents checked by hand

architecture

PDFs are split into context-preserving chunks, an LLM extracts the datapoints, and the result is structured data with 20 to 50+ fields per document.

External. To Semantic chunking.PDFsthousands of them10-100+ pages eachBuilt by me. From PDFs. To LLM extraction.Semantic chunkingcontext-preservingchunksAI / ML. From Semantic chunking. To Structured data.LLM extractionprompt-engineeredStorage. From LLM extraction.Structured data20-50+ datapointsper documentExternal. To Semantic chunking.PDFsthousands of them10-100+ pages eachBuilt by me. From PDFs. To LLM extraction.Semantic chunkingcontext-preservingchunksAI / ML. From Semantic chunking. To Structured data.LLM extractionprompt-engineeredStorage. From LLM extraction.Structured data20-50+ datapointsper document

the story

A command-line tool I built as a freelance project for a UK company. It reads unstructured PDFs, from 10 to over 100 pages each, and pulls out 20 to 50+ datapoints per document. Thousands of documents have gone through it.

The model never answers in free text. Each document is split into chunks that keep their context intact, and the LLM fills a fixed schema of fields from them, so what comes out is data a script can check, not prose to parse.

Knowing it's right

A long document can bury one number on page 80. Chunks small enough not to overwhelm the model, but large enough to keep the context, were most of the work; and I compared the results with documents checked by hand, so "consistent" meant matching them, not just looking plausible.

built with