Service · Documents & OCR

Custom 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.

Planning a whole collection? Our custom Arabic document datasets cover workflows such as invoice checks, forms and procurement, including extraction and questions grounded in the page. This annotation service handles the reading order, transcriptions and labels your documents need.

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:

ProblemExampleGround-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 lettersStore ل + ا. 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 sets0–9, ٠–٩, ۰–۹; ٤ and ۴ are different code pointsTranscribe digits as printed; normalize in a separate field.
Letter variantsFinal ي 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 scanWrong ground truthCorrect ground truth
رقم الفاتورة: INV-2024-0183ةروتافلا مقر: visual order, as some PDF text layers output itLogical order; key رقم الفاتورة ("invoice number") linked to value INV-2024-0183
A phone number with spaced digit groups inside an Arabic lineGroups 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

UnitGeometryTranscription and labelsChecked with
RegionPolygon or boxRegion class and reading-order indexClass agreement, order errors
Text linePolygon, rotated box or baselineFull line in logical order; Latin runs tagged; illegible spans markedCharacter and word error rate (CER, WER)
Word / characterWord box covers dots and diacritics; character boxes optional, one per ligatureMatches the line transcription; base Unicode lettersBox overlap (IoU), dot errors
FieldKey box, value box, linkText as printed, normalized value, entity typeExact match per field
TableCell boxes with row, column and span indicesCell text in logical order, header flagsTEDS (tree-edit-distance similarity)
PIIBox and categoryOptional if you only redactRecall: 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.

Scoping an Arabic document project: OCR text, layout, fields and evidence

"Annotate our invoices" can mean four different deliveries. OCR text teaches a model to read; layout and reading order teach it how a page is organized; normalized fields teach it to extract; document questions and validation checks teach it to answer from the page and notice when the numbers disagree. You can commission the first layer on its own or add the others, but each one needs its own labels, its own acceptance check and its own rule for keeping test documents apart. Decide which layers you are buying before the pilot, because adding fields later usually means a second pass over every page.

Layer: what the model learnsWhat each label carriesHow it is acceptedKeep the test split apart by
OCR text: read printed and handwritten Arabic, Latin runs and digitsLine or word polygon, transcription in logical (reading) order, script tag, illegible spans markedCharacter and word error rate on gold pages, reported by slice (printed vs handwritten, capture quality); dot and digit errors counted separatelySource, and writer for handwriting
Layout and reading order: know what each region is and the order to read itRegion class (header, table, stamp, signature, handwriting, free text) and a reading-order index across right-to-left and bilingual columnsRegion class agreement and reading-order errors against adjudicated pagesTemplate
Normalized fields: extract values a system can useKey and value boxes, text as printed, normalized value, entity type and the evidence location (page ID and box) for every valueExact match per field on the normalized value, a format check, and every value traced back to its boxIssuer and template
Document questions and validation checks: answer from the page and flag what does not add upQuestion, answer, the region or regions holding the answer, a flag for questions the document cannot answer, and checks such as subtotal minus discount plus VAT against the total on the pageAnswer matches, its evidence contains the answer, and each check can be recomputed from the labeled fieldsIssuer, template and source, so no test question is about a page seen in training

Page count is not template count

Many invoices from one accounting system can be a single layout filled in many times. A model trained and tested on them can score well by memorizing where the total sits, then fail on the first invoice from a new supplier. A document scope should therefore report pages, distinct issuers, distinct templates and, for handwriting, distinct writers as separate numbers, keep variants of one template identifiable, and put whole issuers or templates, not single pages, into the test split. Genuine, de-identified and synthetic pages stay distinguishable in the delivery, so you can measure how a model trained on rendered pages does on real scans.

The fields a document scope should fix before the first page

  • Source and provenance type: genuine, de-identified or synthetic, and the written permission behind each source. Source permissions are defined with you before collection.
  • Page or image ID and page size: a stable ID plus the pixel width and height, so every coordinate can be checked against the page it belongs to.
  • Reading order: an index for every region and line, across right-to-left, left-to-right and mixed runs.
  • Polygon or bounds: the geometry level (region, line, word, character) and the coordinate convention, such as pixels from the top-left corner.
  • Raw OCR text: the transcription as printed, in logical order, with Arabic or Latin digits and separators kept.
  • Normalized fields: the field list, the normalized format of each (dates, amounts, ID numbers) and the rule when a field is missing or corrected by hand.
  • Evidence location: the page ID and box for every extracted value and every answer.
  • Issuer and template split: the issuer, template and, for handwriting, writer each page belongs to, so a template appears in one split only.
  • Volume: an estimate up front, fixed after the pilot shows throughput and difficulty on your documents.

