← 返回
内容创作 Key 中文

PaddleOCR Document Parsing V2

Parse documents using PaddleOCR's API. Supports both sync and async modes for images and PDFs.
使用 PaddleOCR API 解析文档,支持图像和 PDF 的同步与异步模式。
hiotec
内容创作 clawhub v1.0.4 1 版本 99942 Key: 需要
★ 4
Stars
📥 1,642
下载
💾 357
安装
1
版本
#latest

概述

PaddleOCR Document Parsing

Parse images and PDF files using PaddleOCR's API. Supports both synchronous and asynchronous parsing modes with structured output.

Resource Links

ResourceLink
---------------------------------------------------------------------------------------------------
Official Websitehttps://www.paddleocr.com
API Documentationhttps://ai.baidu.com/ai-doc/AISTUDIO/Cmkz2m0ma
GitHubhttps://github.com/PaddlePaddle/PaddleOCR

Key Features

  • Multi-format support: PDF and image files (JPG, PNG, BMP, TIFF)
  • Two parsing modes:
  • Sync mode: Fast response for small files (<600s timeout)
  • Async mode: For large files with progress polling
  • Layout analysis: Automatic detection of text blocks, tables, formulas
  • Multi-language: Support for 110+ languages
  • Structured output: Markdown format with preserved document structure

Setup

  1. Visit PaddleOCR to obtain your API credentials
  2. Set environment variables:
export PADDLEOCR_ACCESS_TOKEN="your_token_here"
export PADDLEOCR_API_URL="https://your-endpoint.aistudio-app.com/layout-parsing"

# Optional: For async mode
export PADDLEOCR_JOB_URL="https://your-job-endpoint.aistudio-app.com/api/v2/ocr/jobs"
export PADDLEOCR_MODEL="PaddleOCR-VL-1.5"

Usage Examples

Sync Mode (Default)

For small files and quick processing:

# Parse local image
{baseDir}/paddleocr_parse.sh document.jpg

# Parse PDF
{baseDir}/paddleocr_parse.sh -t pdf document.pdf

# Parse from URL
{baseDir}/paddleocr_parse.sh https://example.com/document.jpg

# Save output to file
{baseDir}/paddleocr_parse.sh -o result.json document.jpg

# Verbose output
{baseDir}/paddleocr_parse.sh -v document.jpg

Async Mode

For large files with progress tracking:

# Parse large PDF with async mode
{baseDir}/paddleocr_parse.sh --async large-document.pdf

# Parse from URL with async mode
{baseDir}/paddleocr_parse.sh --async -t pdf https://example.com/doc.pdf

# Save async result to file
{baseDir}/paddleocr_parse.sh --async -o result.json document.pdf

Using Python Script Directly

# Sync mode
python3 {baseDir}/paddleocr_parse.py document.jpg

# Async mode
python3 {baseDir}/paddleocr_parse.py --async-mode document.pdf

# With output file
python3 {baseDir}/paddleocr_parse.py -o result.json --async-mode document.pdf

Response Structure

{
  "logId": "unique_request_id",
  "errorCode": 0,
  "errorMsg": "Success",
  "result": {
    "layoutParsingResults": [
      {
        "prunedResult": [...],
        "markdown": {
          "text": "# Document Title\n\nParagraph content...",
          "images": {}
        },
        "outputImages": [...],
        "inputImage": "http://input-image"
      }
    ],
    "dataInfo": {...}
  }
}

Important Fields:

  • prunedResult - Contains detailed layout element information including positions, categories, etc.
  • markdown - Stores the document content converted to Markdown format with preserved structure and formatting.

Mode Selection Guide

Use CaseRecommended Mode
---------------------------
Small images (< 10MB)Sync
Single page PDFsSync
Large PDFs (> 10MB)Async
Multi-page documentsAsync
Batch processingAsync
Quick text extractionSync

Error Handling

The script will exit with code 1 and print error message for:

  • Missing required environment variables
  • File not found
  • API authentication failures
  • Invalid JSON responses
  • API error codes (non-zero)

Quota Information

See official documentation: https://ai.baidu.com/ai-doc/AISTUDIO/Xmjclapam

版本历史

共 1 个版本

  • v1.0.4 当前
    2026-03-29 03:12 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 295 📥 136,537
content-creation

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,106
content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 861 📥 200,133