WFGY/ProblemMap/GlobalFixMap/OCR_Parsing/images_and_figures.md
2025-09-05 11:34:19 +08:00

8.3 KiB
Raw Blame History

Images and Figures: OCR Parsing Guardrails

🧭 Quick Return to Map

You are in a sub-page of OCR_Parsing.
To reorient, go back here:

Think of this page as a desk within a ward.
If you need the full triage and all prescriptions, return to the Emergency Room lobby.

Stabilize text extraction around inline images, charts, and figures. Prevent figure captions or axis labels from bleeding into body text, and preserve semantic anchors for later retrieval.

Open these first

Acceptance targets

  • ΔS(question, retrieved) ≤ 0.45 on captioned answers
  • Coverage ≥ 0.70 for questions tied to figure anchors
  • λ remains convergent across three paraphrases
  • Captions and labels stored separately from body text

Typical failure signatures → fix

  • Figure captions merged with paragraphs
    Split by bbox banding and assign figure_caption. Keep paragraph tokens clean.

  • Axis labels or legend entries treated as running text
    Extract into figure_metadata.axis_labels and figure_metadata.legend. Never merge into narrative.

  • Scanned figure with embedded text
    Route figure OCR separately. Keep figure_id, text_extracted, and bounding box. Tie back to figure image reference.

  • Multi-column figure bleed
    If caption spans columns, capture as caption block, not as content. Anchor to figure_id.

  • Images with no OCR text
    Provide stub with figure_id, bbox, and alt_text if known. Maintain traceability.


Fix in 60 seconds

  1. Detect figure zones
    Identify bounding boxes flagged as images or graphics. Assign figure_id.

  2. Isolate captions
    If text appears immediately above/below the figure and repeats formatting (italic, smaller font), tag as caption.

  3. Route labels
    Apply heuristic rules for x-axis, y-axis, legend. Store under figure_metadata.

  4. Clean narrative
    Remove all figure-related text from text_clean. Retain only in figure structures.

  5. Probe retrieval
    Ask a figure-specific question. If ΔS ≤ 0.45 and λ stable, cleanup succeeded.


Minimal recipes by engine

  • Google Document AI
    Use layout.figure and boundingPoly. Capture associated paragraph blocks as captions when within ±10% of figure bbox.

  • AWS Textract
    Detect BlockType=KEY_VALUE_SET around figure images. Treat them as labels, route into figure_metadata.

  • Azure OCR
    Use boundingRegions and detect blocks adjacent to figures. Anchor captions if directly above/below polygon.

  • ABBYY
    In XML, <block type="Picture"> + following <par> → caption. Inline text with picture coordinates goes to figure metadata.

  • PaddleOCR
    Split text lines overlapping with figure bbox. Store separately as figure text, not narrative.


Data contract additions for figures


{
"figure\_id": "fig3",
"bbox": \[x0,y0,x1,y1],
"caption": "Figure 3: Error rate across embedding sizes.",
"figure\_metadata": {
"axis\_labels": \["tokens","ΔS"],
"legend": \["baseline","with WFGY"],
"text\_extracted": "0.45, 0.30..."
},
"section\_id": "4.2",
"page": 12,
"source\_url": "..."
}

Mandatory: all figure text lives in figure_metadata or caption, never in text_clean.


Verification

  • Leak check: ensure no caption/axis strings appear in text_clean.
  • Figure QA: ask "what does fig3 show?" — answer must cite figure_id.
  • ΔS probe: figure-specific questions yield ΔS ≤ 0.45.
  • λ probe: paraphrases about same figure converge.

Copy-paste LLM prompt


You have TXT OS and WFGY Problem Map.

For figure-linked snippets:

* use text\_clean for reasoning,
* use caption and figure\_metadata for figure answers,
* cite figure\_id.

Tasks:

1. If figure text leaks into body, fail fast and return fix reference (ocr-parsing-checklist, data-contracts, retrieval-traceability).
2. Return JSON:
   { "citations":\["fig3"], "answer":"...", "λ\_state":"...", "ΔS":0.xx, "next\_fix":"..." }


🔗 Quick-Start Downloads (60 sec)

Tool Link 3-Step Setup
WFGY 1.0 PDF Engine Paper 1 Download · 2 Upload to your LLM · 3 Ask “Answer using WFGY + <your question>”
TXT OS (plain-text OS) TXTOS.txt 1 Download · 2 Paste into any LLM chat · 3 Type “hello world” — OS boots instantly

🧭 Explore More

Module Description Link
WFGY Core WFGY 2.0 engine is live: full symbolic reasoning architecture and math stack View →
Problem Map 1.0 Initial 16-mode diagnostic and symbolic fix framework View →
Problem Map 2.0 RAG-focused failure tree, modular fixes, and pipelines View →
Semantic Clinic Index Expanded failure catalog: prompt injection, memory bugs, logic drift View →
Semantic Blueprint Layer-based symbolic reasoning & semantic modulations View →
Benchmark vs GPT-5 Stress test GPT-5 with full WFGY reasoning suite View →
🧙‍♂️ Starter Village 🏡 New here? Lost in symbols? Click here and let the wizard guide you through Start →

👑 Early Stargazers: See the Hall of Fame
GitHub stars WFGY Engine 2.0 is already unlocked. Star the repo to help others discover it and unlock more on the Unlock Board.

WFGY Main   TXT OS   Blah   Blot   Bloc   Blur   Blow