CookbooksOCR Cookbooks
Read Handwriting with Confidence Review
Transcribe handwritten intake forms and route uncertain blocks to staff for review.
- Transcribe handwriting blocks with per-block confidence scores
- Apply a confidence threshold to flag uncertain fields
- Build a review queue with page numbers and text
Time to complete: ~10 minutes
Prerequisites
- A
SAGEA_API_KEYexported as an environment variable - A scanned intake form in PDF, PNG, JPG, TIFF, or WEBP format, max 100MB, ideally 300 DPI
- Python 3.9+ with the
requestspackage installed - Set up document processing
- ARVA OCR model card
Step 1: Transcribe the intake form
Use model="arva-ocr" with JSON output to get handwriting blocks and confidence.
Expected block shape:
ARVA OCR supports 150+ languages and hits 99.2% on clean 300 DPI scans. Handwriting scores lower, so review matters.
Step 2: Flag low-confidence blocks
Split blocks into accepted and needs-review sets with a threshold.
Step 3: Build a review file for staff
Write a Markdown review queue that counselors can check quickly.
Standard pages cost $1.00 per 1000 pages, complex pages $2.50 per 1000 pages.
Verify
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | Missing or invalid API key | Export a valid key as SAGEA_API_KEY and retry |
400 unsupported_format | File type not in PDF, PNG, JPG, TIFF, WEBP | Convert the scan to JPG or PDF and retry |
413 Payload Too Large | File is over 100MB | Downsample or split the scan, then retry |
429 rate_limit_exceeded | Too many requests at once | Back off with retries and reduce concurrency |
