A PPStructureV3-based PDF to Markdown tool focused on accurate structure recovery for complex documents.
This repository contains two conversion paths:
pdf_to_md_robust.py: a general PDF to Markdown pipeline for structure-oriented export.omnidocbench_ppstructurev3_end2end.py: an OmniDocBench-oriented exporter tuned for end-to-end benchmark evaluation.
- Lost title hierarchy after PDF parsing
- Broken table structure after export
- Wrong reading order in multi-column or mixed-layout pages
- Missing formulas, images, and chart content in Markdown output
- Structure-aware Markdown reconstruction based on PPStructureV3
- Better title, table, formula, image, and reading-order preservation
- Table export in benchmark-friendly HTML form when needed
- Slide-style bullet recovery for PPT-derived pages
- Optional OmniDocBench official end-to-end evaluation wrapper
pdf_to_md_robust.py: robust converter for local PDF workflowsrun_to_md.py: simple entry for the robust converteromnidocbench_ppstructurev3_end2end.py: benchmark-focused exporter for OmniDocBench demo pages
Install the required runtime first:
pip install paddleocrRun the robust local converter:
python run_to_md.py "your.pdf" -o ./pp_outputRun the OmniDocBench exporter:
python omnidocbench_ppstructurev3_end2end.py --clean-output --run-eval --output-dir ./omnidocbench_ppstructurev3_end2end_outputCompared with the repository demo baseline on the OmniDocBench demo set:
| Metric | Baseline | This Project |
|---|---|---|
| Text Block Edit Distance | 0.3513 | 0.0479 |
| Display Formula Edit Distance | 0.3189 | 0.1568 |
| Table TEDS | 0.7838 | 0.8322 |
| Table Edit Distance | 0.2027 | 0.0826 |
| Reading Order Edit Distance | 0.1613 | 0.0128 |
Notes:
Edit_distis lower-is-better.TEDSis higher-is-better.
PPStructureV3-based PDF to Markdown converter with robust layout, table, and formula recovery.