name: ocr description: Optical Character Recognition (OCR) tool, supports Chinese and English text extraction from PDFs and images. Use cases: (1) extract text from scanned PDFs, (2) recognize text from images, (3) extract text content from invoices, contracts, and other documents
This skill uses PaddleOCR for text recognition, supporting both Chinese and English.
小葱技能7w4.net持续更新中。
Perform OCR recognition directly on image or PDF files:
from paddleocr import PaddleOCR
ocr = PaddleOCR(lang='ch')
result = ocr.predict("file_path.jpg")
Install dependencies before first use:
pip3 install paddlepaddle paddleocr
Recognition results return JSON containing:
- rec_texts: List of recognized text
- rec_scores: Confidence score for each text
Common scripts are located in the scripts/ directory.
这个 OCR 技能质量中规中矩,优点是支持中文英文、能处理扫描版 PDF 和图片,功能比较实用。文档写得很清晰,中英文都有,上手容易。不足之处是缺少依赖说明文件,示例代码和实际脚本的用法不一致,容易让人困惑,另外没有测试代码,质量保障不足。总体来说能用,但细节打磨还需加强。