New: conversational Urdu and Punjabi speech corpora now licensable  See the catalog →

Research

Why Urdu OCR is so much harder than Arabic OCR

Nastaliq breaks OCR pipelines built for Arabic. Sloping baselines, extreme ligature context and overlapping glyphs explain why, and what training data fixes it.

Key takeaways

  • Urdu is written in Nastaliq, not Naskh. OCR trained on Arabic newsprint fails on it, often badly.
  • Nastaliq baselines slope diagonally downward, so standard horizontal line-segmentation breaks immediately.
  • Letter shapes depend on position and neighbours to a far greater degree than in Naskh, producing thousands of distinct ligature forms.
  • Fixing it requires Nastaliq-specific training data with reading-order annotation — not more Arabic data.

Nastaliq and Naskh are not interchangeable

Both write the Perso-Arabic alphabet, so pipelines routinely assume one model covers both. It does not. Naskh — the style used for most Arabic printing — sits on a horizontal baseline with relatively stable letterforms. Nastaliq, the calligraphic style used for Urdu, is a different visual system that happens to share an alphabet.

The practical consequence: an OCR model with excellent Arabic performance can produce close to unusable output on Urdu newsprint, and teams often lose weeks assuming the problem is scan quality.

The sloping baseline problem

In Nastaliq, words cascade diagonally downward from right to left. There is no single horizontal line to segment on. Standard document pipelines start with horizontal line detection, and that first step fails, so everything downstream inherits the error.

Adjacent lines also interleave vertically — the tail of one line can descend into the space of the next — which defeats naive bounding-box segmentation even when the slope is handled.

Context-dependent ligatures at scale

Arabic letters take four positional forms. Nastaliq goes considerably further: a letter's rendered shape depends on its neighbours in ways that generate thousands of distinct ligature forms in practice, many visually quite far from the isolated glyph.

A character-level model has to learn an enormous shape inventory. A ligature-level model has to learn a large vocabulary. Either way, the data requirement is substantially higher than for a comparable Naskh task.

Handwriting makes all of it worse

Everything above concerns printed Nastaliq. Handwritten Urdu adds unconstrained slope variation, personal ligature habits, inconsistent spacing and diacritics that writers frequently omit entirely — leaving the reader, and the model, to infer them from context.

For real-world documents — prescriptions, handwritten forms, ledgers, application slips — this is the actual task, and it is where generic models fail most completely.

What the training data has to look like

Nastaliq-specific, not Arabic-adjacent. Both printed and handwritten, since they are different distributions. Real documents rather than synthetic renders, because paper quality, ink bleed, photocopy degradation and phone-camera capture are all part of the problem.

Annotation needs reading order, not just bounding boxes, because the diagonal cascade means spatial position does not determine sequence. Field-level labels matter too if the downstream task is information extraction rather than transcription.

Related pages on this site

Answers

Frequently asked questions

Because Urdu is written in Nastaliq rather than Naskh. Nastaliq has diagonally sloping baselines, vertically interleaving lines and far more context-dependent ligature forms. A model trained on Naskh Arabic fails at line segmentation before it reaches character recognition.

Synthetic renders are useful for bootstrapping and augmentation, particularly for printed text. They do not capture the degradation of real documents — ink bleed, photocopy artefacts, folds, phone-camera skew — and they capture handwriting variation poorly. Expect to need real scans for production quality.

It depends heavily on whether you are handling printed text, handwriting or both, and on how constrained your document types are. A narrow printed-form task can work with tens of thousands of annotated pages; open-domain handwriting recognition needs substantially more. Tell us the document type and we will give a realistic figure.

Send us a document your OCR cannot read.

We will tell you what kind of training data closes the gap and roughly how many pages it takes.

Average first response: under 6 business hours. NDAs signed same day.

Free samples Get a quote