arXiv:2502.18443cs.CL2025-02被引 127

用开源模型高效提取PDF中的高质量文本内容,成本仅176美元/百万页。

olmOCR: Unlocking Trillions of Tokens in PDFs with Vision Language Models

  • 基于微调的7B视觉语言模型,可处理复杂布局和低质量扫描的PDF。
  • 处理百万页仅需176美元,远低于商用API成本(如GPT-4o超6240美元/百万页)。
  • 开源全套工具与基准测试集,适合大规模文档数字化项目使用。

PDF文档蕴含数万亿可用于训练语言模型的新颖高质量文本。然而,其格式多样、排版复杂,传统开源工具提取效果较差。尽管视觉语言模型(VLMs)表现更优,但依赖顶级模型成本高昂(如GPT-4o达6240美元/百万页)或受限于私有API无法使用。我们提出olmOCR——一个开源工具包,可将PDF转化为结构清晰、按自然阅读顺序排列的纯文本,同时保留章节、表格、列表、公式等结构化内容。该工具运行在基于26万页数据(来自10万余份爬取的PDF)微调的7B VLM上,涵盖图像、手写体及低质量扫描。olmOCR支持大规模批量处理,灵活适配不同硬件,百万页处理成本仅176美元。为便于评估,我们还构建了olmOCR-Bench,包含1400个高难度PDF样本,覆盖公式、表格、小字号、旧扫描等挑战性内容。实验表明,olmOCR性能超越GPT-4o、Gemini Flash 2及Qwen-2.5-VL。所有组件均公开:微调模型、训练代码与数据、高效推理管道(支持vLLM和SGLang),以及基准测试集。

原文摘要 · Abstract (English)

PDF documents have the potential to provide trillions of novel, high-quality tokens for training language models. However, these documents come in a diversity of types with differing formats and visual layouts that pose a challenge when attempting to extract and faithfully represent the underlying content for language model use. Traditional open source tools often produce lower quality extractions compared to vision language models (VLMs), but reliance on the best VLMs can be prohibitively costly (e.g., over 6,240 USD per million PDF pages for GPT-4o) or infeasible if the PDFs cannot be sent to proprietary APIs. We present olmOCR, an open-source toolkit for processing PDFs into clean, linearized plain text in natural reading order while preserving structured content like sections, tables, lists, equations, and more. Our toolkit runs a fine-tuned 7B vision language model (VLM) trained on olmOCR-mix-0225, a sample of 260,000 pages from over 100,000 crawled PDFs with diverse properties, including graphics, handwritten text and poor quality scans. olmOCR is optimized for large-scale batch processing, able to scale flexibly to different hardware setups and can convert a million PDF pages for only 176 USD. To aid comparison with existing systems, we also introduce olmOCR-Bench, a curated set of 1,400 PDFs capturing many content types that remain challenging even for the best tools and VLMs, including formulas, tables, tiny fonts, old scans, and more. We find olmOCR outperforms even top VLMs including GPT-4o, Gemini Flash 2 and Qwen-2.5-VL. We openly release all components of olmOCR: our fine-tuned VLM model, training code and data, an efficient inference pipeline that supports vLLM and SGLang backends, and benchmark olmOCR-Bench.

文档处理PDF提取开源工具视觉语言模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。