技能标识:china-doc-ocr
智能文档OCR识别与结构化提取。Use when the user has a complex document, PDF, scanned image, photo, invoice, receipt, ID card, table, or chart that needs to be recognized and converted to text or Markdown. Uses PaddleOCR-VL-1.5 and DeepSeek-OCR (free, fast). Falls back to Qwen2.5-VL if OCR fails. 国内直连,无需翻墙。
识别并提取复杂文档内容:PDF、图片、扫描件、发票、表格、证件等。
使用硅基流动 DeepSeek-OCR / PaddleOCR-VL,国内直连,无需翻墙。
与 china-image-gen、china-tts 共用同一个 SILICONFLOWAPIKEY。
模型选择与参数说明 → references/models.md
各场景提示词模板 → references/prompts.md
OCR优先级:
默认使用 PaddleOCR-VL-1.5
如果识别效果不好,降级到 DeepSeek-OCR
如果仍然不好,降级到 Qwen2.5-VL-72B
bash
echo ✅ 环境检查通过
用户提供文件路径或 URL → 判断类型:
文件扩展名/用户描述 → 处理模式:
.pdf → PDF 模式(见 Step 3)
.jpg/.jpeg/.png/.webp → 图片模式(见 Step 2)
.bmp/.tiff/.gif → 图片模式(先转换格式)
URL(http/https开头) → URL 直接模式(见 Step 2B)
用户粘贴了 base64 → 直接使用
用户意图 → 选择 Prompt 模式(见 references/prompts.md):
转成文字/提取文字 → 通用OCR
转成Markdown/保留格式 → 文档转Markdown
提取表格/表格数据 → 图表解析
发票/收据/单据 → 发票识别
身份证/证件/执照 → 证件识别
图表/图形/柱状图 → 图表解析
未指定 → 默认文档转Markdown
bash
IMAGE_PATH=/path/to/image.jpg # 用户提供的图片路径
PROMPT=
curl -s -X POST https://api.siliconflow.cn/v1/chat/completions \
-H Authorization: Bearer $SILICONFLOWAPIKEY \
-H Content-Type: application/json \
-d {
\model\: \$MODEL\,
\messages\: [
{
\role\: \user\,
\content\: [
{
\type\: \image_url\,
\image_url\: {
\url\: \data:${MIME};base64,${BASE64_DATA}\,
\detail\: \high\
}
},
{
\type\: \text\,
\text\: \$PROMPT\
}
]
}
],
\max_tokens\: 4096,
\stream\: false
} | python3 -c
import sys, json
data = json.load(sys.stdin)
if choices in data:
print(data[choices][0][message][content])
else:
print(错误:, json.dumps(data, ensure_ascii=False))
bash
IMAGE_URL=https://example.com/document.jpg
curl -s -X POST https://api.siliconflow.cn/v1/chat/completions \
-H Authorization: Bearer $SILICONFLOWAPIKEY \
-H Content-Type: application/json \
-d {
\model\: \Pro/deepseek-ai/DeepSeek-V3\,
\messages\: [
{
\role\: \user\,
\content\: [
{
\type\: \image_url\,
\image_url\: {
\url\: \$IMAGE_URL\,
\detail\: \high\
}
},
{
\type\: \text\,
\text\: \
}
]
}
],
\max_tokens\: 4096
} | python3 -c
import sys, json
data = json.load(sys.stdin)
print(data[choices][0][message][content])
Step 3:PDF OCR
bash
PDF_PATH=/path/to/document.pdf
curl -s -X POST https://api.siliconflow.cn/v1/chat/completions \
-H Authorization: Bearer $SILICONFLOWAPIKEY \
-H Content-Type: application/json \
-d {
\model\: \Pro/deepseek-ai/DeepSeek-V3\,
\messages\: [
{
\role\: \user\,
\content\: [
{
\type\: \image_url\,
\image_url\: {
\url\: \data:application/pdf;base64,${BASE64_PDF}\,
\detail\: \high\
}
},
{
\type\: \text\,
\text\: \
}
]
}
],
\max_tokens\: 8192
} | python3 -c
import sys, json
data = json.load(sys.stdin)
print(data[choices][0][message][content])
bash
PDF_PATH=/path/to/multipage.pdf
OUTPUTDIR=${OPENCLAWWORKSPACE:-$PWD}/ocr$(date +%Y%m%d%H%M%S)
mkdir -p $OUTPUT_DIR
pdfpath = $PDFPATH
outputdir = $OUTPUTDIR
apikey = $SILICONFLOWAPI_KEY
以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:
帮我安装 SkillHub 和 china-doc-ocr-1776108909 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 china-doc-ocr-1776108909 技能
skillhub install china-doc-ocr-1776108909
文件大小: 8.33 KB | 发布时间: 2026-4-14 12:35