No description
Find a file
LLLin000 e0260a8188 feat: recover 'Figure N' heading prefix from PDF text layer for OCR-missed captions
When PaddleOCR fails to detect a standalone 'Figure N' / 'FIGURE N'
heading (rendered in a bold/small-caps font that the OCR engine doesn't
read), the caption body is captured as figure_caption_candidate but
lacks the figure number prefix. The new _recover_figure_heading_prefix()
function checks the PDF text layer (via existing page_pdf_lines_by_page
infrastructure — no extra PDF open) and prepends the heading.

Key logic:
- Scans PDF text lines on the same page for 'Figure N' headings
- Confirms by checking if the NEXT PDF line (by y-order) shares ≥15
  chars of common prefix with the OCR caption candidate text
- Only runs when _extract_figure_number() returns None (no figure
  number in existing caption text)
- Integrated into build_figure_inventory() before _is_formal_legend()
  check, so recovered captions enter the legend matching pool

Fixes 'FIGURE 1' loss in 5S7UI34M and 'FIGURE 5' loss in HQAQBSBP.
372 figure tests pass.
2026-07-03 01:46:40 +08:00
.agents/skills A2: check table ownership (consumed_table_block_keys) before _SKIPPED_BODY_ROLES in render loop 2026-06-25 22:27:35 +08:00
.github test: clean up brittle and low-value tests 2026-05-24 20:00:47 +08:00
.husky Add pre-commit hooks (husky + lint-staged + prettier) 2026-06-25 16:42:34 +08:00
.omp fix: support Roman numeral and S-prefix table captions across roles/signatures/tables 2026-07-02 00:47:18 +08:00
.opencode fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
.planning fix: support Roman numeral and S-prefix table captions across roles/signatures/tables 2026-07-02 00:47:18 +08:00
.tmp/tail_pdf_samples feat(ocr): tail regime remediation + style-aware heading profiles + boundary detection 2026-06-05 22:47:13 +08:00
audit feat: recover 'Figure N' heading prefix from PDF text layer for OCR-missed captions 2026-07-03 01:46:40 +08:00
docs fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
fixtures feat: surface OCR structured health in doctor and status 2026-06-05 10:35:23 +08:00
node_modules A2: check table ownership (consumed_table_block_keys) before _SKIPPED_BODY_ROLES in render loop 2026-06-25 22:27:35 +08:00
paperforge feat: recover 'Figure N' heading prefix from PDF text layer for OCR-missed captions 2026-07-03 01:46:40 +08:00
project docs: record round 2 truth audit + 3 bug fixes for 37LK5T97 2026-07-02 15:02:42 +08:00
scripts fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
tests fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
.gitignore chore: add .ai-bridge/ to gitignore (codexpro temp files) 2026-06-19 16:22:31 +08:00
.pre-commit-config.yaml chore: add PR template + pre-commit config (ruff auto-format) 2026-05-10 12:04:12 +08:00
_amb_detail.py fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
_check_effect.py feat(ocr): journal layout generalization, OCR diagnostics, and debug scripts 2026-06-06 00:46:49 +08:00
_chk_pdf.py fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
_chk_vfs_p11.py fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
_extract_master_figs.py feat(ocr): journal layout generalization, OCR diagnostics, and debug scripts 2026-06-06 00:46:49 +08:00
_figmap.json fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
_final_stats.py fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
_master_funcs.txt feat(ocr): journal layout generalization, OCR diagnostics, and debug scripts 2026-06-06 00:46:49 +08:00
_render_full.py feat(ocr): journal layout generalization, OCR diagnostics, and debug scripts 2026-06-06 00:46:49 +08:00
_test_6qnr.py fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
AGENTS.md project: update P1 status to COMMITTED, add knowledge graph section to AGENTS.md 2026-06-28 21:20:17 +08:00
CHANGELOG.md docs: CHANGELOG 1.5.9 - tail rendering fix 2026-06-17 01:33:21 +08:00
CONTRIBUTING.md docs: add CONTRIBUTING.md — sync fork guide and PR checklist 2026-05-10 12:02:07 +08:00
INSTALLATION.md docs: replace git+https install URLs with pip install paperforge (PyPI) 2026-05-11 19:25:38 +08:00
LICENSE docs: add CC BY-NC-SA 4.0 license and acknowledgments 2026-05-01 11:37:50 +08:00
local-page_trace.md feat: recover 'Figure N' heading prefix from PDF text layer for OCR-missed captions 2026-07-03 01:46:40 +08:00
loss_survey_expanded.md feat: recover 'Figure N' heading prefix from PDF text layer for OCR-missed captions 2026-07-03 01:46:40 +08:00
manifest.json bump: 1.5.14 -> 1.5.15 2026-06-01 19:46:46 +08:00
OCR-V2-READINESS-SUMMARY.md docs: add OCR-v2 readiness summary for agent handoff 2026-06-19 00:44:00 +08:00
package-lock.json Add pre-commit hooks (husky + lint-staged + prettier) 2026-06-25 16:42:34 +08:00
package.json Add pre-commit hooks (husky + lint-staged + prettier) 2026-06-25 16:42:34 +08:00
paperforge.json refactor: __init__.py as single version source; pyproject.toml reads dynamically; paperforge.json drops version field 2026-04-28 22:41:48 +08:00
PROJECT-MANAGEMENT.md docs: record round 2 truth audit + 3 bug fixes for 37LK5T97 2026-07-02 15:02:42 +08:00
pyproject.toml chore: remove sentence-transformers from [vector] extra 2026-05-18 17:24:29 +08:00
README.en.md docs: reset documentation IA (readme entry pages, tutorial/troubleshooting split, AGENTS agent-only, pure command ref, maintainer guide) 2026-05-16 22:47:00 +08:00
README.md docs: reset documentation IA (readme entry pages, tutorial/troubleshooting split, AGENTS agent-only, pure command ref, maintainer guide) 2026-05-16 22:47:00 +08:00
README.zh-CN.md docs: redesign README with banner and dashboard preview 2026-05-02 14:52:59 +08:00
README.zh.md docs: expand memory and embedding layer description in architecture 2026-05-19 02:07:53 +08:00
requirements.txt fix: add textual to requirements.txt 2026-04-23 00:09:00 +08:00
REVIEW.md docs: update REVIEW and coverage ledger 2026-06-19 15:20:15 +08:00
skills-lock.json A2: check table ownership (consumed_table_block_keys) before _SKIPPED_BODY_ROLES in render loop 2026-06-25 22:27:35 +08:00

