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.
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
本技能來自小蔥技能站7w4.net。
Common scripts are located in the scripts/ directory.
這個 OCR 技能質量中規中矩,優點是支援中文英文、能處理掃描版 PDF 和圖片,功能比較實用。文件寫得很清晰,中英文都有,上手容易。不足之處是缺少依賴說明檔案,示例程式碼和實際指令碼的用法不一致,容易讓人困惑,另外沒有測試程式碼,質量保障不足。總體來說能用,但細節打磨還需加強。