DeepRead OCR
DeepRead - 生产级OCR API
DeepRead 是一个AI原生的OCR平台,可在数分钟内将文档转化为高精度数据。通过采用多模型共识机制,DeepRead实现了97%以上的准确率,并仅对不确定字段进行人机协同审核标记,从而将人工工作量从100%降低至5-10%。无需任何提示词工程。
功能说明
DeepRead 是生产级文档处理API,可在数分钟内提供高精度结构化数据输出,并通过人工审核标记功能,使人工复核仅需处理被标记的异常情况
核心特性:
- 文本提取:将PDF和图像转换为清晰标记文本
- 结构化数据:提取带置信度评分的JSON字段
- 人机协同界面:内置人机协同审核机制——不确定字段会被标记(
hil_flag),确保仅需对例外情况进行人工复核 - 多轮次处理:通过多重验证流程实现最高精度
- 多模型共识:模型间交叉验证确保可靠性
- 免费套餐:每月 2,000 页(无需信用卡)
设置
1. 获取您的 API 密钥
注册并创建 API 密钥:
# Visit the dashboard
https://www.deepread.tech/dashboard
# Or use this direct link
https://www.deepread.tech/dashboard/?utm_source=clawdhub
保存您的 API 密钥:
export DEEPREAD_API_KEY="sk_live_your_key_here"
2. Clawdbot 配置(可选)
添加到您的clawdbot.config.json5:
{
skills: {
entries: {
"deepread": {
enabled: true
// API key is read from DEEPREAD_API_KEY environment variable
// Do NOT hardcode your API key here
}
}
}
}
3. 处理您的第一个文档
选项 A:使用 Webhook(推荐)
# Upload PDF with webhook notification
curl -X POST https://api.deepread.tech/v1/process \
-H "X-API-Key: $DEEPREAD_API_KEY" \
-F "file=@document.pdf" \
-F "webhook_url=https://your-app.com/webhooks/deepread"
# Returns immediately
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "queued"
}
# Your webhook receives results when processing completes (2-5 minutes)
选项 B:轮询结果
# Upload PDF without webhook
curl -X POST https://api.deepread.tech/v1/process \
-H "X-API-Key: $DEEPREAD_API_KEY" \
-F "file=@document.pdf"
# Returns immediately
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "queued"
}
# Poll until completed
curl https://api.deepread.tech/v1/jobs/550e8400-e29b-41d4-a716-446655440000 \
-H "X-API-Key: $DEEPREAD_API_KEY"
使用示例
基础 OCR(仅文本)
提取为干净的 Markdown 文本:
# With webhook (recommended)
curl -X POST https://api.deepread.tech/v1/process \
-H "X-API-Key: $DEEPREAD_API_KEY" \
-F "file=@invoice.pdf" \
-F "webhook_url=https://your-app.com/webhook"
# OR poll for completion
curl -X POST https://api.deepread.tech/v1/process \
-H "X-API-Key: $DEEPREAD_API_KEY" \
-F "file=@invoice.pdf"
# Then poll
curl https://api.deepread.tech/v1/jobs/JOB_ID \
-H "X-API-Key: $DEEPREAD_API_KEY"
完成时的响应:
{
"id": "550e8400-...",
"status": "completed",
"result": {
"text": "# INVOICE\n\n**Vendor:** Acme Corp\n**Total:** $1,250.00..."
}
}
结构化数据提取
提取特定字段并附带置信度评分:
curl -X POST https://api.deepread.tech/v1/process \
-H "X-API-Key: $DEEPREAD_API_KEY" \
-F "file=@invoice.pdf" \
-F 'schema={
"type": "object",
"properties": {
"vendor": {
"type": "string",
"description": "Vendor company name"
},
"total": {
"type": "number",
"description": "Total invoice amount"
},
"invoice_date": {
"type": "string",
"description": "Invoice date in MM/DD/YYYY format"
}
}
}'
响应包含置信度标记:
{
"status": "completed",
"result": {
"text": "# INVOICE\n\n**Vendor:** Acme Corp...",
"data": {
"vendor": {
"value": "Acme Corp",
"hil_flag": false,
"found_on_page": 1
},
"total": {
"value": 1250.00,
"hil_flag": false,
"found_on_page": 1
},
"invoice_date": {
"value": "2024-10-??",
"hil_flag": true,
"reason": "Date partially obscured",
"found_on_page": 1
}
},
"metadata": {
"fields_requiring_review": 1,
"total_fields": 3,
"review_percentage": 33.3
}
}
}
复杂模式(嵌套数据)
提取数组和嵌套对象:
curl -X POST https://api.deepread.tech/v1/process \
-H "X-API-Key: $DEEPREAD_API_KEY" \
-F "file=@invoice.pdf" \
-F 'schema={
"type": "object",
"properties": {
"vendor": {"type": "string"},
"total": {"type": "number"},
"line_items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"description": {"type": "string"},
"quantity": {"type": "number"},
"price": {"type": "number"}
}
}
}
}
}'
逐页解析
获取带质量标记的每页OCR结果:
curl -X POST https://api.deepread.tech/v1/process \
-H "X-API-Key: $DEEPREAD_API_KEY" \
-F "file=@contract.pdf" \
-F "include_pages=true"
响应:
{
"result": {
"text": "Combined text from all pages...",
"pages": [
{
"page_number": 1,
"text": "# Contract Agreement\n\n...",
"hil_flag": false
},
{
"page_number": 2,
"text": "Terms and C??diti??s...",
"hil_flag": true,
"reason": "Multiple unrecognized characters"
}
],
"metadata": {
"pages_requiring_review": 1,
"total_pages": 2
}
}
}
何时使用此功能
✅ 适用场景:
- 发票处理:提取供应商、总额、明细项目
- 收据OCR识别:解析商户、商品、总额
- 合同分析:提取签约方、日期、条款
- 表格数字化:将纸质表格转为结构化数据
- 文档工作流:任何需要OCR+数据提取的流程
- 质量关键型应用:需要识别不确定提取内容时
❌ 不适用场景:
- 实时处理:处理需2-5分钟(异步工作流)
- 月度批量>2000页:请升级至PRO或SCALE套餐
工作原理
多轮次处理流程
PDF → Convert → Rotate Correction → OCR → Multi-Model Validation → Extract → Done
该流程自动处理:
- 文档旋转与方向校正
- 多轮次验证以确保准确性
- 跨模型共识以确保可靠性
- 字段级置信度评分
人机交互(HIL)界面
DeepRead内置人机交互(HIL)审核系统。人工智能将提取的文本与原始图像进行比对,并为每个字段设置hil_flag:
hil_flag: false= 清晰、置信度高的提取 → 自动处理hil_flag: true= 不确定的提取 → 转交人工审核
HIL 工作原理:
- 高置信度提取的字段将自动核准
- 不确定的字段会标记为
hil_flag: true并附上原因 - 仅需对标注字段进行人工审核(通常占总字段的5-10%)
- 在DeepRead预览界面(
preview.deepread.tech)中审核标注字段——这是一个专门的人机协同审核界面,审核员可并排查看原始文档与提取数据,修正标注字段并批准结果 - 或通过API响应中的
hil_flag数据集成至自有审核队列
AI在以下情况会对提取内容进行标注:
- 文本为手写体、模糊或质量低下
- 存在多种可能解读
- 字符部分可见或模糊不清
- 文档中未找到对应字段
此为多模态AI判定,非基于规则的系统
高级功能
1.蓝图(优化架构)
为特定文档类型创建可复用的优化架构:
# List your blueprints
curl https://api.deepread.tech/v1/blueprints \
-H "X-API-Key: $DEEPREAD_API_KEY"
# Use blueprint instead of inline schema
curl -X POST https://api.deepread.tech/v1/process \
-H "X-API-Key: $DEEPREAD_API_KEY" \
-F "file=@invoice.pdf" \
-F "blueprint_id=660e8400-e29b-41d4-a716-446655440001"
优势:
- 相比基准方案,准确率提升20-30%
- 可在同类文档间复用
- 支持版本管理与回滚
如何创建蓝图:
# Create a blueprint from training data
curl -X POST https://api.deepread.tech/v1/optimize \
-H "X-API-Key: $DEEPREAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "utility_invoice",
"description": "Optimized for utility invoices",
"document_type": "invoice",
"initial_schema": {
"type": "object",
"properties": {
"vendor": {"type": "string", "description": "Vendor name"},
"total": {"type": "number", "description": "Total amount"}
}
},
"training_documents": ["doc1.pdf", "doc2.pdf", "doc3.pdf"],
"ground_truth_data": [
{"vendor": "Acme Power", "total": 125.50},
{"vendor": "City Electric", "total": 89.25}
],
"target_accuracy": 95.0,
"max_iterations": 5
}'
# Returns: {"job_id": "...", "blueprint_id": "...", "status": "pending"}
# Check optimization status
curl https://api.deepread.tech/v1/blueprints/jobs/JOB_ID \
-H "X-API-Key: $DEEPREAD_API_KEY"
# Use blueprint (once completed)
curl -X POST https://api.deepread.tech/v1/process \
-H "X-API-Key: $DEEPREAD_API_KEY" \
-F "file=@invoice.pdf" \
-F "blueprint_id=BLUEPRINT_ID"
2. Webhooks(生产环境推荐)
处理完成时接收通知,无需轮询:
curl -X POST https://api.deepread.tech/v1/process \
-H "X-API-Key: $DEEPREAD_API_KEY" \
-F "file=@invoice.pdf" \
-F "webhook_url=https://your-app.com/webhooks/deepread"
处理完成后您的webhook将收到此数据载荷:
{
"job_id": "550e8400-...",
"status": "completed",
"created_at": "2025-01-27T10:00:00Z",
"completed_at": "2025-01-27T10:02:30Z",
"result": {
"text": "...",
"data": {...}
},
"preview_url": "https://preview.deepread.tech/abc1234"
}
优势:
- 无需轮询
- 任务完成即时通知
- 更低延迟
- 更适合生产工作流
3. 预览功能(人机协同审核界面)
DeepRead预览平台(preview.deepread.tech)是内置的人机协同审核界面。审核人员可并排查看原始文档与提取数据,修正标记字段并批准结果。预览链接支持免认证分享:
# Request preview URL
curl -X POST https://api.deepread.tech/v1/process \
-H "X-API-Key: $DEEPREAD_API_KEY" \
-F "file=@document.pdf" \
-F "include_images=true"
# Get preview URL in response
{
"result": {
"text": "...",
"data": {...}
},
"preview_url": "https://preview.deepread.tech/Xy9aB12"
}
公开预览端点:
# No authentication required
curl https://api.deepread.tech/v1/preview/Xy9aB12
速率限制与定价
免费层级(无需信用卡)
- 每月2,000页
- 每分钟10次请求
- 完整功能访问(OCR + 结构化提取 + 蓝图)
付费方案
- 专业版: 每月50,000页,每分钟100次请求 @ 每月99美元
- 企业版: 定制化批量定价(联系销售)
升级: https://www.deepread.tech/dashboard/billing?utm_source=clawdhub
速率限制响应头
每个响应都包含配额信息:
X-RateLimit-Limit: 2000
X-RateLimit-Remaining: 1847
X-RateLimit-Used: 153
X-RateLimit-Reset: 1730419200
最佳实践
1. 生产环境使用Webhook
✅ 推荐:Webhook通知
curl -X POST https://api.deepread.tech/v1/process \
-H "X-API-Key: $DEEPREAD_API_KEY" \
-F "file=@document.pdf" \
-F "webhook_url=https://your-app.com/webhook"
仅在以下情况使用轮询:
- 测试/开发
- 无法暴露Webhook端点
- 需要同步响应
2. 模式设计
✅ 良好:描述性的字段说明
{
"vendor": {
"type": "string",
"description": "Vendor company name. Usually in header or top-left of invoice."
}
}
❌ 不佳:无说明
{
"vendor": {"type": "string"}
}
3. 轮询策略(如需要)
仅在无法使用webhook时,每5-10秒轮询一次:
import time
import requests
def wait_for_result(job_id, api_key):
while True:
response = requests.get(
f"https://api.deepread.tech/v1/jobs/{job_id}",
headers={"X-API-Key": api_key}
)
result = response.json()
if result["status"] == "completed":
return result["result"]
elif result["status"] == "failed":
raise Exception(f"Job failed: {result.get('error')}")
time.sleep(5)
4. 处理质量标志
将置信度高的字段与不确定的字段分开:
def process_extraction(data):
confident = {}
needs_review = []
for field, field_data in data.items():
if field_data["hil_flag"]:
needs_review.append({
"field": field,
"value": field_data["value"],
"reason": field_data.get("reason")
})
else:
confident[field] = field_data["value"]
# Auto-process confident fields
save_to_database(confident)
# Send uncertain fields to review queue
if needs_review:
send_to_review_queue(needs_review)
故障排除
错误:配额超限
{"detail": "Monthly page quota exceeded"}
解决方案:升级到PRO版本或等待下一个结算周期。
错误:无效架构
{"detail": "Schema must be valid JSON Schema"}
解决方案:确保架构是有效的JSON并且包含类型和属性。
错误:文件过大
{"detail": "File size exceeds 50MB limit"}
解决方案:压缩PDF或分割成更小的文件。
任务状态:失败
{"status": "failed", "error": "PDF could not be processed"}
常见原因:
- 已损坏的PDF文件
- 受密码保护的PDF
- 不支持的PDF版本
- 图像质量过低,无法进行OCR识别
示例模式模板
发票模式
{
"type": "object",
"properties": {
"invoice_number": {
"type": "string",
"description": "Unique invoice ID"
},
"invoice_date": {
"type": "string",
"description": "Invoice date in MM/DD/YYYY format"
},
"vendor": {
"type": "string",
"description": "Vendor company name"
},
"total": {
"type": "number",
"description": "Total amount due including tax"
},
"line_items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"description": {"type": "string"},
"quantity": {"type": "number"},
"price": {"type": "number"}
}
}
}
}
}
收据模式
{
"type": "object",
"properties": {
"merchant": {
"type": "string",
"description": "Store or merchant name"
},
"date": {
"type": "string",
"description": "Transaction date"
},
"total": {
"type": "number",
"description": "Total amount paid"
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {"type": "string"},
"price": {"type": "number"}
}
}
}
}
}
合同模式
{
"type": "object",
"properties": {
"parties": {
"type": "array",
"items": {"type": "string"},
"description": "Names of all parties in the contract"
},
"effective_date": {
"type": "string",
"description": "Contract start date"
},
"term_length": {
"type": "string",
"description": "Duration of contract"
},
"termination_clause": {
"type": "string",
"description": "Conditions for termination"
}
}
}
支持与资源
- GitHub:https://github.com/deepread-tech
- 问题反馈:https://github.com/deepread-tech/deep-read-service/issues
- 电子邮件:hello@deepread.tech
重要提示
- 处理时间: 2-5分钟(异步,非实时)
- 异步工作流程: 使用webhooks(推荐)或轮询
- 速率限制免费套餐每分钟10次请求
- 文件大小限制: 每文件50MB
- 支持格式: PDF, JPG, JPEG, PNG
准备开始了吗?获取您的免费API密钥,请访问https://www.deepread.tech/dashboard/?utm_source=clawdhub


微信扫一扫,打赏作者吧~