CookbooksOCR Cookbooks
Process Nepali Hindi and English Documents
Handle mixed Nepali, Hindi, and English documents with per-page language hints.
- Send a
language_hintper page for mixed-language PDFs - Compare output quality across scripts with confidence scores
- Save per-page Markdown for downstream review
Time to complete: ~10 minutes
Prerequisites
- A
SAGEA_API_KEYexported as an environment variable - A mixed-language file 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: OCR with a language hint
Pass language_hint alongside the document to bias script recognition per page.
ARVA OCR supports 150+ languages with 99.2% accuracy on clean 300 DPI scans.
Step 2: Compare hints per language
Run Hindi and English hints and keep the best-confidence result per page.
Each response uses the standard shape with text, pages, confidence, blocks, and model_used set to arva-ocr.
Step 3: Save per-page output for review
Split the best result by page and write Markdown files for reviewers.
Standard pages cost $1.00 per 1000 pages and 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 file to PDF or PNG and retry |
413 Payload Too Large | File is over 100MB | Compress or split the file, then retry |
429 rate_limit_exceeded | Too many requests at once | Back off with retries and reduce concurrency |
