Document parsing
Definition
Converting PDFs, Office files, scans and web pages into clean text with structure, such as headings and tables, before indexing.
In more detail
PDFs store positioned glyphs rather than paragraphs, so naive extraction scrambles columns, splits words and flattens tables into streams of numbers. Parsers such as Docling, MarkItDown and Unstructured rebuild the layout, run OCR on scanned pages and output Markdown or JSON; vision-language models are another option for hard pages.
Parsing quality caps everything downstream: bad tables lead to confident wrong answers in RAG and extraction. Test a few parsers on a sample of your real files, and keep page numbers so answers can cite their source.
Related terms
Chunking
Splitting documents into pieces sized for embedding and retrieval, ideally along natural boundaries such as sections or paragraphs.
Retrieval-augmented generation (RAG)
Retrieving relevant documents and adding them to the prompt before the model generates an answer from them.
Vision-language model
A model that takes images as well as text as input and answers in text, used for reading screenshots, charts, documents and photos.
Read more about Document parsing
- Docling
Converts PDFs and office documents into structured output for LLM pipelines.
- Document AI
Turning PDFs, scans and Office files into clean text and validated structured data.
- MarkItDown
Microsoft's Python utility that converts Office files and PDFs to Markdown for LLMs.