OCR + Parsing

March 6, 2026 · View on GitHub

🏥 Quick Return to Emergency Room

You are in a specialist desk.
For full triage and doctors on duty, return here:

Think of this page as a sub-room.
If you want full consultation and prescriptions, go back to the Emergency Room lobby.

A hub to triage and repair noisy text inputs from scanned PDFs, images, HTML scraping, or parser drift.
Use this folder when the document looks fine to the eye but retrieval or reasoning keeps failing.


Orientation: what each page does

PageWhat it solvesTypical symptom
Layout, Headers, FootersRemove noise from margins and repeated textAnswers reference “page 3 footer” instead of body
Tokenization & CasingNormalize Unicode, case, and hyphensE-mailEmail, half-width/full-width mismatch
Tables & ColumnsPreserve table schema and cell orderNumbers drift across columns
Images & FiguresOCR and align captionsFigure text missing or attached to wrong section
Scanned PDFs & QualityHandle skewed/blurred pagesWhole sections unreadable to OCR
Multi-language & FontsNormalize mixed scriptsChinese/English tokens split or duplicated

When to use

  • OCR tables or citations look visually correct but answers miss the right section.
  • Code blocks or math collapse after parsing.
  • Mixed-language documents behave inconsistently.
  • Special characters or hyphen splits break tokens.
  • Headers or section anchors disappear during export.

FAQ

Why does OCR “look fine” but retrieval fails?
Because tokenization and indexing see hidden breaks (Unicode variants, line merges, wrong anchors) that humans overlook.

What is the most common root cause?
Headers/footers leaking into the body and breaking ΔS alignment.

Do I need to retrain embeddings after fixing?
No — most fixes are structural (schema/normalization). Re-indexing with the same embeddings is enough.


Acceptance targets

  • ΔS(question, retrieved) ≤ 0.45 for three paraphrases.
  • Coverage ≥ 0.70 for the target section.
  • λ_observe convergent across two seeds.
  • Human audit shows no missing headers, captions, or broken tables.

Fix in 60 seconds

  1. Ground-truth one page
    Pick one Q/A pair and keep a screenshot baseline.

  2. Measure ΔS
    Log ΔS(question, retrieved) and ΔS(retrieved, anchor).

  3. Probe λ_observe
    Ask for cite-first. If citation fails but free explanation works, drift confirmed.

  4. Patch minimally

    • Re-run OCR with line/table fences
    • Normalize casing and Unicode
    • Preserve anchors, math, captions
    • Drop low-confidence spans and export with {section_id, page_no, char_span}

🔗 Quick-Start Downloads (60 sec)

ToolLink3-Step Setup
WFGY 1.0 PDFEngine Paper1️⃣ Download · 2️⃣ Upload · 3️⃣ Ask “Answer using WFGY +
TXT OSTXTOS.txt1️⃣ Download · 2️⃣ Paste into LLM · 3️⃣ Type “hello world” — OS boots instantly

Explore More

LayerPageWhat it’s for
⭐ ProofWFGY Recognition MapExternal citations, integrations, and ecosystem proof
⚙️ EngineWFGY 1.0Original PDF tension engine and early logic sketch (legacy reference)
⚙️ EngineWFGY 2.0Production tension kernel for RAG and agent systems
⚙️ EngineWFGY 3.0TXT based Singularity tension engine (131 S class set)
🗺️ MapProblem Map 1.0Flagship 16 problem RAG failure taxonomy and fix map
🗺️ MapProblem Map 2.0Global Debug Card for RAG and agent pipeline diagnosis
🗺️ MapProblem Map 3.0Global AI troubleshooting atlas and failure pattern map
🧰 AppTXT OS.txt semantic OS with fast bootstrap
🧰 AppBlah Blah BlahAbstract and paradox Q&A built on TXT OS
🧰 AppBlur Blur BlurText to image generation with semantic control
🏡 OnboardingStarter VillageGuided entry point for new users

If this repository helped, starring it improves discovery so more builders can find the docs and tools.
GitHub Repo stars