yao-ocr
它能做什么
这项技能从扫描的图片和 PDF 文件中读取文字,例如发票、收据和表格。适合需要把印刷或手写文字转换为可编辑文字的人。
适用场景
- ✓当你有一张扫描的发票或收据,需要把其中的细节转换为文字的时候。
- ✓当 PDF 是扫描件,你需要让其文字可搜索或可编辑时。
- ✓当图片中的表格需要转换为你可以处理的格式时。
技能链接
https://github.com/YaoApp/yao/blob/main/tools/skills/yao-ocr/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把这份扫描发票 PDF 中所有的金额和明细项提取出来,并整理成表格。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会把图片或 PDF 发送给文字识别引擎,它可以是视觉模型,也可以是传统的 OCR 服务。它会返回纯文本、Markdown 表格或结构化数据。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
OCR Tools
Two tools for optical character recognition, supporting both VLM-OCR (vision language models) and traditional OCR APIs (Baidu, Google, Azure, PaddleOCR).
ocr_recognize
Extract text from images or PDF files using OCR.
Basic usage (plain text output):
tai tool ocr_recognize --source /path/to/image.png
With URL:
tai tool ocr_recognize --source https://example.com/document.jpg
Table extraction as Markdown:
tai tool ocr_recognize --source /path/to/table.png --type table --output_format markdown
Invoice structured extraction:
tai tool ocr_recognize --source /path/to/invoice.pdf --type invoice --output_format json
With specific provider:
tai tool ocr_recognize --source /path/to/doc.png --provider baidu
VLM-OCR with custom prompt:
tai tool ocr_recognize --source /path/to/doc.png --provider llm:qwen-ocr --prompt "只提取表格中的金额列"
PDF page range:
tai tool ocr_recognize --source /path/to/report.pdf --pages "1-5" --output_format markdown
| Parameter | Type | Required | Description |
|---|---|---|---|
| source | string | yes | Image or PDF file path/URL to recognize |
| provider | string | no | LLM connector ID (llm:xxx) or OCR settings key (baidu/paddleocr/google/azure). Auto-selects if omitted |
| type | string | no | Recognition type (default: general). See type table below |
| output_format | string | no | text (default), json (with coordinates/fields), or markdown (structured) |
| mode | string | no | accurate (default, best quality) or standard (faster) |
| language | string | no | Language hint (ISO 639-1, e.g. en, zh, ja). Auto-detected if omitted |
| prompt | string | no | Custom instruction for VLM-OCR only, appended to system prompt. Ignored by traditional OCR |
| pages | string | no | PDF page range, e.g. 1-5 or 1,3,7. All pages if omitted |
| extra | JSON | no | Provider-specific parameters as a JSON object |
Recognition types
| Type | Description | Best output_format |
|---|---|---|
general |
General text (default) | text |
table |
Table extraction | markdown |
handwriting |
Handwritten text | text |
document |
Document layout parsing | markdown |
invoice |
Invoice (VAT) | json |
receipt |
Receipt / ticket | json |
id_card |
ID card | json |
bank_card |
Bank card | json |
license |
Business license | json |
vehicle_license |
Vehicle license | json |
passport |
Passport | json |
license_plate |
License plate | json |
If the chosen provider does not support the requested type, it automatically degrades to general and annotates the response metadata with degraded_from. VLM-OCR supports all types via prompt adaptation.
ocr_providers
List available OCR providers and their supported recognition types.
tai tool ocr_providers
Returns a list of providers including VLM-OCR models (from LLM connectors with ocr capability) and traditional API providers (from OCR settings). Each entry includes id, name, type (vlm or traditional), and supported_types.
PDF support
| Provider | Notes | |
|---|---|---|
| Baidu | yes | pdf_file parameter |
| Azure | yes | Document Intelligence native support |
| PaddleOCR | yes | pdf + fileType=0 |
| no |
常见问题
有哪些输出格式?
纯文本、Markdown 表格,以及 JSON 等结构化数据。
我可以选择页码范围吗?
可以。对于 PDF,你可以选择一个页码范围。
它能处理手写内容吗?
这项技能把手写文档列入了涵盖范围,不过结果取决于所用的引擎。
详情
作者的原始描述
OCR text recognition expert. ALWAYS invoke this skill when you need to extract text from images or PDFs — including invoices, receipts, ID cards, bank cards, business licenses, tables, handwritten documents, or any visual text content.
repo: YaoApp/yao
热度
- GitHub 星标
- 8.3k
- 排名
- #12477
- 许可证
- —
- 更新时间
- 2026/10/19
评论
- …