Reading text out of a document
Extraction pulls the words a document actually stores. A PDF exported from an application carries a text layer and gives it up exactly; a DOCX gives its body; a PPTX gives what is on the slides; TXT, Markdown and JSON are already words. A scanned PDF stores pictures of words and has no layer to extract, so the model reads the pages instead.
What extraction is, and what it is not#
Extraction is retrieval, not interpretation. The reader for a format asks the document for the characters it holds and gets them back unchanged. Nothing is summarised, corrected or completed at this stage — a typo in your document is a typo in the extraction, which is the correct behaviour for something a quotation might later be drawn from.
That distinction is the reason the difference between a text layer and a picture of words matters so much. Where a layer exists, what comes out is what the author wrote. Where it does not, what comes out is a model's reading of an image, which is often right and is never a transcription.
Reading order, and where it goes wrong#
A document stores characters in some order, and that order is what extraction returns. For a straightforward page it is the order you would read in. For a page with columns, sidebars, headers or a text box floating over the body, the stored order and the visual order can differ — and extraction follows the stored one, because that is the only order that exists in the file.
- Two columns
- May interleave, left line then right line, if the document stores them that way.
- A header or footer on every page
- May appear repeatedly through the extracted content, because it genuinely appears repeatedly in the file.
- A pull quote or text box
- May land somewhere unrelated to where it looks on the page.
- A table inside a document
- Comes out as words in sequence, not as rows and columns — for those, reading tables out of a file is the right page.
When there is no layer#
Try selecting words in the document in your own PDF viewer.
Result If you can select them, a layer exists and extraction is exact. If your cursor draws a box instead, the page is an image.
Upload it anyway if that is what you have.
Result The model reads the rendered pages and can answer questions about them. What it cannot do is quote a string it never received as characters.
For anything where a digit or a name must be exact, get the source instead.
Result A spreadsheet, an exported PDF, or the original document removes the reading step entirely.
If the source is genuinely unavailable, verify the specific value yourself before acting on it.
Result Reading an amount off a photograph is exactly the task where a single wrong character is both plausible and expensive.
The PDF has no readable text covers the symptom in the form people usually meet it: an answer that is vague about a document they can read perfectly well themselves.
What reaches the model#
Extraction and grounding are separate steps. Everything extracted is stored against the version; what is handed to a model when you ask a question is bounded by the grounding budget, which is a few thousand characters rather than a whole book. The relevant part is selected for the question you asked.
This is why a narrow question outperforms a broad one on a long document. 'What notice period does clause 12 give?' selects a passage. 'Summarise this' asks a bounded excerpt to stand for the whole, and the answer is only as complete as the excerpt was.
Questions#
Are tracked changes and comments extracted from a DOCX?
The body is what extraction takes. Tracked changes and comments are not the body, so accept or reject them and resolve the comments before uploading if their content matters.
Does extraction happen again when I ask a second question?
No. It happens once, against that version of the file, and later questions read what was extracted. A new version is extracted separately, which is why an answer about a file is an answer about one version of it.
Can I get the whole extracted content back out?
You can see what was obtained in the preview. What a model is given for any one question is bounded by the grounding budget, so asking it to reproduce a long document returns a portion rather than the whole.