Beyond Arabic: Software for Perso-Arabic Script Manipulation

Alexander Gutkin, Cibu Johny, Raiomond Doctor, Brian Roark, Richard SproatarXiv 2023 · DOI

TL;DR

Researchers at Google have developed an open-source library using Finite-State Transducers (FSTs) to standardize the "script diaspora" of Perso-Arabic writing systems. By providing sophisticated normalization, romanization, and transliteration for 11 languages—including Urdu, Persian, and Kurdish—this tool helps clean up the noisy digital text that often plagues NLP models for these regions.

What Problem Does This Paper Address?

While the Perso-Arabic script originated for the Arabic language, it has been adapted by dozens of languages across diverse families (Indo-Aryan, Turkic, etc.) used by nearly a billion people. This adaptation led to a "script diaspora" where different regions developed unique consonant shapes and diacritic systems.

In the digital world, this creates a mess. Unicode often allows the same visual character to be represented by multiple different underlying encodings. Furthermore, inconsistent input methods and evolving orthographies mean that web-crawled data (like Wikipedia or Common Crawl) is riddled with visual inconsistencies. For a computer, two words that look identical to a human might be treated as completely different strings, which degrades the performance of Natural Language Processing (NLP) tasks like machine translation or spell-checking.

Methods

The authors built their library using Finite-State Transducers (FSTs) via the Pynini Python library. FSTs are highly efficient for string manipulation because they allow complex, context-dependent rewrite rules to be composed into a single, fast pipeline.

The library categorizes script manipulation into several layers:

  1. Unicode Normalization (NFC): The standard baseline that handles basic character compositions and re-orderings.
  2. Visual Normalization ($V$): This goes beyond Unicode to fix sequences that are visually identical but encoded differently. It includes a language-agnostic component ($V_c$) and a language-specific component ($V_l$) that accounts for word position (initial, medial, final, or isolated).
  3. Reading Normalization ($R$): These transformations modify a character's shape to match regional orthographic standards while preserving the word's identity and pronunciation.
  4. Romanization and Transliteration: Converting Perso-Arabic strings to Latin script (and back) based on Library of Congress and ISO standards.
Summary of script transformation operations

Datasets

To develop their rules, the authors analyzed publicly available online data, including:

  • Wikipedia
  • Wikipron
  • Common Crawl

For validation and "sanity checks," they used word-frequency lists from the Crúbadán Project for three specific languages: Sorani Kurdish (ckb), Sindhi (sd), and Uyghur (ug).

Key Insights and Ideas

  • Beyond Agnostic Normalization: The core "aha moment" is that standard Unicode normalization (NFC) is insufficient for the Perso-Arabic diaspora. Because NFC is language-agnostic, it cannot resolve ambiguities that depend on a specific language's orthography.
  • The Power of Composition: By using FSTs, the authors can apply a chain of complex rules—NFC, then visual fixes, then regional reading fixes—and compile them into a single mathematical object that processes text in a single pass.
  • Typology Mapping: The paper introduces a formal mapping between Unicode code points and the specific languages that use them. This is a vital resource for researchers working on "lesser-resourced" languages, allowing them to auto-generate orthographic inventories.

Key Results

The authors demonstrated that their normalization significantly impacts real-world data. As shown in the table below, the amount of text requiring correction varies wildly by language.

Examples of reading normalization
  • Urdu was found to be relatively "clean," with only ~0.1% of tokens needing change, suggesting stable input methods and regular orthography.
  • Sorani Kurdish saw a massive change: over 30% of tokens were modified when applying both visual and reading normalization.
  • FST Complexity: The visual normalization FSTs are quite large, reflecting the complexity of the script. For example, the Punjabi (Shahmukhi) FST contains over 2 million states and 4 million arcs.
Table 4: Summary of FSTs over UTF-8 strings for visual and reading normalization.

Limitations and Future Work

The authors acknowledge that web-crawled data is inherently noisy. A major hurdle is the lack of robust Language Identification (LID) for these scripts. If a sentence contains both Kashmiri and Pashto, a single normalization pipeline might accidentally apply the wrong regional rules to the wrong words.

Future work aims to:

  • Expand coverage beyond the initial 11 languages.
  • Include Ajami scripts used in Sub-Saharan Africa.
  • Integrate more robust LID models to handle code-switched text more effectively.

The library is open-source and available as part of the Nisaba project.

Summary updated

BibTeX
@misc{gutkin2023beyond,
  author = {Alexander Gutkin and Cibu Johny and Raiomond Doctor and Brian Roark and Richard Sproat},
  title = {{Beyond Arabic: Software for Perso-Arabic Script Manipulation}},
  year = {2023},
  eprint = {2301.11406},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2301.11406},
}
Figure