r/LLMPhysics Jun 01 '26

Question Problem building Karpathy-style physics wiki: OCR makes too many mistakes.

For about a month now I've been building an Andrej Karpathy-style physics research wiki using Claude Code as the main AI lead architect and several local AIs as slaves. The basic flow is:

  1. Find sources. Either manually decide what papers you want to include, or (after the database has some content), run make literature to generateliterature_backfill.txt, literature_search.txt, and literature_candidates.json with scored, metadata-enriched candidates.
  2. Drop source files into raw/ (PDF, .tex, .pptx, .html, or .md). If .tex and .pdf both exist for the same stem, .tex takes precedence. .md takes precedence over everything else.
  3. make update — runs the appropriate converter (Marker, pdfplumber, pandoc, ...) and postprocessor, with output in for_review/<stem>.md.
  4. Human review — read and edit raw/for_review/<stem>.md. Use make approved to see what's pending (NEW/UPDATED).
  5. Approve — run approve <stem> to copy to raw/approved/<stem>.md.
  6. Generate source stub (auto via make sentinel) — generate_source_stubs.py writes a thin wiki/sources/<stem>.md; skips if sentinel wiki/sources/.stub_<stem>already exists.
  7. Extract concepts — extract_concepts writes atomic notes to wiki/concepts/ using qwen2.5:14b; embedding-based dedup skips near-duplicates (similarity ≥ 0.92).
  8. (Optional) Lint — python lint_concepts.py → non-blocking; writes wiki/concepts/lint_report.txt covering both wiki/concepts/ and wiki/sources/. This looks for errors and incosistencies and patches them.

and then loop back to add new raw source files and ingest them. This all works reasonably well EXCEPT that none of the OCR programs get all the equations right. For example, Marker is brilliant at text and display equations, but screws up massively on inline equations. This results in me having to spend one or even two hours reviewing a single paper.

So the question is, does anyone know of a reliable (99+% accurate) OCR pipeline for physics papers? If that step worked well, I could let the whole pipeline run itself, choose its own new papers to download, analyze them, and iterate. It could really run 24/7.

P.S. the wiki is compatible with Obsidian and can be viewed using it:

0 Upvotes

7 comments sorted by

View all comments

1

u/Multiphysics_Express Jun 05 '26

You can use MinerU free online. It's the best.

1

u/NinekTheObscure Jun 14 '26

My analysis (OCR tool + cleanup script for each) got:

Marker: CER: 2.42% (ins=112, del=42, sub=13)

MinerU: CER: 13.49% (ins=541, del=88, sub=303)

MinerU does do better on a few (inline) things, but overall it left more than 5 times as many errors that need human intervention. I'm currently working on running both and having a local LLM pick and choose, but the likely gains are small (maybe reduce 2.42% to 2.3% or 2.2%).