Data extraction
TracEx
Measured values pulled out of materials-science papers, each with the exact sentence it came from and an A, B or C grade for how well that check holds, in one model call per paper.
- My role
- Solo developer
- Period
- 2025 to present
- Status
- Public on GitHub
- 1
- model call per paper
- A/B/C
- verification grade per value
- 3
- model providers supported
The problem
Measured values in materials-science papers are buried in prose: finding one parameter meant reading the PDF and copying the number by hand. A plain LLM call or a generic AI tool returns results full of hallucinations. What was missing was extraction where every number ties back to the exact sentence it came from.
Why it matters
Built to turn materials-science papers into data a model or a database can use, without accepting a value that cannot be checked against its source.
What came of it
- One model call per paper, down from five to nine after the April 2026 refactor, with the provenance and verification unchanged.
- Every extracted measurement graded A, B or C by re-checking the model's cited sentence IDs against the original text.
- Provenance is stamped before any model runs, so a claim cannot be traced to a sentence invented after the fact.
- Public on GitHub, and the verification approach the lab's literature retrieval was built on.
What I did
- Stamped provenance before extraction. docling parses the PDF, and every sentence and table cell gets a hierarchical ID before any LLM runs, so every claim ties to a fixed text anchor.
- Ran deterministic extraction first: regex, pymatgen for chemical-formula validation and quantulum3, extended with a condensed-matter unit registry, for numbers and units. Only then comes one LLM call per paper, with forced tool use against a JSON schema and a hard call budget.
- Kept the model provider swappable through litellm, across Anthropic, OpenAI and Gemini.
- Graded every value deterministically afterwards: the LLM's cited sentence IDs are re-checked against the original text, with substring alias matching for sample names and word-boundary regex for numbers, giving grade A, B or C.
- Wrote one Obsidian markdown note per sample, with a measurement table carrying source links and grades, plus JSON artefacts for each stage. Tested with pytest.
The same stamp-then-verify approach underlies the lab's literature retrieval.
Stack
- Python
- docling
- pymatgen
- quantulum3
- litellm
- pytest
- LLM tool use
- JSON Schema
Related work
I am looking for a role in AI for materials and processes. Write to me atcontact@aditya-kumar.de.

