FinReportParser extracts text, tables, formulas, and charts from Chinese financial research PDFs into clean Markdown and structured JSON. It runs locally on a laptop — no GPU required.
Apache-2.0 license · Python + Rust · v0.5.0
FinReportParser evaluates each page and picks the right tool for the job:
- Text pages → PyMuPDF extracts the digital text layer directly. Fast and zero-cost.
- Complex layouts (tables, multi-column, charts) → DocLayout-YOLO classifies regions, PaddleOCR recovers text, PP-StructureV3 reconstructs tables.
- Formulas → Pix2Text renders LaTeX, with fallback heuristics for inline math.
- Charts and figures → Optional edge VLM (SmolVLM-256M) describes visual content.
A page router decides the path per page at runtime. A cross-page table merger stitches split tables. A frequency-based header/footer filter strips repeated boilerplate.
| Profile | What It Does | RAM | Per-Page Speed |
|---|---|---|---|
lite |
Text layer only. No OCR, no VLM, no structure models. | ~140 MB | ~50 ms |
balanced |
Text tables first. OCR and structure models activate only when layout is complex. VLM disabled. | ~2 GB | ~3 s |
quality |
Text tables + structure fallback + edge VLM for charts. Best fidelity. | ~4 GB | ~8 s |
Profile is auto-detected from hardware (--profile auto) or set explicitly: --profile lite, --profile balanced, --profile quality.
| Benchmark | FinReportParser | Baseline |
|---|---|---|
| olmOCR-Bench (layout) | 54.32% | PyMuPDF 16.57% |
| Document completeness (400 docs) | 100% (407/407) | 0 failures |
| Token recall (400 docs) | 1.00 | 0 crashes |
200 Chinese + 200 English financial PDFs. Balanced profile, MacBook Pro M-series, 16 GB RAM.
Python 3.11+ required. Use uv for dependency management.
git clone https://github.com/weisshymmnos/finpdfpro.git
cd finpdfpro
uv sync --extra edgeThe edge extra includes PaddleOCR and SmolVLM — everything needed for the quality profile. For lite-only usage, skip extras:
uv sync# Lite: text layer only, under 2 seconds
uv run finreportparser parse report.pdf --profile lite --out ./output
# Balanced: the default production profile
uv run finreportparser parse report.pdf --profile balanced --out ./output
# Quality: full pipeline with VLM chart descriptions
uv run finreportparser parse report.pdf --profile quality --out ./outputOutput lands in ./output/{pdf_stem}/:
{pdf_stem}.md— clean Markdown{pdf_stem}.json— structured blocks with bounding boxes and type annotationscontent_list.json— MinerU-compatible intermediate format
Batch processing:
uv run finreportparser batch ./pdfs --profile balanced --workers 2Resume interrupted jobs from cache:
uv run finreportparser parse report.pdf --resumeTwo stacks, one project:
| Stack | Language | Role |
|---|---|---|
src/finreportparser/ |
Python | Full pipeline: routing, OCR, structure, VLM, batch, cache |
crates/finreportparser/ |
Rust | Lite core: text layer extraction, table repair, Markdown/JSON output |
The Rust binary (finreportparser-rs) is a self-contained CLI for the lite profile. It shares fixture expectations with the Python stack but does not call into it.
page → text_layer → layout_route → [text_tables | ocr | structure | vlm]
↘ reading_order → headers/footers → repair → emit (md, json)
Heavy models (PP-StructureV3, VLM, MinerU) are never loaded simultaneously. A memory co-residency matrix enforces sequential execution to stay within 16 GB.
All options are available via CLI flags or a YAML config file:
uv run finreportparser parse report.pdf \
--table-backend paddle \
--vlm-backend edge \
--formula-backend pix2text \
--workers 2Key backends:
| Flag | Options | Notes |
|---|---|---|
--table-backend |
paddle, mineru |
PP-StructureV3 is the default |
--vlm-backend |
none, edge, paddle_vl, smolvlm, llamacpp_http |
edge = SmolVLM classify + OCR fusion |
--formula-backend |
none, l1 (heuristic), pix2text, auto |
l1 is fast; pix2text is accurate for LaTeX |
--workers |
1 – 4 |
Per-page parallelism |
See uv run finreportparser --help for the full list.
- Architecture notes — pipeline design, memory matrix, error taxonomy
- Quality modes — profile details and tradeoffs
- Evaluation framework — benchmark methodology and corpus
- Contributing guide
Apache-2.0. See LICENSE.
FinReportParser 将中文金融研报 PDF 提取为干净的 Markdown 和结构化 JSON,支持文本、表格、公式和图表。在普通笔记本电脑上本地运行,无需 GPU。
Apache-2.0 协议 · Python + Rust 双栈 · v0.5.0
FinReportParser 逐页评估页面复杂度,为每页选择最合适的提取方式:
- 纯文本页面 → PyMuPDF 直接提取数字文本层,速度快,零额外开销。
- 复杂版面(表格、多栏、图表)→ DocLayout-YOLO 进行区域分类,PaddleOCR 识别文字,PP-StructureV3 重建表格结构。
- 公式 → Pix2Text 渲染 LaTeX,辅以内联公式启发式回退规则。
- 图表 → 可选端侧 VLM(SmolVLM-256M)生成图表文字描述。
页面路由器在运行时动态决定每页的处理路径。跨页表格合并器自动拼接被页缝拆分的表格。基于词频的页眉页脚过滤器剔除重复出现的固定文案。
| 预设 | 说明 | 内存 | 每页耗时 |
|---|---|---|---|
lite |
纯文本层提取,不加载 OCR/VLM/结构模型 | ~140 MB | ~50 ms |
balanced |
优先文本表格,仅在排版复杂时激活 OCR 和结构模型,VLM 关闭 | ~2 GB | ~3 s |
quality |
文本表格 + 结构回退 + 端侧 VLM 图表分析,最高还原度 | ~4 GB | ~8 s |
预设会根据硬件自动选择(--profile auto),也可手动指定:--profile lite、--profile balanced、--profile quality。
| 评测基准 | FinReportParser | 基线对比 |
|---|---|---|
| olmOCR-Bench(版面) | 54.32% | PyMuPDF 16.57% |
| 文档完整率(400 份语料) | 100%(407/407) | 0 失败 |
| Token 召回率(400 份语料) | 1.00 | 0 崩溃 |
200 份中文 + 200 份英文金融 PDF,balanced 预设,MacBook Pro M 系列,16 GB 内存。
需要 Python 3.11+,推荐使用 uv 管理依赖。
git clone https://github.com/weisshymmnos/finpdfpro.git
cd finpdfpro
uv sync --extra edgeedge 扩展包含 PaddleOCR 和 SmolVLM,满足 quality 预设的全部需求。仅使用 lite 路径可跳过扩展:
uv sync# Lite:纯文本层提取,2 秒以内
uv run finreportparser parse report.pdf --profile lite --out ./output
# Balanced:生产环境默认预设
uv run finreportparser parse report.pdf --profile balanced --out ./output
# Quality:完整流水线,含 VLM 图表描述
uv run finreportparser parse report.pdf --profile quality --out ./output输出位于 ./output/{pdf_stem}/:
{pdf_stem}.md— 清理后的 Markdown{pdf_stem}.json— 带边界框和类型标注的结构化块content_list.json— 兼容 MinerU 的中间格式
批量处理:
uv run finreportparser batch ./pdfs --profile balanced --workers 2从中断处恢复:
uv run finreportparser parse report.pdf --resume双栈设计:
| 技术栈 | 语言 | 职责 |
|---|---|---|
src/finreportparser/ |
Python | 完整流水线:路由、OCR、结构分析、VLM、批量、缓存 |
crates/finreportparser/ |
Rust | Lite 核心:文本层提取、表格修复、Markdown/JSON 输出 |
Rust 二进制文件(finreportparser-rs)是 lite 预设的独立 CLI 实现,与 Python 栈共享测试预期,但不调用 Python。
页面 → 文本层提取 → 版面路由 → [文本表格 | OCR | 结构分析 | VLM]
↘ 阅读顺序 → 页眉页脚剔除 → 修复 → 输出(md, json)
重型模型(PP-StructureV3、VLM、MinerU)不会同时加载。内存隔离矩阵确保串行执行,将总占用控制在 16 GB 以内。
所有选项均可通过 CLI 参数或 YAML 配置文件指定:
uv run finreportparser parse report.pdf \
--table-backend paddle \
--vlm-backend edge \
--formula-backend pix2text \
--workers 2主要后端选项:
| 参数 | 可选值 | 说明 |
|---|---|---|
--table-backend |
paddle、mineru |
默认 PP-StructureV3 |
--vlm-backend |
none、edge、paddle_vl、smolvlm、llamacpp_http |
edge = SmolVLM 分类 + OCR 融合 |
--formula-backend |
none、l1(启发式)、pix2text、auto |
l1 速度快;pix2text LaTeX 精度高 |
--workers |
1 – 4 |
逐页并行度 |
运行 uv run finreportparser --help 查看完整参数列表。
Apache-2.0。详见 LICENSE。