docs: make Chinese README the default
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
<!-- WEHUB_ZH_README -->
|
||||
> [!NOTE]
|
||||
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
|
||||
> [English](./README.en.md) · [原始项目](https://github.com/opendataloader-project/opendataloader-pdf) · [上游 README](https://github.com/opendataloader-project/opendataloader-pdf/blob/HEAD/README.md)
|
||||
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
|
||||
|
||||
<!-- AI-AGENT-SUMMARY
|
||||
name: opendataloader-pdf
|
||||
category: PDF data extraction, PDF accessibility automation
|
||||
@@ -15,7 +21,7 @@ key-differentiators: [benchmark #1 PDF parser, deterministic output, bounding bo
|
||||
|
||||
# OpenDataLoader PDF
|
||||
|
||||
**PDF Parser for AI-ready data. Automate PDF accessibility. Open-source.**
|
||||
**面向 AI 就绪数据的 PDF 解析器。自动化 PDF 无障碍处理。开源。**
|
||||
|
||||
[](https://github.com/opendataloader-project/opendataloader-pdf/blob/main/LICENSE)
|
||||
[](https://pypi.org/project/opendataloader-pdf/)
|
||||
@@ -25,25 +31,25 @@ key-differentiators: [benchmark #1 PDF parser, deterministic output, bounding bo
|
||||
|
||||
<a href="https://trendshift.io/repositories/21917" target="_blank"><img src="https://trendshift.io/api/badge/repositories/21917" alt="opendataloader-project%2Fopendataloader-pdf | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||
|
||||
🔍 **PDF parser for AI data extraction** — Extract Markdown, JSON (with bounding boxes), and HTML from any PDF. #1 in benchmarks (0.907 overall). Deterministic local mode + AI hybrid mode for complex pages.
|
||||
🔍 **面向 AI 数据提取的 PDF 解析器** — 从任意 PDF 提取 Markdown、JSON(含边界框)和 HTML。基准测试排名第一(0.907 综合得分)。确定性本地模式 + AI 混合模式,应对复杂页面。
|
||||
|
||||
- **How accurate is it?** — #1 in benchmarks: 0.907 overall, 0.928 table accuracy across 200 real-world PDFs including multi-column and scientific papers. Deterministic local mode + AI hybrid mode for complex pages ([benchmarks](#extraction-benchmarks))
|
||||
- **Scanned PDFs and OCR?** — Yes. Built-in OCR (80+ languages) in hybrid mode. Works with poor-quality scans at 300 DPI+ ([hybrid mode](#hybrid-mode-1-accuracy-for-complex-pdfs))
|
||||
- **Tables, formulas, images, charts?** — Yes. Complex/borderless tables, LaTeX formulas, and AI-generated picture/chart descriptions all via hybrid mode ([hybrid mode](#hybrid-mode-1-accuracy-for-complex-pdfs))
|
||||
- **How do I use this for RAG?** — `pip install opendataloader-pdf`, convert in 3 lines. Outputs structured Markdown for chunking, JSON with bounding boxes for source citations, and HTML. LangChain integration available. Python, Node.js, Java SDKs ([quick start](#get-started-in-30-seconds) | [LangChain](#langchain-integration))
|
||||
- **准确度如何?** — 基准测试排名第一:综合得分 0.907,表格准确度 0.928,覆盖 200 份真实世界 PDF,包括多栏版式和科技论文。确定性本地模式 + AI 混合模式应对复杂页面([基准测试](#extraction-benchmarks))
|
||||
- **扫描版 PDF 和 OCR?** — 支持。混合模式内置 OCR(80+ 种语言)。适用于 300 DPI 及以上低质量扫描件([混合模式](#hybrid-mode-1-accuracy-for-complex-pdfs))
|
||||
- **表格、公式、图片、图表?** — 支持。复杂/无边框表格、LaTeX 公式,以及 AI 生成的图片/图表描述,均通过混合模式实现([混合模式](#hybrid-mode-1-accuracy-for-complex-pdfs))
|
||||
- **如何用于 RAG?** — `pip install opendataloader-pdf`,三行代码即可完成转换。输出结构化 Markdown 用于分块,带边界框的 JSON 用于来源引用,以及 HTML。提供 LangChain 集成。提供 Python、Node.js、Java SDK([快速开始](#get-started-in-30-seconds) | [LangChain](#langchain-integration))
|
||||
|
||||
♿ **PDF accessibility automation** — Auto-tag untagged PDFs into screen-reader-ready Tagged PDFs at scale. First open-source tool to generate Tagged PDFs end-to-end.
|
||||
♿ **PDF 无障碍自动化** — 大规模将未标注 PDF 自动标注为屏幕阅读器可用的 Tagged PDF。首个端到端生成 Tagged PDF 的开源工具。
|
||||
|
||||
- **What's the problem?** — Accessibility regulations are now enforced worldwide. Manual PDF remediation costs $50–200 per document and doesn't scale ([regulations](#pdf-accessibility--pdfua-conversion))
|
||||
- **What's free?** — Layout analysis + auto-tagging (Apache 2.0). Untagged PDF in → Tagged PDF out. No proprietary SDK dependency ([auto-tagging](#auto-tagging))
|
||||
- **What about PDF/UA compliance?** — Converting Tagged PDF to PDF/UA-1 or PDF/UA-2 is an enterprise add-on. Auto-tagging generates the Tagged PDF; PDF/UA export is the final step ([pipeline](#accessibility-pipeline))
|
||||
- **Why trust this?** — Built in collaboration with [Dual Lab](https://duallab.com) ([veraPDF](https://verapdf.org) developers) based on [PDF Association](https://pdfa.org) specifications, best practice guides and expertise of the [PDF Community](https://pdfa.org/community/). Auto-tagging follows the [Well-Tagged PDF specification](https://pdfa.org/wtpdf/), validated with veraPDF ([collaboration](https://opendataloader.org/docs/tagged-pdf-collaboration))
|
||||
- **问题是什么?** — 无障碍法规已在全球范围内强制执行。人工 PDF 修复每份文档成本 50–200 美元,且无法规模化([法规](#pdf-accessibility--pdfua-conversion))
|
||||
- **免费部分有哪些?** — 版式分析 + 自动标注(Apache 2.0)。未标注 PDF 输入 → Tagged PDF 输出。无需依赖专有 SDK([自动标注](#auto-tagging))
|
||||
- **PDF/UA 合规性如何?** — 将 Tagged PDF 转换为 PDF/UA-1 或 PDF/UA-2 属于企业版附加功能。自动标注生成 Tagged PDF;PDF/UA 导出是最后一步([流水线](#accessibility-pipeline))
|
||||
- **为何值得信赖?** — 与 [Dual Lab](https://duallab.com)([veraPDF](https://verapdf.org) 开发者)合作构建,基于 [PDF Association](https://pdfa.org) 规范、[PDF Community](https://pdfa.org/community/). 最佳实践指南与专业知识。自动标注遵循 [Well-Tagged PDF specification](https://pdfa.org/wtpdf/),,并通过 veraPDF 验证([合作](https://opendataloader.org/docs/tagged-pdf-collaboration))
|
||||
|
||||
## Get Started in 30 Seconds
|
||||
## 30 秒快速开始
|
||||
|
||||
**Requires**: Java 11+ and Python 3.10+ ([Node.js](https://opendataloader.org/docs/quick-start-nodejs) | [Java](https://opendataloader.org/docs/quick-start-java) also available)
|
||||
**要求**:Java 11+ 和 Python 3.10+(亦提供 [Node.js](https://opendataloader.org/docs/quick-start-nodejs) | [Java](https://opendataloader.org/docs/quick-start-java))
|
||||
|
||||
> Before you start: run `java -version`. If not found, install JDK 11+ from [Adoptium](https://adoptium.net/).
|
||||
> 开始之前:运行 `java -version`。若未找到,请从 [Adoptium](https://adoptium.net/). 安装 JDK 11+
|
||||
|
||||
```bash
|
||||
pip install -U opendataloader-pdf
|
||||
@@ -62,47 +68,47 @@ opendataloader_pdf.convert(
|
||||
|
||||

|
||||
|
||||
*Annotated PDF output — each element (heading, paragraph, table, image) detected with bounding boxes and semantic type.*
|
||||
*标注后的 PDF 输出 — 每个元素(标题、段落、表格、图片)均检测出边界框和语义类型。*
|
||||
|
||||
## What Problems Does This Solve?
|
||||
## 解决哪些问题?
|
||||
|
||||
| Problem | Solution | Status |
|
||||
| 问题 | 解决方案 | 状态 |
|
||||
|---------|----------|--------|
|
||||
| **PDF structure lost during parsing** — wrong reading order, broken tables, no element coordinates | Deterministic local PDF to Markdown/JSON with bounding boxes, XY-Cut++ reading order | Shipped |
|
||||
| **Complex tables, scanned PDFs, formulas, charts** need AI-level understanding | Hybrid mode routes complex pages to AI backend (#1 in benchmarks) | Shipped |
|
||||
| **Manual PDF remediation cost** — Accessibility regulations (EAA, ADA, Section 508) demand Tagged PDFs. Manual remediation costs $50–200/doc | Auto-tag untagged PDFs into Tagged PDFs (free, Apache 2.0). Foundation for PDF/UA workflows; full PDF/UA-1/2 export is an enterprise add-on | Auto-tag: Shipped. PDF/UA export: Enterprise |
|
||||
| **解析时 PDF 结构丢失** — 阅读顺序错误、表格破损、无元素坐标 | 确定性本地 PDF 转 Markdown/JSON(含边界框),XY-Cut++ 阅读顺序 | 已发布 |
|
||||
| **复杂表格、扫描版 PDF、公式、图表** 需要 AI 级理解 | 混合模式将复杂页面路由至 AI 后端(基准测试排名第一) | 已发布 |
|
||||
| **人工 PDF 修复成本高** — 无障碍法规(EAA、ADA、Section 508)要求 Tagged PDF。人工修复每份 50–200 美元 | 自动将未标注 PDF 标注为 Tagged PDF(免费,Apache 2.0)。PDF/UA 工作流的基础;完整 PDF/UA-1/2 导出为企业版附加功能 | 自动标注:已发布。PDF/UA 导出:企业版 |
|
||||
|
||||
## Capability Matrix
|
||||
## 能力矩阵
|
||||
|
||||
| Capability | Supported | Tier |
|
||||
| 能力 | 支持 | 层级 |
|
||||
|------------|-----------|------|
|
||||
| **Data extraction** | | |
|
||||
| Extract text with correct reading order | Yes | Free |
|
||||
| Bounding boxes for every element | Yes | Free |
|
||||
| Table extraction (simple borders) | Yes | Free |
|
||||
| Table extraction (complex/borderless) | Yes | Free (Hybrid) |
|
||||
| Heading hierarchy detection | Yes | Free |
|
||||
| List detection (numbered, bulleted, nested) | Yes | Free |
|
||||
| Image extraction with coordinates | Yes | Free |
|
||||
| AI chart/image description | Yes | Free (Hybrid) |
|
||||
| OCR for scanned PDFs | Yes | Free (Hybrid) |
|
||||
| Formula extraction (LaTeX) | Yes | Free (Hybrid) |
|
||||
| Tagged PDF structure extraction | Yes | Free |
|
||||
| AI safety (prompt injection filtering) | Yes | Free |
|
||||
| Header/footer/watermark filtering | Yes | Free |
|
||||
| **Accessibility** | | |
|
||||
| Auto-tagging → Tagged PDF for untagged PDFs | Yes | Free (Apache 2.0) |
|
||||
| PDF/UA-1, PDF/UA-2 export | 💼 Available | Enterprise |
|
||||
| Accessibility studio (visual editor) | 💼 Available | Enterprise |
|
||||
| **Limitations** | | |
|
||||
| Process Word/Excel/PPT | No | — |
|
||||
| GPU required | No | — |
|
||||
| **数据提取** | | |
|
||||
| 按正确阅读顺序提取文本 | 是 | 免费 |
|
||||
| 每个元素的边界框 | 是 | 免费 |
|
||||
| 表格提取(简单边框) | 是 | 免费 |
|
||||
| 表格提取(复杂/无边框) | 是 | 免费(Hybrid) |
|
||||
| 标题层级检测 | 是 | 免费 |
|
||||
| 列表检测(编号、项目符号、嵌套) | 是 | 免费 |
|
||||
| 带坐标的图片提取 | 是 | 免费 |
|
||||
| AI 图表/图片描述 | 是 | 免费(Hybrid) |
|
||||
| 扫描版 PDF 的 OCR | 是 | 免费(Hybrid) |
|
||||
| 公式提取(LaTeX) | 是 | 免费(Hybrid) |
|
||||
| Tagged PDF 结构提取 | 是 | 免费 |
|
||||
| AI 安全(提示注入过滤) | 是 | 免费 |
|
||||
| 页眉/页脚/水印过滤 | 是 | 免费 |
|
||||
| **无障碍** | | |
|
||||
| 自动标注 → 将未标注 PDF 转为 Tagged PDF | 是 | 免费(Apache 2.0) |
|
||||
| PDF/UA-1、PDF/UA-2 导出 | 💼 可用 | 企业版 |
|
||||
| 无障碍工作室(可视化编辑器) | 💼 可用 | 企业版 |
|
||||
| **限制** | | |
|
||||
| 处理 Word/Excel/PPT | 否 | — |
|
||||
| 需要 GPU | 否 | — |
|
||||
|
||||
## Extraction Benchmarks
|
||||
## 提取基准测试
|
||||
|
||||
**opendataloader-pdf [hybrid] ranks #1 overall (0.907)** across reading order, table, and heading extraction accuracy.
|
||||
**opendataloader-pdf [hybrid] 综合排名第一(0.907)**,涵盖阅读顺序、表格和标题提取准确度。
|
||||
|
||||
| Engine | Overall | Reading Order | Table | Heading | Speed (s/page) | License |
|
||||
| 引擎 | 综合 | 阅读顺序 | 表格 | 标题 | 速度(秒/页) | 许可证 |
|
||||
|--------|---------|---------------|-------|---------|----------------|---------|
|
||||
| **opendataloader [hybrid]** | **0.907** | **0.934** | **0.928** | 0.821 | 0.463 | Apache-2.0 |
|
||||
| nutrient | 0.885 | 0.925 | 0.708 | 0.819 | **0.008** | Commercial |
|
||||
@@ -117,25 +123,25 @@ opendataloader_pdf.convert(
|
||||
| markitdown | 0.589 | 0.844 | 0.273 | 0.000 | 0.114 | MIT |
|
||||
| liteparse | 0.576 | 0.866 | 0.000 | 0.000 | 1.061 | Apache-2.0 |
|
||||
|
||||
> Scores normalized to [0, 1]. Higher is better for accuracy; lower is better for speed. **Bold** = best. [Full benchmark details](https://github.com/opendataloader-project/opendataloader-bench)
|
||||
> 分数已归一化到 [0, 1]。准确度越高越好;速度越低越好。**粗体** = 最佳。[完整基准测试详情](https://github.com/opendataloader-project/opendataloader-bench)
|
||||
|
||||
[](https://github.com/opendataloader-project/opendataloader-bench)
|
||||
|
||||
[](https://github.com/opendataloader-project/opendataloader-bench)
|
||||
|
||||
## Which Mode Should I Use?
|
||||
## 我该用哪种模式?
|
||||
|
||||
| Your Document | Mode | Install | Server Command | Client Command |
|
||||
| 你的文档 | 模式 | 安装 | 服务端命令 | 客户端命令 |
|
||||
|---------------|------|---------|----------------|----------------|
|
||||
| Standard digital PDF | Fast (default) | `pip install opendataloader-pdf` | None needed | `opendataloader-pdf file1.pdf file2.pdf folder/` |
|
||||
| Complex or nested tables | **Hybrid** | `pip install "opendataloader-pdf[hybrid]"` | `opendataloader-pdf-hybrid --port 5002` | `opendataloader-pdf --hybrid docling-fast file1.pdf file2.pdf folder/` |
|
||||
| Scanned / image-based PDF | Hybrid + OCR | `pip install "opendataloader-pdf[hybrid]"` | `opendataloader-pdf-hybrid --port 5002 --force-ocr` | `opendataloader-pdf --hybrid docling-fast file1.pdf file2.pdf folder/` |
|
||||
| Non-English scanned PDF | Hybrid + OCR | `pip install "opendataloader-pdf[hybrid]"` | `opendataloader-pdf-hybrid --port 5002 --force-ocr --ocr-lang "ko,en"` | `opendataloader-pdf --hybrid docling-fast file1.pdf file2.pdf folder/` |
|
||||
| Mathematical formulas | Hybrid + formula | `pip install "opendataloader-pdf[hybrid]"` | `opendataloader-pdf-hybrid --enrich-formula` | `opendataloader-pdf --hybrid docling-fast --hybrid-mode full file1.pdf file2.pdf folder/` |
|
||||
| Charts needing description | Hybrid + picture | `pip install "opendataloader-pdf[hybrid]"` | `opendataloader-pdf-hybrid --enrich-picture-description` | `opendataloader-pdf --hybrid docling-fast --hybrid-mode full file1.pdf file2.pdf folder/` |
|
||||
| Untagged PDFs needing accessibility | Auto-tagging → Tagged PDF | `pip install opendataloader-pdf` | None needed | `opendataloader-pdf --format tagged-pdf file1.pdf file2.pdf folder/` |
|
||||
| 标准数字 PDF | Fast(默认) | `pip install opendataloader-pdf` | 无需 | `opendataloader-pdf file1.pdf file2.pdf folder/` |
|
||||
| 复杂或嵌套表格 | **Hybrid** | `pip install "opendataloader-pdf[hybrid]"` | `opendataloader-pdf-hybrid --port 5002` | `opendataloader-pdf --hybrid docling-fast file1.pdf file2.pdf folder/` |
|
||||
| 扫描件 / 基于图像的 PDF | Hybrid + OCR | `pip install "opendataloader-pdf[hybrid]"` | `opendataloader-pdf-hybrid --port 5002 --force-ocr` | `opendataloader-pdf --hybrid docling-fast file1.pdf file2.pdf folder/` |
|
||||
| 非英文扫描 PDF | Hybrid + OCR | `pip install "opendataloader-pdf[hybrid]"` | `opendataloader-pdf-hybrid --port 5002 --force-ocr --ocr-lang "ko,en"` | `opendataloader-pdf --hybrid docling-fast file1.pdf file2.pdf folder/` |
|
||||
| 数学公式 | Hybrid + formula | `pip install "opendataloader-pdf[hybrid]"` | `opendataloader-pdf-hybrid --enrich-formula` | `opendataloader-pdf --hybrid docling-fast --hybrid-mode full file1.pdf file2.pdf folder/` |
|
||||
| 需要描述的图表 | Hybrid + picture | `pip install "opendataloader-pdf[hybrid]"` | `opendataloader-pdf-hybrid --enrich-picture-description` | `opendataloader-pdf --hybrid docling-fast --hybrid-mode full file1.pdf file2.pdf folder/` |
|
||||
| 需要无障碍的无标签 PDF | Auto-tagging → Tagged PDF | `pip install opendataloader-pdf` | 无需 | `opendataloader-pdf --format tagged-pdf file1.pdf file2.pdf folder/` |
|
||||
|
||||
## Quick Start
|
||||
## 快速开始
|
||||
|
||||
### Python
|
||||
|
||||
@@ -178,30 +184,30 @@ await convert(['file1.pdf', 'file2.pdf', 'folder/'], {
|
||||
</dependency>
|
||||
```
|
||||
|
||||
[Python Quick Start](https://opendataloader.org/docs/quick-start-python) | [Node.js Quick Start](https://opendataloader.org/docs/quick-start-nodejs) | [Java Quick Start](https://opendataloader.org/docs/quick-start-java)
|
||||
[Python 快速开始](https://opendataloader.org/docs/quick-start-python) | [Node.js 快速开始](https://opendataloader.org/docs/quick-start-nodejs) | [Java 快速开始](https://opendataloader.org/docs/quick-start-java)
|
||||
|
||||
## Hybrid Mode: #1 Accuracy for Complex PDFs
|
||||
## Hybrid 模式:复杂 PDF 的 #1 准确度
|
||||
|
||||
Hybrid mode combines fast local Java processing with AI backends. Simple pages stay local (0.02s); complex pages route to AI for +90% table accuracy.
|
||||
Hybrid 模式将快速的本地 Java 处理与 AI 后端相结合。简单页面留在本地处理(0.02s);复杂页面路由到 AI,表格准确度提升 +90%。
|
||||
|
||||
```bash
|
||||
pip install -U "opendataloader-pdf[hybrid]"
|
||||
```
|
||||
|
||||
**Terminal 1** — Start the backend server:
|
||||
**终端 1** — 启动后端服务:
|
||||
|
||||
```bash
|
||||
opendataloader-pdf-hybrid --port 5002
|
||||
```
|
||||
|
||||
**Terminal 2** — Process PDFs:
|
||||
**终端 2** — 处理 PDF:
|
||||
|
||||
```bash
|
||||
# Batch all files in one call — each invocation spawns a JVM process, so repeated calls are slow
|
||||
opendataloader-pdf --hybrid docling-fast file1.pdf file2.pdf folder/
|
||||
```
|
||||
|
||||
**Python:**
|
||||
**Python:**
|
||||
|
||||
```python
|
||||
# Batch all files in one call — each convert() spawns a JVM process, so repeated calls are slow
|
||||
@@ -212,25 +218,25 @@ opendataloader_pdf.convert(
|
||||
)
|
||||
```
|
||||
|
||||
### OCR for Scanned PDFs
|
||||
### 扫描 PDF 的 OCR
|
||||
|
||||
Start the backend with `--force-ocr` for image-based PDFs with no selectable text:
|
||||
对没有可选中文本的基于图像 PDF,使用 `--force-ocr` 启动后端:
|
||||
|
||||
```bash
|
||||
opendataloader-pdf-hybrid --port 5002 --force-ocr
|
||||
```
|
||||
|
||||
For non-English documents, specify the language:
|
||||
对于非英文文档,请指定语言:
|
||||
|
||||
```bash
|
||||
opendataloader-pdf-hybrid --port 5002 --force-ocr --ocr-lang "ko,en"
|
||||
```
|
||||
|
||||
Supported languages: `en`, `ko`, `ja`, `ch_sim`, `ch_tra`, `de`, `fr`, `ar`, and more.
|
||||
支持的语言:`en`、`ko`、`ja`、`ch_sim`、`ch_tra`、`de`、`fr`、`ar`,以及更多。
|
||||
|
||||
### Formula Extraction (LaTeX)
|
||||
### 公式提取(LaTeX)
|
||||
|
||||
Extract mathematical formulas as LaTeX from scientific PDFs:
|
||||
从科学 PDF 中提取数学公式为 LaTeX:
|
||||
|
||||
```bash
|
||||
# Server: enable formula enrichment
|
||||
@@ -240,7 +246,7 @@ opendataloader-pdf-hybrid --enrich-formula
|
||||
opendataloader-pdf --hybrid docling-fast --hybrid-mode full file1.pdf file2.pdf folder/
|
||||
```
|
||||
|
||||
Output in JSON:
|
||||
JSON 输出:
|
||||
```json
|
||||
{
|
||||
"type": "formula",
|
||||
@@ -250,11 +256,11 @@ Output in JSON:
|
||||
}
|
||||
```
|
||||
|
||||
> **Note**: Formula and picture description enrichments require `--hybrid-mode full` on the client side.
|
||||
> **注意**:公式与图片描述增强功能需要在客户端使用 `--hybrid-mode full`。
|
||||
|
||||
### Chart & Image Description
|
||||
### 图表与图片描述
|
||||
|
||||
Generate AI descriptions for charts and images — useful for RAG search and accessibility alt text:
|
||||
为图表和图像生成 AI 描述 — 适用于 RAG 检索与无障碍 alt 文本:
|
||||
|
||||
```bash
|
||||
# Server
|
||||
@@ -264,7 +270,7 @@ opendataloader-pdf-hybrid --enrich-picture-description
|
||||
opendataloader-pdf --hybrid docling-fast --hybrid-mode full file1.pdf file2.pdf folder/
|
||||
```
|
||||
|
||||
Output in JSON:
|
||||
JSON 输出:
|
||||
```json
|
||||
{
|
||||
"type": "picture",
|
||||
@@ -274,27 +280,27 @@ Output in JSON:
|
||||
}
|
||||
```
|
||||
|
||||
> Uses SmolVLM (256M), a lightweight vision model. Custom prompts supported via `--picture-description-prompt`.
|
||||
> 使用 SmolVLM(256M),一款轻量级视觉模型。可通过 `--picture-description-prompt` 自定义提示词。
|
||||
|
||||
### Hancom Data Loader Integration — Coming Soon
|
||||
### Hancom Data Loader 集成 — 即将推出
|
||||
|
||||
Enterprise-grade AI document analysis via [Hancom Data Loader](https://sdk.hancom.com/en/services/1?utm_source=github&utm_medium=readme&utm_campaign=opendataloader-pdf) — customer-customized models trained on your domain-specific documents. 30+ element types (tables, charts, formulas, captions, footnotes, etc.), VLM-based image/chart understanding, complex table extraction (merged cells, nested tables), SLA-backed OCR for scanned documents, and native HWP/HWPX support. Supports PDF, DOCX, XLSX, PPTX, HWP, PNG, JPG. [Live demo](https://livedemo.sdk.hancom.com/en/dataloader?utm_source=github&utm_medium=readme&utm_campaign=opendataloader-pdf)
|
||||
通过 [Hancom Data Loader](https://sdk.hancom.com/en/services/1?utm_source=github&utm_medium=readme&utm_campaign=opendataloader-pdf) 提供企业级 AI 文档分析 — 基于你领域专属文档训练的定制化模型。支持 30+ 种元素类型(表格、图表、公式、题注、脚注等)、基于 VLM 的图像/图表理解、复杂表格提取(合并单元格、嵌套表格)、带 SLA 保障的扫描文档 OCR,以及原生 HWP/HWPX 支持。支持 PDF、DOCX、XLSX、PPTX、HWP、PNG、JPG。[在线演示](https://livedemo.sdk.hancom.com/en/dataloader?utm_source=github&utm_medium=readme&utm_campaign=opendataloader-pdf)
|
||||
|
||||
[Hybrid Mode Guide](https://opendataloader.org/docs/hybrid-mode)
|
||||
[Hybrid 模式指南](https://opendataloader.org/docs/hybrid-mode)
|
||||
|
||||
## Output Formats
|
||||
## 输出格式
|
||||
|
||||
| Format | Use Case |
|
||||
| 格式 | 使用场景 |
|
||||
|--------|----------|
|
||||
| **JSON** | Structured data with bounding boxes, semantic types |
|
||||
| **Markdown** | Clean text for LLM context, RAG chunks |
|
||||
| **HTML** | Web display with styling |
|
||||
| **Annotated PDF** | Visual debugging — see detected structures ([sample](https://opendataloader.org/demo/samples/01030000000000)) |
|
||||
| **Text** | Plain text extraction |
|
||||
| **JSON** | 带边界框与语义类型的结构化数据 |
|
||||
| **Markdown** | 适用于 LLM 上下文、RAG 分块的整洁文本 |
|
||||
| **HTML** | 带样式的网页展示 |
|
||||
| **Annotated PDF** | 可视化调试 — 查看检测到的结构([示例](https://opendataloader.org/demo/samples/01030000000000)) |
|
||||
| **Text** | 纯文本提取 |
|
||||
|
||||
Combine formats: `format="json,markdown"`
|
||||
组合多种格式:`format="json,markdown"`
|
||||
|
||||
### JSON Output Example
|
||||
### JSON 输出示例
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -311,24 +317,24 @@ Combine formats: `format="json,markdown"`
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Description |
|
||||
| 字段 | 说明 |
|
||||
|-------|-------------|
|
||||
| `type` | Element type: heading, paragraph, table, list, image, caption, formula |
|
||||
| `id` | Unique identifier for cross-referencing |
|
||||
| `page number` | 1-indexed page reference |
|
||||
| `bounding box` | `[left, bottom, right, top]` in PDF points (72pt = 1 inch) |
|
||||
| `heading level` | Heading depth (1+) |
|
||||
| `content` | Extracted text |
|
||||
| `type` | 元素类型:heading、paragraph、table、list、image、caption、formula |
|
||||
| `id` | 用于交叉引用的唯一标识符 |
|
||||
| `page number` | 从 1 开始的页码引用 |
|
||||
| `bounding box` | PDF 点(72pt = 1 英寸)中的 `[left, bottom, right, top]` |
|
||||
| `heading level` | 标题层级(1+) |
|
||||
| `content` | 提取的文本 |
|
||||
|
||||
[Full JSON Schema](https://opendataloader.org/docs/reference/json-schema)
|
||||
[完整 JSON Schema](https://opendataloader.org/docs/reference/json-schema)
|
||||
|
||||
## Advanced Features
|
||||
## 高级功能
|
||||
|
||||
### Tagged PDF Support
|
||||
### Tagged PDF 支持
|
||||
|
||||
When a PDF has structure tags, OpenDataLoader extracts the **exact layout** the author intended — no guessing, no heuristics. Headings, lists, tables, and reading order are preserved from the source.
|
||||
当 PDF 带有结构标签时,OpenDataLoader 会提取作者**原本意图的精确版式** — 无需猜测,无需启发式规则。标题、列表、表格与阅读顺序均从源文件保留。
|
||||
|
||||
> **Output quality depends on tag quality.** Not all tagged PDFs are well-tagged. For PDFs with sparse or incorrect tags, the default heuristic mode or `--hybrid docling-fast` often produces better results.
|
||||
> **输出质量取决于标签质量。** 并非所有 Tagged PDF 都标注良好。对于标签稀疏或错误的 PDF,默认启发式模式或 `--hybrid docling-fast` 往往能产生更好的结果。
|
||||
|
||||
```python
|
||||
# Batch all files in one call — each convert() spawns a JVM process, so repeated calls are slow
|
||||
@@ -339,26 +345,26 @@ opendataloader_pdf.convert(
|
||||
)
|
||||
```
|
||||
|
||||
Most PDF parsers ignore structure tags entirely. [Learn more](https://opendataloader.org/docs/tagged-pdf)
|
||||
大多数 PDF 解析器会完全忽略结构标签。[了解更多](https://opendataloader.org/docs/tagged-pdf)
|
||||
|
||||
### AI Safety: Prompt Injection Protection
|
||||
### AI 安全:提示注入(Prompt Injection)防护
|
||||
|
||||
PDFs can contain hidden prompt injection attacks. OpenDataLoader automatically filters:
|
||||
PDF 可能包含隐藏的提示注入攻击。OpenDataLoader 会自动过滤:
|
||||
|
||||
- Hidden text (transparent, zero-size fonts)
|
||||
- Off-page content
|
||||
- Suspicious invisible layers
|
||||
- 隐藏文本(透明、零尺寸字体)
|
||||
- 页面外内容
|
||||
- 可疑的不可见图层
|
||||
|
||||
To sanitize sensitive data (emails, URLs, phone numbers → placeholders), enable it explicitly:
|
||||
要对敏感数据(电子邮件、URL、电话号码 → 占位符)进行脱敏,需显式启用:
|
||||
|
||||
```bash
|
||||
# Batch all files in one call — each invocation spawns a JVM process, so repeated calls are slow
|
||||
opendataloader-pdf file1.pdf file2.pdf folder/ --sanitize
|
||||
```
|
||||
|
||||
[AI Safety Guide](https://opendataloader.org/docs/ai-safety)
|
||||
[AI 安全指南](https://opendataloader.org/docs/ai-safety)
|
||||
|
||||
### LangChain Integration
|
||||
### LangChain 集成
|
||||
|
||||
```bash
|
||||
pip install -U langchain-opendataloader-pdf
|
||||
@@ -374,9 +380,9 @@ loader = OpenDataLoaderPDFLoader(
|
||||
documents = loader.load()
|
||||
```
|
||||
|
||||
[LangChain Docs](https://docs.langchain.com/oss/python/integrations/document_loaders/opendataloader_pdf) | [GitHub](https://github.com/opendataloader-project/langchain-opendataloader-pdf) | [PyPI](https://pypi.org/project/langchain-opendataloader-pdf/)
|
||||
[LangChain 文档](https://docs.langchain.com/oss/python/integrations/document_loaders/opendataloader_pdf) | [GitHub](https://github.com/opendataloader-project/langchain-opendataloader-pdf) | [PyPI](https://pypi.org/project/langchain-opendataloader-pdf/)
|
||||
|
||||
### Advanced Options
|
||||
### 高级选项
|
||||
|
||||
```python
|
||||
# Batch all files in one call — each convert() spawns a JVM process, so repeated calls are slow
|
||||
@@ -390,43 +396,43 @@ opendataloader_pdf.convert(
|
||||
)
|
||||
```
|
||||
|
||||
[Full CLI Options Reference](https://opendataloader.org/docs/reference/cli-options)
|
||||
[完整 CLI 选项参考](https://opendataloader.org/docs/reference/cli-options)
|
||||
|
||||
## PDF Accessibility & PDF/UA Conversion
|
||||
## PDF 无障碍与 PDF/UA 转换
|
||||
|
||||
**Problem**: Millions of existing PDFs lack structure tags, failing accessibility regulations (EAA, ADA/Section 508, Korea Digital Inclusion Act). Manual remediation costs $50–200 per document and doesn't scale.
|
||||
**问题**:数百万现有 PDF 缺少结构标签,无法满足无障碍法规要求(EAA、ADA/Section 508、韩国《数字包容法》)。人工修复每份文档成本为 $50–200,且无法规模化。
|
||||
|
||||
**OpenDataLoader's approach**: Built in collaboration with [PDF Association](https://pdfa.org) and [Dual Lab](https://duallab.com) (developers of [veraPDF](https://verapdf.org), the industry-reference open-source PDF/A and PDF/UA validator). Auto-tagging follows the [Well-Tagged PDF specification](https://pdfa.org/resource/well-tagged-pdf/) and is validated programmatically using veraPDF — automated conformance checks against PDF accessibility standards, not manual review. No existing open-source tool generates Tagged PDFs end-to-end — most rely on proprietary SDKs for the tag-writing step. OpenDataLoader does it all under Apache 2.0. ([collaboration details](https://opendataloader.org/docs/tagged-pdf-collaboration))
|
||||
**OpenDataLoader 的方案**:与 [PDF Association](https://pdfa.org) 和 [Dual Lab](https://duallab.com)([veraPDF](https://verapdf.org), 的开发者,后者是业界参考的开源 PDF/A 与 PDF/UA 验证器)合作构建。自动标记遵循 [Well-Tagged PDF 规范](https://pdfa.org/resource/well-tagged-pdf/),并使用 veraPDF 进行程序化验证 — 针对 PDF 无障碍标准进行自动化一致性检查,而非人工审查。现有开源工具均无法端到端生成 Tagged PDF — 大多数在标签写入步骤依赖专有 SDK。OpenDataLoader 在 Apache 2.0 下实现全部功能。([合作详情](https://opendataloader.org/docs/tagged-pdf-collaboration))
|
||||
|
||||
| Regulation | Deadline | Requirement |
|
||||
| 法规 | 截止日期 | 要求 |
|
||||
|------------|----------|-------------|
|
||||
| **European Accessibility Act (EAA)** | June 28, 2025 | Accessible digital products across the EU |
|
||||
| **ADA & Section 508** | In effect | U.S. federal agencies and public accommodations |
|
||||
| **Digital Inclusion Act** | In effect | South Korea digital service accessibility |
|
||||
| **European Accessibility Act (EAA)** | June 28, 2025 | 欧盟范围内的无障碍数字产品 |
|
||||
| **ADA & Section 508** | In effect | 美国联邦机构及公共场所 |
|
||||
| **Digital Inclusion Act** | In effect | 韩国数字服务无障碍 |
|
||||
|
||||
### Standards & Validation
|
||||
### 标准与验证
|
||||
|
||||
| Aspect | Detail |
|
||||
| 方面 | 详情 |
|
||||
|--------|--------|
|
||||
| **Specification** | [Well-Tagged PDF](https://pdfa.org/resource/well-tagged-pdf/) by PDF Association |
|
||||
| **Validation** | [veraPDF](https://verapdf.org) — industry-reference open-source PDF/A & PDF/UA validator |
|
||||
| **Collaboration** | PDF Association + [Dual Lab](https://duallab.com) (veraPDF developers) co-develop tagging and validation |
|
||||
| **License** | Auto-tagging → Tagged PDF: Apache 2.0 (free). PDF/UA export: Enterprise |
|
||||
| **规范** | [Well-Tagged PDF](https://pdfa.org/resource/well-tagged-pdf/)(PDF Association 发布) |
|
||||
| **验证** | [veraPDF](https://verapdf.org) — 业界参考的开源 PDF/A 与 PDF/UA 验证器 |
|
||||
| **合作** | PDF Association + [Dual Lab](https://duallab.com)(veraPDF 开发者)共同开发标记与验证 |
|
||||
| **许可证** | 自动标记 → Tagged PDF:Apache 2.0(免费)。PDF/UA 导出:企业版 |
|
||||
|
||||
### Accessibility Pipeline
|
||||
### 无障碍流水线
|
||||
|
||||
| Step | Feature | Status | Tier |
|
||||
| 步骤 | 功能 | 状态 | 层级 |
|
||||
|------|---------|--------|------|
|
||||
| 1. **Audit** | Read existing PDF tags, detect untagged PDFs | Shipped | Free |
|
||||
| 2. **Auto-tag → Tagged PDF** | Generate structure tags for untagged PDFs | Shipped | Free (Apache 2.0) |
|
||||
| 3. **Export PDF/UA** | Convert to PDF/UA-1 or PDF/UA-2 compliant files | 💼 Available | Enterprise |
|
||||
| 4. **Visual editing** | Accessibility studio — review and fix tags | 💼 Available | Enterprise |
|
||||
| 1. **审计** | 读取现有 PDF 标签,检测未标记的 PDF | Shipped | 免费 |
|
||||
| 2. **自动标记 → Tagged PDF** | 为未标记的 PDF 生成结构标签 | Shipped | 免费(Apache 2.0) |
|
||||
| 3. **导出 PDF/UA** | 转换为符合 PDF/UA-1 或 PDF/UA-2 标准的文件 | 💼 可用 | 企业版 |
|
||||
| 4. **可视化编辑** | 无障碍工作室 — 审查并修复标签 | 💼 可用 | 企业版 |
|
||||
|
||||
> **💼 Enterprise features** are available on request. [Contact us](https://opendataloader.org/contact) to get started.
|
||||
> **💼 企业版功能** 可按需获取。[联系我们](https://opendataloader.org/contact) 开始使用。
|
||||
|
||||
### Auto-Tagging
|
||||
### 自动标记
|
||||
|
||||
Generate Tagged PDFs from untagged PDFs — output is a screen-reader-ready PDF with structure tags (headings, paragraphs, lists, tables, reading order).
|
||||
从未标记的 PDF 生成 Tagged PDF — 输出为带有结构标签(标题、段落、列表、表格、阅读顺序)的屏幕阅读器可用 PDF。
|
||||
|
||||
```python
|
||||
import opendataloader_pdf
|
||||
@@ -444,9 +450,9 @@ opendataloader_pdf.convert(
|
||||
opendataloader-pdf --format tagged-pdf file1.pdf file2.pdf folder/
|
||||
```
|
||||
|
||||
Combine with other formats: `format="json,tagged-pdf"`.
|
||||
可与其他格式组合使用:`format="json,tagged-pdf"`。
|
||||
|
||||
### End-to-End Compliance Workflow
|
||||
### 端到端合规工作流
|
||||
|
||||
```
|
||||
Existing PDFs (untagged)
|
||||
@@ -462,30 +468,30 @@ Existing PDFs (untagged)
|
||||
(Available now) (Available, Apache 2.0) (Enterprise) (Enterprise)
|
||||
```
|
||||
|
||||
[PDF Accessibility Guide](https://opendataloader.org/docs/accessibility-compliance)
|
||||
[PDF 无障碍指南](https://opendataloader.org/docs/accessibility-compliance)
|
||||
|
||||
## Roadmap
|
||||
## 路线图
|
||||
|
||||
| Feature | Timeline | Tier |
|
||||
| 功能 | 时间线 | 层级 |
|
||||
|---------|----------|------|
|
||||
| **[Hancom Data Loader](https://sdk.hancom.com/en/services/1?utm_source=github&utm_medium=readme&utm_campaign=opendataloader-pdf)** — Enterprise AI document analysis, customer-customized models, VLM-based chart/image understanding, production-grade OCR | Q2-Q3 2026 | Planned |
|
||||
| **Structure validation** — Verify PDF tag trees | Q3 2026 | Planned |
|
||||
| **[Hancom Data Loader](https://sdk.hancom.com/en/services/1?utm_source=github&utm_medium=readme&utm_campaign=opendataloader-pdf)** — 企业级 AI 文档分析、客户定制模型、基于 VLM 的图表/图像理解、生产级 OCR | Q2-Q3 2026 | 计划中 |
|
||||
| **结构验证** — 验证 PDF 标签树 | Q3 2026 | 计划中 |
|
||||
|
||||
[Full Roadmap](https://opendataloader.org/docs/upcoming-roadmap)
|
||||
[完整路线图](https://opendataloader.org/docs/upcoming-roadmap)
|
||||
|
||||
## Frequently Asked Questions
|
||||
## 常见问题
|
||||
|
||||
### What is the best PDF parser for RAG?
|
||||
### RAG 场景下最好的 PDF 解析器是什么?
|
||||
|
||||
For RAG pipelines, you need a parser that preserves document structure, maintains correct reading order, and provides element coordinates for citations. OpenDataLoader is designed specifically for this — it outputs structured JSON with bounding boxes, handles multi-column layouts with XY-Cut++, and runs locally without GPU. In hybrid mode, it ranks #1 overall (0.907) in benchmarks.
|
||||
对于 RAG 流水线,你需要一款能保留文档结构、维持正确阅读顺序,并为引用提供元素坐标的解析器。OpenDataLoader 正是为此设计 — 它输出带有边界框(bounding boxes)的结构化 JSON,使用 XY-Cut++ 处理多栏布局,且无需 GPU 即可在本地运行。在 hybrid 模式下,它在基准测试中综合排名第一(0.907)。
|
||||
|
||||
### What is the best open-source PDF parser?
|
||||
### 最好的开源 PDF 解析器是什么?
|
||||
|
||||
OpenDataLoader PDF is the only open-source parser that combines: rule-based deterministic extraction (no GPU), bounding boxes for every element, XY-Cut++ reading order, built-in AI safety filters, native Tagged PDF support, and hybrid AI mode for complex documents. It ranks #1 in overall accuracy (0.907) while running locally on CPU.
|
||||
OpenDataLoader PDF 是唯一结合以下能力的开源解析器:基于规则的确定性提取(无需 GPU)、每个元素的边界框、XY-Cut++ 阅读顺序、内置 AI 安全过滤器、原生 Tagged PDF 支持,以及用于复杂文档的 hybrid AI 模式。它在 CPU 本地运行时综合准确率排名第一(0.907)。
|
||||
|
||||
### How do I extract tables from PDF for LLM?
|
||||
### 如何从 PDF 中提取表格供 LLM 使用?
|
||||
|
||||
OpenDataLoader detects tables using border analysis and text clustering, preserving row/column structure. For complex tables, enable hybrid mode for +90% accuracy improvement (0.489 to 0.928 TEDS score):
|
||||
OpenDataLoader 通过边框分析和文本聚类检测表格,保留行列结构。对于复杂表格,启用 hybrid 模式可将准确率提升 90% 以上(TEDS 分数从 0.489 提升至 0.928):
|
||||
|
||||
```python
|
||||
# Batch all files in one call — each convert() spawns a JVM process, so repeated calls are slow
|
||||
@@ -497,47 +503,47 @@ opendataloader_pdf.convert(
|
||||
)
|
||||
```
|
||||
|
||||
### How does it compare to docling, marker, or pymupdf4llm?
|
||||
### 它与 docling、marker 或 pymupdf4llm 相比如何?
|
||||
|
||||
OpenDataLoader [hybrid] ranks #1 overall (0.907) across reading order, table, and heading accuracy. Key differences: docling (0.882) is strong but lacks bounding boxes and AI safety filters. marker (0.861) requires GPU and is 1000x slower (53.932s/page). pymupdf4llm (0.732) is fast but has poor table (0.401) and heading (0.412) accuracy. OpenDataLoader is the only parser that combines deterministic local extraction, bounding boxes for every element, and built-in prompt injection protection. See [full benchmark](https://github.com/opendataloader-project/opendataloader-bench).
|
||||
OpenDataLoader [hybrid] 在阅读顺序、表格和标题准确率方面综合排名第一(0.907)。主要差异:docling(0.882)表现强劲,但缺少边界框和 AI 安全过滤器。marker(0.861)需要 GPU,且速度慢 1000 倍(53.932 秒/页)。pymupdf4llm(0.732)速度快,但表格(0.401)和标题(0.412)准确率较差。OpenDataLoader 是唯一结合确定性本地提取、每个元素的边界框以及内置提示注入防护的解析器。详见[完整基准测试](https://github.com/opendataloader-project/opendataloader-bench).
|
||||
|
||||
### Can I use this without sending data to the cloud?
|
||||
### 能否在不将数据发送到云端的情况下使用?
|
||||
|
||||
Yes. OpenDataLoader runs 100% locally. No API calls, no data transmission — your documents never leave your environment. The hybrid mode backend also runs locally on your machine. Ideal for legal, healthcare, and financial documents.
|
||||
是的。OpenDataLoader 完全在本地运行。无需 API 调用,不会传输数据——你的文档永远不会离开你的环境。混合模式(hybrid mode)后端也会在你的机器上本地运行。非常适合法律、医疗和金融类文档。
|
||||
|
||||
### Does it support OCR for scanned PDFs?
|
||||
### 是否支持对扫描版 PDF 进行 OCR?
|
||||
|
||||
Yes, via hybrid mode. Install with `pip install "opendataloader-pdf[hybrid]"`, start the backend with `--force-ocr`, then process as usual. Supports multiple languages including Korean, Japanese, Chinese, Arabic, and more via `--ocr-lang`.
|
||||
是的,通过混合模式。使用 `pip install "opendataloader-pdf[hybrid]"` 安装,用 `--force-ocr` 启动后端,然后照常处理。通过 `--ocr-lang` 支持韩语、日语、中文、阿拉伯语等多种语言。
|
||||
|
||||
### Does it work with Korean, Japanese, or Chinese documents?
|
||||
### 是否支持韩语、日语或中文文档?
|
||||
|
||||
Yes. For digital PDFs, text extraction works out of the box. For scanned PDFs, use hybrid mode with `--force-ocr --ocr-lang "ko,en"` (or `ja`, `ch_sim`, `ch_tra`). Coming soon: [Hancom Data Loader](https://sdk.hancom.com/en/services/1?utm_source=github&utm_medium=readme&utm_campaign=opendataloader-pdf) integration — enterprise-grade AI document analysis with built-in production-grade OCR and customer-customized models optimized for your specific document types and workflows.
|
||||
是的。对于数字 PDF,文本提取开箱即用。对于扫描版 PDF,请使用混合模式配合 `--force-ocr --ocr-lang "ko,en"`(或 `ja`、`ch_sim`、`ch_tra`)。即将推出:[Hancom Data Loader](https://sdk.hancom.com/en/services/1?utm_source=github&utm_medium=readme&utm_campaign=opendataloader-pdf) integration — 企业级 AI 文档分析,内置生产级 OCR,以及针对你的特定文档类型和工作流程优化的客户定制模型。
|
||||
|
||||
### How fast is it?
|
||||
### 速度有多快?
|
||||
|
||||
Local mode processes 60+ pages per second on CPU (0.02s/page). Hybrid mode processes 2+ pages per second (0.46s/page) with significantly higher accuracy for complex documents. No GPU required. Benchmarked on Apple M4. [Full benchmark details](https://github.com/opendataloader-project/opendataloader-bench). With multi-process batch processing, throughput exceeds 100 pages per second on 8+ core machines.
|
||||
本地模式在 CPU 上每秒可处理 60+ 页(0.02 秒/页)。混合模式每秒可处理 2+ 页(0.46 秒/页),对复杂文档的准确率显著更高。无需 GPU。在 Apple M4 上完成基准测试。[Full benchmark details](https://github.com/opendataloader-project/opendataloader-bench). 通过多进程批量处理,在 8+ 核机器上吞吐量可超过每秒 100 页。
|
||||
|
||||
### Does it handle multi-column layouts?
|
||||
### 是否支持多栏版式?
|
||||
|
||||
Yes. OpenDataLoader uses XY-Cut++ reading order analysis to correctly sequence text across multi-column pages, sidebars, and mixed layouts. This works in both local and hybrid modes without any configuration.
|
||||
是的。OpenDataLoader 使用 XY-Cut++ 阅读顺序分析,可在多栏页面、侧边栏和混合版式中正确排序文本。这在本地模式和混合模式下均可使用,无需任何配置。
|
||||
|
||||
### What is hybrid mode?
|
||||
### 什么是混合模式?
|
||||
|
||||
Hybrid mode combines fast local Java processing with an AI backend. Simple pages are processed locally (0.02s/page); complex pages (tables, scanned content, formulas, charts) are automatically routed to the AI backend for higher accuracy. The backend runs locally on your machine — no cloud required. See [Which Mode Should I Use?](#which-mode-should-i-use) and [Hybrid Mode Guide](https://opendataloader.org/docs/hybrid-mode).
|
||||
混合模式将快速的本地 Java 处理与 AI 后端相结合。简单页面在本地处理(0.02 秒/页);复杂页面(表格、扫描内容、公式、图表)会自动路由到 AI 后端以获得更高准确率。后端在你的机器上本地运行——无需云端。请参阅 [Which Mode Should I Use?](#which-mode-should-i-use) 和 [Hybrid Mode Guide](https://opendataloader.org/docs/hybrid-mode).
|
||||
|
||||
### Does it work with LangChain?
|
||||
### 是否可与 LangChain 配合使用?
|
||||
|
||||
Yes. Install `langchain-opendataloader-pdf` for an official LangChain document loader integration. See [LangChain docs](https://docs.langchain.com/oss/python/integrations/document_loaders/opendataloader_pdf).
|
||||
是的。安装 `langchain-opendataloader-pdf` 即可获得官方 LangChain 文档加载器集成。请参阅 [LangChain docs](https://docs.langchain.com/oss/python/integrations/document_loaders/opendataloader_pdf).
|
||||
|
||||
### How do I chunk PDFs for RAG?
|
||||
### 如何为 RAG 对 PDF 进行分块?
|
||||
|
||||
OpenDataLoader outputs structured Markdown with headings, tables, and lists preserved — ideal input for semantic chunking. Each element in JSON output includes `type`, `heading level`, and `page number`, so you can split by section or page boundary. For most RAG pipelines: parse with `format="markdown"` for text chunks, or `format="json"` when you need element-level control. Pair with LangChain's `RecursiveCharacterTextSplitter` or your own heading-based splitter for best results.
|
||||
OpenDataLoader 输出结构化 Markdown,保留标题、表格和列表——非常适合作为语义分块的输入。JSON 输出中的每个元素都包含 `type`、`heading level` 和 `page number`,因此你可以按章节或页面边界进行拆分。对于大多数 RAG 流水线:使用 `format="markdown"` 解析文本块,或在需要元素级控制时使用 `format="json"`。配合 LangChain 的 `RecursiveCharacterTextSplitter` 或你自己的基于标题的分割器可获得最佳效果。
|
||||
|
||||
### How do I cite PDF sources in RAG answers?
|
||||
### 如何在 RAG 回答中引用 PDF 来源?
|
||||
|
||||
Every element in JSON output includes a `bounding box` (`[left, bottom, right, top]` in PDF points) and `page number`. When your RAG pipeline returns an answer, map the source chunk back to its bounding box to highlight the exact location in the original PDF. This enables "click to source" UX — users see which paragraph, table, or figure the answer came from. No other open-source parser provides bounding boxes for every element by default.
|
||||
JSON 输出中的每个元素都包含 `bounding box`(PDF 点坐标中的 `[left, bottom, right, top]`)和 `page number`。当 RAG 流水线返回答案时,将来源块映射回其边界框,以在原始 PDF 中高亮显示确切位置。这实现了「点击溯源」用户体验——用户可以看到答案来自哪个段落、表格或图表。没有其他开源解析器默认提供每个元素的边界框。
|
||||
|
||||
### How do I convert PDF to Markdown for LLM?
|
||||
### 如何将 PDF 转换为 Markdown 供 LLM 使用?
|
||||
|
||||
```python
|
||||
import opendataloader_pdf
|
||||
@@ -550,54 +556,54 @@ opendataloader_pdf.convert(
|
||||
)
|
||||
```
|
||||
|
||||
OpenDataLoader preserves heading hierarchy, table structure, and reading order in the Markdown output. For complex documents with borderless tables or scanned pages, use hybrid mode (`hybrid="docling-fast"`) for higher accuracy. The output is clean enough to feed directly into LLM context windows or RAG chunking pipelines.
|
||||
OpenDataLoader 在 Markdown 输出中保留标题层级、表格结构和阅读顺序。对于包含无边框表格或扫描页面的复杂文档,请使用混合模式(`hybrid="docling-fast"`)以获得更高准确率。输出足够干净,可直接输入 LLM 上下文窗口或 RAG 分块流水线。
|
||||
|
||||
### Is there an automated PDF accessibility remediation tool?
|
||||
### 是否有自动化的 PDF 无障碍修复工具?
|
||||
|
||||
Yes. OpenDataLoader is the first open-source tool that automates PDF accessibility end-to-end. Built in collaboration with [PDF Association](https://pdfa.org) and [Dual Lab](https://duallab.com) (veraPDF developers), auto-tagging follows the Well-Tagged PDF specification and is validated programmatically using veraPDF. The layout analysis engine detects document structure (headings, tables, lists, reading order) and generates accessibility tags automatically. Auto-tagging converts untagged PDFs into Tagged PDFs under Apache 2.0 — no proprietary SDK dependency. Use `format="tagged-pdf"` (Python/Node.js) or `--format tagged-pdf` (CLI). For organizations needing full PDF/UA compliance, enterprise add-ons provide PDF/UA export and a visual tag editor. This replaces manual remediation workflows that typically cost $50–200+ per document.
|
||||
是的。OpenDataLoader 是首个端到端自动化 PDF 无障碍处理的开源工具。与 [PDF Association](https://pdfa.org) and [Dual Lab](https://duallab.com)(veraPDF 开发者)合作构建,自动标记遵循 Well-Tagged PDF 规范,并使用 veraPDF 进行程序化验证。版式分析引擎可检测文档结构(标题、表格、列表、阅读顺序)并自动生成无障碍标签。自动标记在 Apache 2.0 下将无标签 PDF 转换为 Tagged PDF——无需专有 SDK 依赖。使用 `format="tagged-pdf"`(Python/Node.js)或 `--format tagged-pdf`(CLI)。对于需要完整 PDF/UA 合规性的组织,企业附加组件提供 PDF/UA 导出和可视化标签编辑器。这可取代通常每份文档花费 $50–200+ 的手动修复工作流。
|
||||
|
||||
### Is this really the first open-source PDF auto-tagging tool?
|
||||
### 这真的是首个开源 PDF 自动标记工具吗?
|
||||
|
||||
Yes. Existing tools either depend on proprietary SDKs for writing structure tags, only output non-PDF formats (e.g., Docling outputs Markdown/JSON but cannot produce Tagged PDFs), or require manual intervention. OpenDataLoader is the first to do layout analysis → tag generation → Tagged PDF output entirely under an open-source license (Apache 2.0), with no proprietary dependency. Auto-tagging follows the PDF Association's Well-Tagged PDF specification and is validated using veraPDF, the industry-reference open-source PDF/A and PDF/UA validator.
|
||||
是的。现有工具要么依赖专有 SDK 来写入结构标签,要么仅输出非 PDF 格式(例如,Docling 输出 Markdown/JSON 但无法生成 Tagged PDF),要么需要人工干预。OpenDataLoader 是首个在开源许可证(Apache 2.0)下完整实现版式分析 → 标签生成 → Tagged PDF 输出的工具,无专有依赖。自动标记遵循 PDF Association 的 Well-Tagged PDF 规范,并使用 veraPDF(行业参考级的开源 PDF/A 和 PDF/UA 验证器)进行验证。
|
||||
|
||||
### How do I convert existing PDFs to PDF/UA?
|
||||
### 如何将现有 PDF 转换为 PDF/UA?
|
||||
|
||||
OpenDataLoader provides an end-to-end pipeline: audit existing PDFs for tags (`use_struct_tree=True`), auto-tag untagged PDFs into Tagged PDFs (`format="tagged-pdf"`, free under Apache 2.0), and export as PDF/UA-1 or PDF/UA-2 (enterprise add-on). Auto-tagging follows the PDF Association's Well-Tagged PDF specification and is validated using veraPDF. Auto-tagging generates the Tagged PDF; PDF/UA export is the final step. [Contact us](https://opendataloader.org/contact) for enterprise integration.
|
||||
OpenDataLoader 提供端到端流水线:审计现有 PDF 的标签(`use_struct_tree=True`)、将无标签 PDF 自动标记为 Tagged PDF(`format="tagged-pdf"`,在 Apache 2.0 下免费),并导出为 PDF/UA-1 或 PDF/UA-2(企业附加组件)。自动标记遵循 PDF Association 的 Well-Tagged PDF 规范,并使用 veraPDF 进行验证。自动标记生成 Tagged PDF;PDF/UA 导出是最后一步。[Contact us](https://opendataloader.org/contact) for enterprise integration.
|
||||
|
||||
### How do I make my PDFs accessible for EAA compliance?
|
||||
### 如何使 PDF 符合 EAA 合规要求?
|
||||
|
||||
The European Accessibility Act requires accessible digital products by June 28, 2025. OpenDataLoader supports the full remediation workflow: audit → auto-tag → Tagged PDF → PDF/UA export. Auto-tagging follows the PDF Association's Well-Tagged PDF specification and is validated using veraPDF, ensuring standards-compliant output. Auto-tagging to Tagged PDF is open-source under Apache 2.0. PDF/UA export and accessibility studio are enterprise add-ons. See our [Accessibility Guide](https://opendataloader.org/docs/accessibility-compliance).
|
||||
《欧洲无障碍法案》(European Accessibility Act)要求于 2025 年 6 月 28 日前提供无障碍数字产品。OpenDataLoader 支持完整的修复工作流:审计 → 自动标记 → Tagged PDF → PDF/UA 导出。自动标记遵循 PDF Association 的 Well-Tagged PDF 规范,并使用 veraPDF 进行验证,确保符合标准的输出。自动标记为 Tagged PDF 在 Apache 2.0 下开源。PDF/UA 导出和无障碍工作室(accessibility studio)为企业附加组件。请参阅我们的 [Accessibility Guide](https://opendataloader.org/docs/accessibility-compliance).
|
||||
|
||||
### Is OpenDataLoader PDF free?
|
||||
### OpenDataLoader PDF 是否免费?
|
||||
|
||||
The core library is **open-source under Apache 2.0** — free for commercial use. This includes all extraction features (text, tables, images, OCR, formulas, charts via hybrid mode), AI safety filters, Tagged PDF support, and auto-tagging to Tagged PDF. We are committed to keeping the core accessibility pipeline (layout analysis → auto-tagging → Tagged PDF) free and open-source. Enterprise add-ons (PDF/UA export, accessibility studio) are available for organizations needing end-to-end regulatory compliance.
|
||||
核心库**在 Apache 2.0 下开源**——可免费用于商业用途。这包括所有提取功能(文本、表格、图片、OCR、公式、通过混合模式的图表)、AI 安全过滤器、Tagged PDF 支持,以及自动标记为 Tagged PDF。我们承诺保持核心无障碍流水线(版式分析 → 自动标记 → Tagged PDF)免费且开源。企业附加组件(PDF/UA 导出、无障碍工作室)可供需要端到端监管合规的组织使用。
|
||||
|
||||
### Why did the license change from MPL 2.0 to Apache 2.0?
|
||||
### 许可证为何从 MPL 2.0 更改为 Apache 2.0?
|
||||
|
||||
MPL 2.0 requires file-level copyleft, which often triggers legal review before enterprise adoption. Apache 2.0 is fully permissive — no copyleft obligations, easier to integrate into commercial projects. If you are using a pre-2.0 version, it remains under MPL 2.0 and you can continue using it. Upgrading to 2.0+ means your project follows Apache 2.0 terms, which are strictly more permissive — no additional obligations, no action needed on your side.
|
||||
MPL 2.0 要求文件级 copyleft,这通常会在企业采用前触发法律审查。Apache 2.0 完全宽松——无 copyleft 义务,更易集成到商业项目中。如果你使用的是 2.0 之前的版本,它仍受 MPL 2.0 约束,你可以继续使用。升级到 2.0+ 意味着你的项目遵循 Apache 2.0 条款,该条款严格来说更加宽松——无额外义务,你无需采取任何行动。
|
||||
|
||||
## Documentation
|
||||
## 文档
|
||||
|
||||
- [Quick Start (Python)](https://opendataloader.org/docs/quick-start-python)
|
||||
- [Quick Start (Node.js)](https://opendataloader.org/docs/quick-start-nodejs)
|
||||
- [Quick Start (Java)](https://opendataloader.org/docs/quick-start-java)
|
||||
- [JSON Schema Reference](https://opendataloader.org/docs/reference/json-schema)
|
||||
- [CLI Options](https://opendataloader.org/docs/reference/cli-options)
|
||||
- [Hybrid Mode Guide](https://opendataloader.org/docs/hybrid-mode)
|
||||
- [Tagged PDF Support](https://opendataloader.org/docs/tagged-pdf)
|
||||
- [AI Safety Features](https://opendataloader.org/docs/ai-safety)
|
||||
- [PDF Accessibility](https://opendataloader.org/docs/accessibility-compliance)
|
||||
- [快速入门(Python)](https://opendataloader.org/docs/quick-start-python)
|
||||
- [快速入门(Node.js)](https://opendataloader.org/docs/quick-start-nodejs)
|
||||
- [快速入门(Java)](https://opendataloader.org/docs/quick-start-java)
|
||||
- [JSON Schema 参考](https://opendataloader.org/docs/reference/json-schema)
|
||||
- [CLI 选项](https://opendataloader.org/docs/reference/cli-options)
|
||||
- [混合模式指南](https://opendataloader.org/docs/hybrid-mode)
|
||||
- [Tagged PDF 支持](https://opendataloader.org/docs/tagged-pdf)
|
||||
- [AI 安全功能](https://opendataloader.org/docs/ai-safety)
|
||||
- [PDF 无障碍](https://opendataloader.org/docs/accessibility-compliance)
|
||||
|
||||
## Contributing
|
||||
## 贡献
|
||||
|
||||
We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
||||
欢迎贡献!请参阅 [CONTRIBUTING.md](CONTRIBUTING.md) 了解贡献指南。
|
||||
|
||||
## License
|
||||
## 许可证
|
||||
|
||||
[Apache License 2.0](LICENSE)
|
||||
|
||||
> **Note:** Versions prior to 2.0 are licensed under the [Mozilla Public License 2.0](https://www.mozilla.org/MPL/2.0/).
|
||||
> **注意:** 2.0 之前的版本采用 [Mozilla Public License 2.0](https://www.mozilla.org/MPL/2.0/).
|
||||
|
||||
---
|
||||
|
||||
**Found this useful?** Give us a star to help others discover OpenDataLoader.
|
||||
**觉得有帮助?** 给我们点个 Star,帮助更多人发现 OpenDataLoader。
|
||||
|
||||
Reference in New Issue
Block a user