pdf-wzq · PDF 多模态教学知识库自动化构建
把 PDF(讲义/扫描教材/PPTX 转换件)自动转化为图文并茂的多模态教学知识库: 页级文本 + 公式 LaTeX + 图片集 + 图片 AI 理解 + 教材文案 + 图文绑定 JSON。 与 pptx-wzq、word-wzq 同构——指令、流程、产物协议完全一致。
四型自动适配(PageExtractor)
| 类型 | 判定 | 处理 |
|---|---|---|
| A 文本层 PDF | 前 3 页 get_text > 200 字符 | 文本层提取(坐标排序+页眉页脚剔除) |
| B 纯图/扫描 PDF | 全部无文本层 | 渲染 300DPI + OCR/整页视觉理解 |
| C PPTX 转 PDF | 有文本层 + 整页大图占比高 | 文本层+视觉双路融合(needs_review) |
| D 混合型 | 文本页+图像页并存 | 逐页分流合并 |
安装
pip install pdf-wzq
pip install "pdf-wzq[ocr]" # 扫描件中文 OCR(PaddleOCR,可选)
许可证:核心依赖 PyMuPDF 为 AGPL-3.0,与主许可 MIT 叠加请在商用/闭源前自行评估(备选 pypdfium2 Apache)。
快速开始
# 一条命令完整流水线(自动装依赖 / 引导 Key / 预估 Token / 确认)
pdf-paser 半导体器件讲义.pdf -o 讲义输出
# 结果目录:images/ + <名>_captions.md + <名>_textbook.md + <名>_binding.json
# 分步执行
pdf-text 讲义.pdf -o out --ocr-engine paddle # 纯图页 OCR
pdf-formula 讲义.pdf -o out
pdf-img 讲义.pdf -o out
pdf-caption out/images -o cap.md --texts out/texts.md --formulas out/formulas.md
pdf-author --texts out/texts.md --formulas out/formulas.md --captions cap.md -o textbook.md
pdf-bind out -o binding.json --textbook textbook.md --images-dir out/images
指令一览
| 命令 | 功能 | 模型 | Token |
|---|---|---|---|
pdf-text |
页级文本(坐标排序+页眉页脚+OCR 降级) | — | 0 |
pdf-formula |
公式区域定位+视觉/OCR 识别→LaTeX | qwen3.7-plus/pix2tex | 有/0 |
pdf-img |
页级图片提取+过滤+区域渲染 | — | 0 |
pdf-caption |
图片 AI 解读(文档上下文模式) | qwen3.7-plus | 有 |
pdf-author |
教材文案(学科推断+分批) | deepseek-v4-flash | 有 |
pdf-bind |
页级图文绑定 JSON | — | 0 |
pdf-paser |
整体编排(四型适配+Token 预估) | — | — |
作者
吴振谦 · wuzhenqian@nbu.edu.cn · QQ:38328063
Metadata
Release files for pdf-wzq 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pdf_wzq-1.0.1.tar.gz | 32.0 kB | Without provenance | Details for pdf_wzq-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pdf_wzq-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for pdf_wzq-1.0.1-py3-none-any.whl |
Total release size: 71.5 kB
Release files / pdf_wzq-1.0.1.tar.gz
| Download URL | pdf_wzq-1.0.1.tar.gz |
|---|---|
| Size | 32.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
38c32bd433cb6466070fa36edd28799383d18a62a9e57d2c2605453ae543821e
|
|
BLAKE2b-256 checksum How to use checksums |
c8347dfbbdca76af3fe840c2bc0a59aadc730f686a35f234fbb48c653752e503
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Release files / pdf_wzq-1.0.1-py3-none-any.whl
| Download URL | pdf_wzq-1.0.1-py3-none-any.whl |
|---|---|
| Size | 39.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86252edb32e75e2e3d04486cb33367bdcc0129572daf75e700262cf4f35a0593
|
|
BLAKE2b-256 checksum How to use checksums |
a6176e6618a3fd239b25693001475d265d7dabdf887784b8f60a6e63cc569ad3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Security for pdf-wzq 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.