Illustrative record: one synthetic invoice, every value tied to its evidence

This record was written by Bayanat Labs for this page to show the format. It is not a delivered record or a catalog sample: there is no underlying page, and the seller, amounts, coordinates and IDs are invented. Coordinates are pixels from the top-left corner, as [x1, y1, x2, y2].

FieldIllustrative value
Source and provenance type(Illustrative) synthetic invoice: invented seller, describing a rendered layout with one handwritten correction
Page ID and sizedoc_000417_p1, 2480 × 3508 px (A4 at 300 dpi)
Invoice numberKey رقم الفاتورة ("invoice number") at [1820, 410, 2210, 470]; value INV-2026-0417 at [1380, 410, 1790, 470]
Issue dateAs printed ٢٠٢٦/١٠/٠٨ at [1380, 490, 1790, 550]; normalized 2026-10-08 (Gregorian)
Subtotal, discount, VATAs printed ١٬٢٥٠٫٠٠, ١٠٠٫٠٠ and ١٧٢٫٥٠, each with its own box; normalized 1250.00, 100.00 and 172.50 SAR
TotalPrinted ١٬٤٢٢٫٥٠, struck through, at [310, 2950, 720, 3030]; handwritten ١٬٣٢٢٫٥٠ beside it at [760, 2940, 1180, 3040], region class "handwriting"
Document questionما المبلغ المستحق بعد الخصم؟ ("What is the amount due after the discount?") Answer: 1322.50 SAR; evidence: the handwritten total box
Validation check1250.00 − 100.00 + 172.50 = 1322.50: matches the handwritten total, not the printed one. Flag "printed total corrected by hand"
Issuer and template splitissuer_042, tpl_042_a: every page from this issuer goes to the same split
Volume[estimated up front, fixed after the pilot]

Two guideline decisions hide in this one record. Which total is the value of the field: the guideline has to say whether a handwritten correction overrides print, and whether both amounts are kept. And the box for each amount must sit inside the 2480 × 3508 page and enclose the digits it claims; a checker can test both mechanically before a human looks at the page.

How a document pilot is accepted

Draw the pilot sample yourself, stratified by issuer, template, capture quality and handwriting share. Render each transcription right to left beside its crop, recompute every normalized value from the text as printed, check that every box falls inside its page and encloses its value, recompute each validation check from the labeled fields, re-label 10 to 20 pages yourself, and confirm that no issuer or template appears in both training and test. Our guide to how to evaluate an Arabic OCR dataset covers these checks, and more, in a 10-point audit you can reuse for any vendor, including us.

For a new collection, Bayanat Documents builds Arabic document datasets to order, with page count and template coverage agreed with you. If the documents will feed a search or RAG system, Bayanat Search adds queries, relevance judgments and grounded answers over them; to compare models on reading and extraction, Bayanat Bench builds held-out tests kept separate from training deliveries. To scope a project, send the document types, the layers you need, the sources you can authorize and your timeline: discuss document type, authorized sources and exact custom labels.

How an Arabic OCR annotation project runs

Each project follows Vet → Train → Produce → QA → Deliver:

  1. Scoping. Document types, handwriting share, capture quality, schema, volume and residency, checked on real pages.
  2. 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.
  3. Pilot. Error rates and agreement measured; the spec revised where disagreement is systematic.
  4. Production with QA. Hidden gold pages in every queue, double transcription on a sample, adjudication and rework loops.
  5. 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.

PagesModel pre-labels?Human role
Clean printed MSA, one columnYes, once it clears your floor on goldCorrect flagged lines, audit a sample
Bilingual invoices and formsText yes, fields with careVerify digits, bidi order, every key-value link
Handwriting, diacritized text, historical print, poor photosRarelyHuman-first transcription
Gold and evaluation setsNoDouble 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

CriterionIn-house teamCrowd platformSpecialist Arabic vendor
Handwriting and diacriticsLimited to who you can hireReading level hard to verifyScreened native readers
Bidi and reading orderYour tooling and trainingOften left to the toolWritten into spec and QA
Best forStable, long-running document typesHigh-volume clean printHandwriting, 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.

Can I order OCR text without field extraction labels?

Yes. Transcription, coordinates and reading order can be commissioned on their own, and layout, normalized fields, document questions and validation checks added when your model needs them. Each layer needs its own acceptance check and split rule; how to scope a document project lists them, with an illustrative invoice record.

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.

Scope a pilot on your own data

Tell us the dialects, domain, modality and volume. We come back with a fixed-scope pilot, gold-standard QA and a quality report — usually within two weeks.

Talk to us