๐ซ The Pain Point
You have scanned contracts or photos of documents in Vietnamese. You need the text searchable and editable. Retyping manually is slow and error-prone.
๐ Agentic Solution
An OCR Tool optimized for Vietnamese text with high accuracy.
Key Features:
- Vietnamese Language Pack: Trained for VN characters (ฤ, รข, ฤ, ฦก, ฦฐ).
- Image Preprocessing: Enhance contrast for better recognition.
- Batch Processing: Extract text from multiple images.
โ๏ธ Phase 1: Commander (Quick Fix)
For quick OCR.
Prompt:
โI have a folder
scanswith images of Vietnamese documents. Write a Python script using pytesseract to:
- Preprocess: Convert to grayscale, increase contrast.
- OCR: Extract text using Vietnamese language pack (
vie).- Output: Save text to
{filename}.txtfor each image.Print progress. Handle unreadable images (skip with warning).โ
Result: Editable text from all scanned documents.
๐๏ธ Phase 2: Architect (Permanent Tool)
Engineering Prompt:
**Role:** Python Tool Developer
**Task:** Create a "Vietnamese OCR Tool".
**Requirements:**
1. **GUI:**
* Select image or folder.
* Language dropdown (vie, eng, vie+eng).
* Preprocessing options (contrast, rotate).
* Preview extracted text.
* Export as TXT or DOCX.
2. **Logic:**
* Use pytesseract with tessdata.
* Image preprocessing with Pillow.
* Confidence scoring.
3. **Deliverables:**
* `ocr_vietnamese.py`
* `run.bat`, `run.sh`
* `requirements.txt`
๐ง Prompt Decoding
- Tesseract vie: Must download Vietnamese language data separately.
๐ ๏ธ Instructions
- Install Tesseract OCR engine.
- Download Vietnamese language pack.
- Install:
pip install pytesseract pillow - Copy Prompt โ Run.