PaperForge banner

PaperForge

Version Python License

简体中文 · English

铸知识为器,启洞见之明。 — Forge Knowledge, Empower Insight.

PaperForge brings your Zotero library into Obsidian. Sync papers, run OCR, extract figures, and do AI-assisted deep reading — all inside a single vault.


0. What PaperForge Is

PaperForge is not just an Obsidian plugin. It has two parts:

Part What Does Where
Obsidian Plugin main.js + manifest.json + styles.css Dashboard, buttons, settings UI .obsidian/plugins/paperforge/ in your vault
Python Package paperforge Sync, OCR, Doctor, repair Your system Python (pip install)

The plugin is the interface. The Python package is the engine. Every button you click in the plugin actually runs a Python command behind the scenes.

After installing the plugin, you MUST verify that the Python package is also installed and version-matched.


1. Install the Obsidian Plugin

  1. Install BRAT from the Obsidian community plugin browser
  2. Open BRAT settings → Add Beta Plugin
  3. Enter: https://github.com/LLLin000/PaperForge
  4. BRAT downloads the latest main.js, manifest.json, and styles.css and installs them
  5. Settings → Community Plugins → enable PaperForge

BRAT auto-detects GitHub Release updates. No manual downloads needed.

Option B: Manual Download

  1. Go to Releases
  2. Download the three files: main.js, manifest.json, styles.css
  3. Create .obsidian/plugins/paperforge/ in your vault
  4. Put the three files there
  5. Restart Obsidian → Settings → Community Plugins → enable PaperForge

Manual install does not auto-update. You'll need to re-download for each new version.


2. Install the Python Package

After enabling the plugin, open the PaperForge settings tab. You'll see a Runtime Status section:

Plugin v1.5.0 → Python Package v1.5.0 ✓ Matched
  • If it says "Not installed" → click Open Wizard to re-run the setup process
  • If it says "Mismatch" → the Python package auto-updates when the plugin updates. If it didn't succeed, click Update Runtime to manually trigger

3. Quickstart

# 1. Export from Zotero (Better BibTeX JSON, Keep updated) to exports/
# 2. Sync
paperforge sync

# 3. Mark a paper for OCR in its frontmatter: do_ocr: true
# 4. Run OCR
paperforge ocr

# 5. Mark for deep reading: analyze: true
# 6. In your Agent chat:
/pf-deep <zotero_key>

Documentation

If you want to Read
Full tutorial, from install to deep read Getting Started
Troubleshooting Troubleshooting
Command reference Commands
How to update Update Guide
Architecture / Maintenance / Release Architecture
AI Agent collaboration AGENTS.md

License

CC BY-NC-SA 4.0. Non-commercial use only.

Acknowledgments

Built on PaddleOCR, Obsidian, Better BibTeX for Zotero, and other great open-source projects.