{"slug": "parsosaur-turning-pdfs-back-into-a-structured-academic-paper-metadata", "title": "Parsosaur: turning PDFs back into a structured academic paper metadata", "summary": "Anil Madhavapeddy released Parsosaur, an MIT-licensed Python package on PyPI that converts academic PDFs into structured JSON, TEI XML and an interactive HTML bundle, with the goal of running it on the roughly 35 million fulltexts held by the Taposaur crawler. Parsosaur requires a Linux machine with an NVIDIA GPU for its layout model and a vision language model served over an OpenAI-compatible API, and it cross-links references and citations against a DOI database. Madhavapeddy developed the tool with Sadiq Jaffer as part of the Evidence TAP project, testing it on his own papers spanning 2002 to 2026 to cover a range of PDF toolchains.", "body_md": "I've just released [Parsosaur](https://tangled.org/anil.recoil.org/parsosaur), a\nPython tool that converts academic PDF papers into machine-structured\nformats such as JSON, [TEI XML](https://tei-c.org/) and also an interactive HTML bundle.\n\nI [first mentioned this](https://anil.recoil.org/notes/2026w33) back in August as a machine learning\nexperiment I'm working on with [Sadiq Jaffer](https://toao.com) while developing\nthe [Evidence TAP](https://anil.recoil.org/projects/ce), and am just about ready to run it on our\n[Taposaur](https://anil.recoil.org/notes/2026w31) crawler that now holds around [35 million fulltexts](https://anil.recoil.org/notes/2026w45).\nNone of the raw PDFs we have from the crawler are much use towards evidence\nsynthesis until we can reliably extract structured information such as semantic\nsections, tables and refs for the domain experts to quickly verify that the\ndata is accurate from the sources.\n\nThis PDF extraction is surprisingly tricky to get right, since we are essentially\nreversing a complex document compilation pipeline. And for [evidence synthesis](https://anil.recoil.org/papers/2025-evidence-tap), this\nis often for papers that are decades old and sometimes just scanned!\n\nA [PDF](https://en.wikipedia.org/wiki/PDF) is a complex set of declarative instructions for laying out vectors on a\ndigital canvas. The format originated from [PostScript](https://en.wikipedia.org/wiki/PostScript) (which is [Turing\ncomplete](https://en.wikipedia.org/wiki/Turing_completeness)) but is less powerful and only describes where shapes appear\non a canvas. There's no *required* [semantic markup](https://en.wikipedia.org/wiki/PDF#Tagged_PDF) (paragraphs, column,\ncaptions etc) but some (e.g. [LaTeX](https://en.wikipedia.org/wiki/LaTeX)) pipelines do happen to embed extra\nmetadata.\n\nOur [goal](https://anil.recoil.org/projects/ce) is to work on a large number of PDFs from a variety of sources, so we\nhave to assume that we'll need to infer the semantic knowledge from the raw\n[glyph](https://en.wikipedia.org/wiki/Glyph) positions in the PDF.\n\nI used a bunch of my own [papers](https://anil.recoil.org/papers) as a quick test corpus, as they\nspanned 2002 to 2026 and so had a reasonable variety of PDF toolchains involved\nin their production. I wanted Parsosaur to generate machine output with decent\nsection structures, with knowledge about tables and figures, and every\nreference and citation cross-linked and checked against a DOI database.\n\nThe image below shows the first page of our [Nature Climate Change paper on permanence](https://anil.recoil.org/papers/2023-ncc-permanence) after being parsed, with the masthead, dates,\nauthors, abstract, two-column body and affiliation footnote each separated into\ntheir own labelled region.\n\nI've also uploaded the [HTML output](https://www.cl.cam.ac.uk/~avsm2/parsosaur)\nfor six of my papers so you can try out the different outputs. It's a lot of\nfun seeing the two models converge on a PDF layout for papers with a variety\nof layouts!\n\nParsosaur is an MIT-licensed Python package, now [available on\nPyPI](https://pypi.org/project/parsosaur/), that you can run with\n[uv](https://docs.astral.sh/uv/guides/tools/). It needs a Linux machine with\nan NVIDIA GPU for the layout model, and a vision language model served over an\nOpenAI-compatible API. Just stick each PDF in a directory and point\nParsosaur at it for it to populate the directory with metadata:\n\n```\nmkdir paper && cp mypaper.pdf paper/\nuvx parsosaur paper/ --base-url http://localhost:8000\n```\n\nThere will be an `index.html` in the output directory that's a reading\nview, as well as a bunch of other reconstructions such as the JSON and\nTEI XML.\nThe layout model is a download of several gigabytes on first use.\nIf you also have GROBID, then you can put the GROBID TEI file output beside the PDF\nto have it used as yet another accuracy check.\n\nLet's now look at how Parsosaur works under the hood, and why we need it.\nThe brilliant [GROBID](https://github.com/kermitt2/grobid) software stack,\nwhich [we already run](https://anil.recoil.org/notes/2026w31), is designed to extract metadata from papers.\nWhile it gets a long way on titles and authors, it is weaker on structured extraction\nof body text and figures.  On the other hand, while newer AI vision models\nthat convert a whole page as an image are better on average, they still make big\nmistakes like (e.g.) dropping whole columns silently and so need to be double-checked.\n\nParsosaur therefore combines three sources of information:\n\nBoth ML models are compact enough to run on local GPUs, which is important as a lot of our paper corpus is closed source and not redistributable.\n\nParsosaur also does a final pass to figure out the title, authors and abstract, and splits the bibliography into individual references that are cross-linked to the in-text citations. It also caches intermediate results in the paper output directory, to make it easy to add heuristics without having to re-run the more expensive GPU inferences.\n\nNVIDIA published a [case study of Edison\nScientific](https://developer.nvidia.com/case-studies/scientific-literature-ai-nvidia-nemotron),\nwho use the same Nemotron model family to feed an [AI literature\nagent](https://github.com/Future-House/paper-qa/tree/main/packages/paper-qa-nemotron).\nIn their deployment, Nemotron Parse supplies both the boxes and the text in a\nsingle pass, and the vision model only examines figures, tables and\nequations.\n\nTheir approach is fast, and well suited to answering questions over thousands of papers. Our purpose is to obtain a faithful offline conversion of each paper, such that a domain expert can navigate back to the paper and cross check assertions from the primary sources. We therefore want high fidelity tracking of source locations, and as much accuracy as we can reasonably afford.\n\nTherefore for every page, Parsosaur counts the fraction of the PDF's characters that fall inside one of the layout model's text boxes. Above 95% (a threshold determined by experimentation), the layout is accepted. Below that, the layout model is invoked in a more thorough mode that's cross-checked against the first.\n\nFor example, page 4 of my [2005 IEEE Pervasive Computing article](https://anil.recoil.org/papers/2005-ieee-smartphones)\nshows the two modes. The layout model boxes the figure and one column of text and then stops, whereas\nthe more thorough run takes longer but finds the unusual magazine layout text with\nall the glyphs on the page accounted for.\n\nWe don't use the \"thorough\" mode on every page since it is much slower. Over our test set it generally took 3.5-4x as long, and also introduced occasional large new losses on papers that the quick mode handled correctly. The thorough attempt is therefore only made on suspect pages, and only kept if it accounts for more characters than the first.\n\nSwitching between the parsing and the vision models requires some heuristics to bridge the data. We establish a few rules here (arrived at by experimentation) that allow papers from a publisher to be sampled. Since most papers in a journal share similar typesetting, this works pretty well towards getting good structured output.\n\nOne example of a heuristic is widening boxes to the text. The layout model sometimes draws a box that's too narrow, often when there's a drop cap in the layout. This means the vision model misses text, as it can only read inside the crop. Our heuristic checks whether the PDF has characters just outside a box that are spaced similarly to the rest of that line, and if so widens the box to include them.\n\nAnother is spelling names correctly from the PDF text, which is important for unusual glyphs\nor foreign languages. For example, the vision model read the title of our [NPU paper](https://anil.recoil.org/papers/2026-benchmarking-npus)\nas \"Benchmarking Ultra-Low-Power μNPs\", but the PDF file's properties had\n\"μNPUs\". When the PDF agrees with a transcribed title, heading or author name\nto within a letter or two, the PDF's spelling wins.\n\nJournals often print their own name as large as the article's title, and the\nlayout model labels both as titles, as it does for our [LIFE paper](https://anil.recoil.org/papers/2024-life)\nbelow. The box whose words best match the extracted title is chosen.\n\nOne obvious win is that we can read the metadata identifiers that the PDF\ndeclares.  Most journal papers self-identify their own DOI in their metadata,\nand modern papers also link each author to their ORCID. These are taken\nstraight from the file. A DOI that *only* appears as a link in the body is\nignored as it may belong to a cited paper.\n\nGROBID can look papers up in [Crossref](https://www.crossref.org/) via\n[biblio-glutton](https://github.com/kermitt2/biblio-glutton), and for 15 of my\n141 papers it returned somebody else's! For example, the NPU paper came back as [\"Approaches\nto Improving Nursing Handover in Surgical Wards\"](https://doi.org/10.70749/ijbr.v3i8.2063). This\nwas weird enough to dig into, and it turns out to be multiple chained mistakes:\n\nParsosaur therefore refuses GROBID's record if its DOI differs from the one the PDF declares, or if its title does not match the page. We need to be really careful not to overly rely on any one metadata inferences, as the above chain of results demonstrates!\n\nThis was a very simple experimental setup, primarily just based on a 10,000-page corpus sampled from my papers and Taposaur. The next step is to run this on a much larger corpus to do systematic ablations and establish whether per-publisher heuristics are definitely necessary.\n\nThere are some research questions we need to dig into further with a larger corpus.\n\nEach page should be processed independently, but there's a speed tradeoff involved. Laying out 16 pages at a time was 23% faster than 2 at a time, but lost more regions, including bibliography entries. Parsosaur therefore currently processes two pages at a time, but needs more experiments to establish the Pareto frontier (if any) here.\n\nI suspect that as the context window of these later models increases, they'll get better at managing extra pages.\n\nWhen I [started this](https://anil.recoil.org/notes/2026w33) with [Sadiq Jaffer](https://toao.com), the SOTA model was Nemotron 2.0. I later upgraded to Nemotron 3.5 and compared against the 2.0 version.\n\n| Measured over 146 pages | 2.0 | 3.5 | \n|---|---|---|\n| Time to lay out every page | 236 s | 142 s | \n| Coverage | 95.29% | 96.69% | \n| Characters counted twice | 0.81% | 0.03% | \n| Word accuracy | 93.62% | 95.17% | \n\nOn average the 3.5 model is faster and better, but not always. Coverage did improve on 37 pages, was\nunchanged on 75 and worsened on 34, but the regressions were surprisingly severe.\nVersion 3.5 lost columns, and merged a table in our [NPU benchmarking paper](https://anil.recoil.org/papers/2026-benchmarking-npus) into the chart beneath it.\nThe lost columns also reproduced on a CPU-only run, pointing to the model itself being at fault.\n\nThe strong performance results motivated adopting 3.5, but with the heuristic engine and the thorough/quick modes to vary the context window.\n\nAs a secondary question, does retrying only suspect pages keep the gains without the losses? This does work well on Nemotron 3.5. Of the 146 pages, 31 fell below 95% coverage and were retried, and 4 retries were accepted. Coverage rose to 97.47%, no previously found character was lost, the hand-checked table returned to 76 correct cells out of 77, and layout was faster.\n\nA little, but not as much as I expected! I think this needs more data to give a convincing result. I gave the vision model the paper's text alongside each figure, and measured how many of the labels printed inside the figure appeared in its corresponding description.\n\nWhile there was a gain of nine points on the paper test set, tables responded badly since the model began to reconstruct them from the prose and dropped whole columns. Parsosaur therefore supplies the text for figures and formulas but not for tables.\n\nA general purpose frontier LLM has no problem with these layouts, but the smaller models do struggle and need these heuristics. This is also unsatisfying, but necessary due to our need to run on local GPUs only!\n\nThere are broadly three ways to get the text out of a PDF paper. The classical\none, used by [GROBID](https://doi.org/10.1007/978-3-642-04346-8_62) and\nSemantic Scholar's [PaperMage](https://aclanthology.org/2023.emnlp-demo.45/),\ntrusts the PDF's embedded text and trains models to label it semantically. Independent\ncomparisons of [extraction tools](https://arxiv.org/abs/2303.09957) and of\n[PDF parsers](https://arxiv.org/abs/2410.09871) agree that this works well for\nmetadata and references, and poorly for anything that depends on layout.\nUnfortunately, lots of journals have weird and wonderful layouts!\n\nThe second way ignores the embedded text and reads the page as an image, as\n[Nougat](https://arxiv.org/abs/2308.13418),\n[olmOCR](https://arxiv.org/abs/2502.18443) and\n[Nemotron Parse](https://arxiv.org/abs/2511.20478) do. This copes with any\nlayout, but a fluent model will also\n[rewrite](https://arxiv.org/abs/2607.21617) things, which is how we ended up with \"μNPs\" and also works poorly for foreign languages.\n\nThe third finds the regions first and then reads each one separately, as in\n[MinerU 2.5](https://arxiv.org/abs/2509.22186),\n[PaddleOCR-VL](https://arxiv.org/abs/2510.14528) and\n[Docling](https://arxiv.org/abs/2408.09869), and is the one we follow.\n\nWhere Parsosaur differs is in combining all the methods with heuristics, which\nis quite agent-friendly. We use image models to do the reading, and the\nembedded text serves to double check.  Existing benchmarks such as\n[OmniDocBench](https://arxiv.org/abs/2412.07626) and\n[PureDocBench](https://arxiv.org/abs/2605.07492) rank PDF parsers by their\naverage score, but for for evidence synthesis we really need to avoid outlier\nresults that might be hidden by an averaging.\n\nThis post just rounds up the results on a few hundred papers.\nThe next step is to run this on a much more significant corpus, and figure\nout how to validate them at scale.\nFor the [Evidence TAP](https://anil.recoil.org/papers/2025-evidence-tap), every page therefore needs a cheap (and\nas independent as possible) signal that encourages a human to douvle check it.\n\nI'll next try running Parsosaur over the [Conservation Evidence](https://anil.recoil.org/projects/ce) butterflies and\nmoths corpus, which the team knows well enough now to eyeball things rapidly!\nMuch of this would be unnecessary if publishers simply\n[gave us the structured text](https://anil.recoil.org/notes/rs-future-of-publishing) they already hold, but\nuntil then, we parse as best we can!\n\nThanks very much to [Sadiq Jaffer](https://toao.com) for much help with all of this, and also to the\nwider [CE](https://anil.recoil.org/projects/ce) team, especially [Sam Reynolds](https://samreynolds.org) and [Alec Christie](https://profiles.imperial.ac.uk/a.christie) for helpful discussions\nabout approaches to this parsing. While Parsosaur should strictly still be considered\na research prototype, I'm going to iterate on it more in the coming months. Please\ndo get in touch if you're working in a similar area and want to compare notes.", "url": "https://wpnews.pro/news/parsosaur-turning-pdfs-back-into-a-structured-academic-paper-metadata", "canonical_source": "https://anil.recoil.org/notes/parsosaur", "published_at": "2026-11-15 00:00:00+00:00", "updated_at": "2026-11-17 20:32:23.380779+00:00", "lang": "en", "topics": ["ai-research", "ai-tools", "structured-data", "machine-learning"], "entities": ["Parsosaur", "Anil Madhavapeddy", "Sadiq Jaffer", "Taposaur", "Evidence TAP", "GROBID", "PyPI", "TEI XML"], "also_reported_by": [], "takeaway": "Parsosaur is installable via uvx from PyPI and needs a Linux machine with an NVIDIA GPU for the layout model plus a vision language model behind an OpenAI-compatible API, outputting JSON, TEI XML and an HTML reading view per PDF directory.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/parsosaur-turning-pdfs-back-into-a-structured-academic-paper-metadata", "markdown": "https://wpnews.pro/news/parsosaur-turning-pdfs-back-into-a-structured-academic-paper-metadata.md", "text": "https://wpnews.pro/news/parsosaur-turning-pdfs-back-into-a-structured-academic-paper-metadata.txt", "jsonld": "https://wpnews.pro/news/parsosaur-turning-pdfs-back-into-a-structured-academic-paper-metadata.jsonld"}}