docling-project / docling
docling-project / docling
What is Docling?
Docling simplifies document processing by parsing diverse formats — including advanced PDF understanding — and providing seamless integrations with the generative AI ecosystem.
什么是 Docling? Docling 通过解析多种格式(包括高级 PDF 理解)并提供与生成式 AI 生态系统的无缝集成,简化了文档处理流程。
Features
- 🗂️ Parsing of multiple document formats including PDF, DOCX, PPTX, XLSX, HTML, EPUB, Apple Pages, WAV, MP3, WebVTT, Box Notes, email formats (EML, MSG), images (PNG, TIFF, JPEG, …), LaTeX, DocLang, plain text, and more
- 📑 Advanced PDF understanding incl. page layout, reading order, table structure, code, formulas, image classification, and more
- 🧬 A unified, expressive DoclingDocument representation format
- ↪️ Various export formats and options, including Markdown, HTML, WebVTT, DocLang, DocTags and lossless JSON
- 📜 Support for several application-specific XML schemas including DocLang, USPTO patents, JATS articles, and XBRL financial reports.
- 🔒 Local execution capabilities for sensitive data and air-gapped environments
- 🤖 Plug-and-play integrations incl. LangChain, LlamaIndex, Crew AI & Haystack for agentic AI
- 🔍 Extensive OCR support for scanned PDFs and images
- 👓 Support for several Visual Language Models, such as (GraniteDocling)
- 🎙️ Audio support with Automatic Speech Recognition (ASR) models
- 🔌 Connect to any agent using the MCP server
- 🌐 Run Docling as a service with the API server (docling-serve)
- 💻 Simple and convenient CLI
功能特性
- 🗂️ 多种文档格式解析:包括 PDF、DOCX、PPTX、XLSX、HTML、EPUB、Apple Pages、WAV、MP3、WebVTT、Box Notes、电子邮件格式(EML、MSG)、图像(PNG、TIFF、JPEG 等)、LaTeX、DocLang、纯文本等。
- 📑 高级 PDF 理解:包括页面布局、阅读顺序、表格结构、代码、公式、图像分类等。
- 🧬 统一且富有表现力的 DoclingDocument 表示格式。
- ↪️ 多种导出格式和选项:包括 Markdown、HTML、WebVTT、DocLang、DocTags 和无损 JSON。
- 📜 支持多种特定于应用的 XML 架构:包括 DocLang、USPTO 专利、JATS 文章和 XBRL 财务报告。
- 🔒 本地执行能力:适用于敏感数据和离线(气隙)环境。
- 🤖 即插即用集成:包括用于智能体 AI 的 LangChain、LlamaIndex、Crew AI 和 Haystack。
- 🔍 广泛的 OCR 支持:针对扫描版 PDF 和图像。
- 👓 支持多种视觉语言模型 (VLM):例如 GraniteDocling。
- 🎙️ 音频支持:配备自动语音识别 (ASR) 模型。
- 🔌 连接任何智能体:使用 MCP 服务器。
- 🌐 作为服务运行:通过 API 服务器 (docling-serve) 运行 Docling。
- 💻 简单便捷的命令行界面 (CLI)。
What’s new
- 🎬 Parsing of video files (MP4, AVI, MOV, MKV, and WebM) with an ASR transcript and representative keyframes
- 📄 Parsing of ODF (OpenDocument Format) files for text documents (.odt), spreadsheets (.ods), and presentations (.odp)
- 💼 Parsing of XBRL (eXtensible Business Reporting Language) documents for financial reports
- 📧 Parsing of email files (.eml, .msg)
- 📚 Parsing of EPUB (Electronic Publication) files for e-books
- 🍎 Parsing of Apple Pages (.pages) documents, both container generations (Pages 5+ and iWork ‘09)
- 📝 Parsing of plain-text files (.txt, .text) and Markdown supersets (.qmd, .Rmd)
- 📊 Chart understanding (Barchart, Piechart, LinePlot): convert them into tables or code and add detailed descriptions
更新内容
- 🎬 视频文件解析 (MP4, AVI, MOV, MKV, WebM):包含 ASR 转录文本和代表性关键帧。
- 📄 ODF (OpenDocument Format) 文件解析:支持文本文档 (.odt)、电子表格 (.ods) 和演示文稿 (.odp)。
- 💼 XBRL (可扩展商业报告语言) 文档解析:用于财务报告。
- 📧 电子邮件文件解析 (.eml, .msg)。
- 📚 EPUB (电子出版物) 文件解析:用于电子书。
- 🍎 Apple Pages (.pages) 文档解析:支持两种容器版本(Pages 5+ 和 iWork ‘09)。
- 📝 纯文本文件 (.txt, .text) 和 Markdown 超集 (.qmd, .Rmd) 解析。
- 📊 图表理解 (柱状图、饼图、折线图):将其转换为表格或代码,并添加详细描述。
Coming soon
- 📝 Metadata extraction, including title, authors, references & language
- 📝 Complex chemistry understanding (Molecular structures)
即将推出
- 📝 元数据提取:包括标题、作者、参考文献和语言。
- 📝 复杂的化学理解(分子结构)。
Quickstart
1. Install
pip install docling
Note: Python 3.9 support was dropped in docling version 2.70.0. Please use Python 3.10 or higher. Works on macOS, Linux and Windows environments for both x86_64 and arm64 architectures. More detailed installation instructions are available in the docs.
快速入门
1. 安装
pip install docling
注意:Docling 2.70.0 版本起已停止对 Python 3.9 的支持,请使用 Python 3.10 或更高版本。适用于 macOS、Linux 和 Windows 环境,支持 x86_64 和 arm64 架构。更多详细安装说明请参阅文档。
2. Convert a document (CLI)
docling https://arxiv.org/pdf/2206.01062
This generates a .md file in the current directory containing structured document content. You can also use 🥚GraniteDocling and other VLMs via Docling CLI:
docling --pipeline vlm --vlm-model granite_docling https://arxiv.org/pdf/2206.01062
2. 转换文档 (CLI)
docling https://arxiv.org/pdf/2206.01062
这将在当前目录生成一个包含结构化文档内容的 .md 文件。你也可以通过 Docling CLI 使用 🥚GraniteDocling 和其他 VLM:
docling --pipeline vlm --vlm-model granite_docling https://arxiv.org/pdf/2206.01062
3. Python usage (recommended)
from docling.document_converter import DocumentConverter
source = "https://arxiv.org/pdf/2408.09869" # a document via a local path or URL
converter = DocumentConverter()
result = converter.convert(source)
print(result.document.export_to_markdown()) # output: "## Docling Technical Report[...]"
More advanced usage and configuration options.
3. Python 使用 (推荐)
from docling.document_converter import DocumentConverter
source = "https://arxiv.org/pdf/2408.09869" # 通过本地路径或 URL 获取文档
converter = DocumentConverter()
result = converter.convert(source)
print(result.document.export_to_markdown()) # 输出: "## Docling Technical Report[...]"
更多高级用法和配置选项。
Documentation
Check out Docling’s documentation for details on installation, usage, concepts, recipes, extensions, and more.
文档 查看 Docling 文档,了解有关安装、用法、概念、方案、扩展等方面的详细信息。
Examples
Go hands-on with our examples, demonstrating how to address different application use cases with Docling.
示例 通过我们的示例进行实践,演示如何使用 Docling 解决不同的应用场景。
Integrations
To further accelerate your AI application development, check out Docling’s native integrations with popular frameworks and tools.
集成 为了进一步加速你的 AI 应用开发,请查看 Docling 与主流框架和工具的原生集成。
Get help and support
Please feel free to connect with us using the discussion section.
获取帮助与支持 请随时通过讨论区与我们联系。
Technical report
For more details on Docling’s inner workings, check out the Docling Technical Report.
技术报告 有关 Docling 内部工作原理的更多详细信息,请查看《Docling 技术报告》。
Contributing
Please read Contributing to Docling for details.
贡献 请阅读《为 Docling 做贡献》以了解详细信息。
References
If you use Docling in your projects, please consider citing the following:
@techreport{Docling,
author = {Deep Search Team},
month = {8},
title = {Docling Technical Report},
url = {https://arxiv.org/abs/2408.09869},
eprint = {2408.09869},
doi = {10.48550/arXiv.2408.09869},
version = {1.0.0},
year = {2024}
}
参考文献 如果你在项目中使用 Docling,请考虑引用以下内容: (引用格式见上方英文原文)
License
The Docling codebase is under MIT license. For individual model usage, please refer to the model licenses found in the original packages.
许可证 Docling 代码库采用 MIT 许可证。对于单个模型的使用,请参考原始包中的模型许可证。
LF AI & Data
Docling is hosted as a project in the LF AI & Data Foundation.
LF AI & Data Docling 是 LF AI & Data 基金会旗下的一个托管项目。
IBM ❤️ Open Source AI
The project was started by the AI for knowledge team at IBM Research Zurich.
IBM ❤️ 开源 AI 该项目由 IBM 苏黎世研究院的“知识 AI”团队发起。