Arabic OCR annotation for document AI
Line, word, field and table ground truth for printed and handwritten Arabic documents, built on transcription rules agreed up front, checked against gold pages and hosted in-region by default.
Bayanat Labs provides Arabic OCR annotation for document AI teams: ground truth for printed and handwritten Arabic, with line, word and character geometry, exact transcriptions, right-to-left and mixed-direction reading order, key-value fields, tables and PII boxes. Native annotators follow transcription rules agreed before the first page, and every batch is checked against gold pages from your own documents. Data stays in-region by default, and you start with a fixed-scope pilot, usually within two weeks.
What our Arabic OCR annotation covers
Lines and words
Line polygons and word boxes with logical-order transcriptions, for PDFs, scans and photos. A word box spans every piece: وزارة ("ministry") is five unconnected letters.
Characters and diacritics
Character boxes where needed, with harakat and shadda as printed. Initial بـ تـ ثـ نـ يـ differ only in their dots, so dot errors are scored separately.
Fields and key-value pairs
Keys, values and explicit links on IDs, invoices, statements and forms, plus normalized Hijri and Gregorian dates, amounts and ID numbers.
Tables
Cell boxes, row and column indices, merged cells and headers, ordered right to left. Structure is scored separately from cell text.
Layout and reading order
Headers, columns, stamps, signatures and handwriting on printed forms, with reading order across RTL and bilingual layouts.
Redaction
Boxes and categories for names, national ID and Iqama numbers, phones, IBANs and addresses, for masked copies or a redaction model.
Why Arabic OCR is hard, and the rule each problem needs
KITAB-Bench (Heakl et al., 2025), an 8,809-sample benchmark across 9 domains, lists complex fonts, numerals, word elongation and table structure among the open problems of Arabic OCR. Script-level traps need written rules:
| Problem | Example | Ground-truth rule |
|---|---|---|
| Dots carry meaning | خبر "news" vs حبر "ink" | Mark a character doubtful when its dots are unclear; never guess from context. |
| Optional diacritics | درس "he studied" vs درّس "he taught" | Keep harakat and shadda as printed. Strip them at evaluation time, never in ground truth. |
| Obligatory ligatures | لا: one glyph, two letters | Store ل + ا. The Unicode Standard says letters from the main Arabic block, not presentation forms, should be used for interchange, yet some PDF text layers emit them. |
| Three digit sets | 0–9, ٠–٩, ۰–۹; ٤ and ۴ are different code points | Transcribe digits as printed; normalize in a separate field. |
| Letter variants | Final ي without dots, ة written like ه, hamza dropped from أ | Choose diplomatic (as written) or corrected (as intended), once. |
Worked example: bidirectional text on a Saudi invoice
Saudi VAT Implementing Regulations (Article 53(5)) require the details on a tax invoice to appear in Arabic, with any other language shown as a translation, so Arabic sits beside Latin codes and digits. Unicode stores text in logical (reading) order and reorders only the display; annotators must recover the logical string from what they see:
| On the scan | Wrong ground truth | Correct ground truth |
|---|---|---|
| رقم الفاتورة: INV-2024-0183 | ةروتافلا مقر: visual order, as some PDF text layers output it | Logical order; key رقم الفاتورة ("invoice number") linked to value INV-2024-0183 |
| A phone number with spaced digit groups inside an Arabic line | Groups copied in the order they display, which in an RTL line can differ from the order they were typed: a different number | +966 11 123 4567 in logical order, value +966111234567. Digits within a group always run left to right. |
| الإجمالي: ١٬٢٥٠٫٠٠ ر.س | 1,250.00 (normalized too early), or ١٢٥٠٠٠ (separators lost: a different amount) | ١٬٢٥٠٫٠٠ with Arabic separators kept; value 1250.00 SAR |
Reviewers render each transcription in RTL beside its crop, and normalized values get format checks.
Arabic document annotation specs we agree up front
| Unit | Geometry | Transcription and labels | Checked with |
|---|---|---|---|
| Region | Polygon or box | Region class and reading-order index | Class agreement, order errors |
| Text line | Polygon, rotated box or baseline | Full line in logical order; Latin runs tagged; illegible spans marked | Character and word error rate (CER, WER) |
| Word / character | Word box covers dots and diacritics; character boxes optional, one per ligature | Matches the line transcription; base Unicode letters | Box overlap (IoU), dot errors |
| Field | Key box, value box, link | Text as printed, normalized value, entity type | Exact match per field |
| Table | Cell boxes with row, column and span indices | Cell text in logical order, header flags | TEDS (tree-edit-distance similarity) |
| PII | Box and category | Optional if you only redact | Recall: a missed ID number costs more than an extra box |
The spec also fixes tatweel, crossed-out text, stamps over text and output format (PAGE XML, ALTO or JSON); see our playbook on how to annotate Arabic text.
How an Arabic OCR annotation project runs
Each project follows Vet → Train → Produce → QA → Deliver:
- Scoping. Document types, handwriting share, capture quality, schema, volume and residency, checked on real pages.
- Spec and gold pages. A spec written around your documents; gold pages adjudicated by senior native linguists. Annotators pass screening before touching client data, then calibrate on gold.
- Pilot. Error rates and agreement measured; the spec revised where disagreement is systematic.
- Production with QA. Hidden gold pages in every queue, double transcription on a sample, adjudication and rework loops.
- Scale and delivery. Files in your schema, with quality reporting and an audit trail on every task.
Quality control for Arabic OCR training data
- Gold pages from your documents, not generic test sheets, for calibration and hidden checks, plus agreement between independent transcribers.
- Reported by slice: printed vs handwritten, Arabic vs Latin runs, document type, capture quality. A blended rate can hide failing digits on phone photos, so targets are set per slice.
- Adjudication and rework: a senior native linguist resolves disagreements, repeated disagreement changes the spec, and failed items are reworked.
Security and residency for IDs, invoices and records
An ID card or bank statement is almost entirely personal data. Pages are hosted in-region by default, with on-prem and private-cloud options. Access is least-privilege, actions are logged, and contributors work under NDA. Our PDPL and data residency checklist lists the questions to ask before the first upload.
Arabic document AI use cases by industry
By industry: KYC on IDs, Iqamas and commercial registrations, statements and bilingual invoices in banking; archive digitization with Hijri dates, stamps and handwritten notes in government; contracts and court documents in legal; lab reports and handwritten prescriptions, reviewed by licensed physicians, in healthcare; receipts, packaging and newspaper archives in media and retail.
When to automate Arabic OCR labeling, and when to use human annotators
In the KITAB-Bench paper (February 2025), modern vision-language systems such as GPT-4o and Gemini outperformed traditional OCR engines (EasyOCR, PaddleOCR, Surya) by an average of 60% in character error rate, yet the best model, Gemini-2.0-Flash, reached only 65% accuracy on PDF-to-Markdown conversion. Model rankings move quickly, so treat these figures as a snapshot. Our LabelBench audit covers text labels, not OCR, but shows a similar gap: on the fixed held-out manifest, a local language model at 78% exact-match accuracy on binary Arabic toxicity fell to 25.3% on the real multi-label taxonomy. We decide with Safe Automation Coverage: the fraction of a queue that can be accepted while the 95% Wilson lower confidence bound on accuracy stays above a declared target.
| Pages | Model pre-labels? | Human role |
|---|---|---|
| Clean printed MSA, one column | Yes, once it clears your floor on gold | Correct flagged lines, audit a sample |
| Bilingual invoices and forms | Text yes, fields with care | Verify digits, bidi order, every key-value link |
| Handwriting, diacritized text, historical print, poor photos | Rarely | Human-first transcription |
| Gold and evaluation sets | No | Double transcription and adjudication |
Synthetic rendered pages add fonts, not real scanners or hands: see the limits of synthetic data.
In-house team vs crowd platform vs specialist vendor
| Criterion | In-house team | Crowd platform | Specialist Arabic vendor |
|---|---|---|---|
| Handwriting and diacritics | Limited to who you can hire | Reading level hard to verify | Screened native readers |
| Bidi and reading order | Your tooling and training | Often left to the tool | Written into spec and QA |
| Best for | Stable, long-running document types | High-volume clean print | Handwriting, bilingual forms, regulated documents, gold sets |
Full scorecard: how to choose an Arabic data annotation vendor.
Pilot terms
A pilot has a fixed scope: one or two document types, an agreed set of your pages and the spec. It includes gold-standard QA and ends with a quality report: error rates by slice, an error taxonomy, spec revisions and how many pages could safely be pre-labeled. It usually completes within two weeks. To scope one through our contact page, send sample pages, your schema, volumes and residency constraints. Work then scales as a managed, embedded or enterprise engagement, alongside our wider Arabic data annotation services.
Frequently asked questions
What is OCR annotation?
OCR annotation pairs regions of a document image with the exact text they contain: boxes or polygons for lines, words or characters, each with a transcription, plus layout, reading order and field labels. It is the ground truth that text recognition and extraction models learn from and are tested against.
Can you annotate handwritten Arabic documents?
Yes. Native readers transcribe handwriting at line level, add word or character boxes when needed, and mark illegible spans instead of guessing. Gold pages should cover many writers, because hands vary far more than fonts. The public KHATT database has 1,000 forms from 1,000 writers, with ground truth at page, paragraph and line level.
Should Arabic OCR ground truth include diacritics?
Include them exactly where they are printed. Everyday Arabic mostly omits short vowels, but religious texts, poetry, children's books and textbooks carry them, and a shadda can change the word. Diacritics kept in ground truth can be stripped at evaluation time; diacritics never transcribed cannot be restored.
How much does Arabic OCR annotation cost?
We price per project after the pilot: a clean printed letter, a bilingual invoice with linked fields and a handwritten medical form are different jobs. The drivers are geometry level, handwriting share, fields and tables, PII handling and QA overlap. See our guide to Arabic data annotation cost.