Bayanat Labs Arabic NER Offset Validator
Arabic entity annotations break in ways that are hard to see: an emoji makes JavaScript and Python count offsets differently, a normalisation step turns alef with a combining hamza into one letter or the lam-alef ligature into two, tatweel or line breaks change after annotation, a span edge cuts a letter from its haraka, a conjunction sticks to a place name. The validator reads an annotation file in canonical JSON Lines, doccano, Label Studio, spaCy, CoNLL or Hugging Face token-row format and reports each problem with one of 27 finding codes and a message in English and Arabic; when it can tell what happened, it suggests new offsets as an audit diff for review. The offset unit (code points, UTF-16 code units, UTF-8 bytes or grapheme clusters) is declared, never guessed, and the report says which unit fits the text. The validator is a Python library and command-line tool, and a web app that runs the same checks in your browser, where the file is not uploaded or stored. It is tested on 100 dev and 100 acceptance test cases, published under CC BY 4.0: all 100 dev cases pass, and 96 of the 100 acceptance cases.
| Licence | Apache-2.0 (code and web app); CC BY 4.0 (test cases, offset-convention matrix and documentation); Unicode-derived data under the Unicode License v3 |
|---|---|
| Version | v0.1.0 · Code, test cases and web app v0.1.0, tagged on GitHub. Not on PyPI yet. |
| Published | |
| Updated | |
| Who it is for | Teams that annotate, buy or deliver Arabic named-entity data, and engineers who move it between annotation tools and training code, who want to find offset, normalisation, boundary and tag errors before training or delivery. |
| Level | Intermediate |
Key numbers
Counted by script from the released files. Each key number is read from docs/qa/numbers.json, released at tag v0.1.0 and recomputed by the repository's own script, and pinned to its SHA-256. The test-case dataset's MANIFEST.json gives the cases per split and category with checksums, and the web app's MANIFEST.json lists every file it serves with its SHA-256.
Downloads and identifiers
| Where | What |
|---|---|
| Hugging Face | Open the web app |
| bayanatlabs.com | Python and command line |
| GitHub | Code, test cases and matrix on GitHub |
| Hugging Face | Test cases as a Hugging Face dataset |
| GitHub | Checks and finding codes |
| GitHub | Quality report |
| GitHub | Offset-convention matrix |
Get started
Install the library and command-line tool from GitHub at the v0.1.0 tag; the package is not on PyPI yet. The web app needs no install.
pip install "git+https://github.com/Bayanat-Labs/arabic-ner-validator@v0.1.0"
arabic-ner-validator check annotations.jsonl --json report.json
arabic-ner-validator check export.jsonl --format doccano --offset-unit utf16 --clitic-policy exclude -v
arabic-ner-validator check train.conll --format conll --scheme BIOES
arabic-ner-validator convert export.jsonl --format spacy --offset-unit codepoint --to BILUO
arabic-ner-validator codes
What is released
| Part | Licence | In this release |
|---|---|---|
| Web app on Hugging Face Spaces: the same checks in your browser, interface in English and Arabic | Apache-2.0 | Yes |
| Python library and command-line tool (arabic-ner-validator) for Python 3.10 or later; offsets in code points, UTF-16 code units, UTF-8 bytes or grapheme clusters | Apache-2.0 | Yes |
| Test cases (dev and acceptance, also as a Hugging Face dataset), rejected-input examples, offset-convention matrix, JSON Schemas and documentation | CC BY 4.0 | Yes |
| Normalisation-drift inventory and grapheme-break tests derived from the Unicode Character Database 16.0.0 and 17.0.0 | Unicode License v3, copyright Unicode, Inc. | Yes |
| IBM Plex Sans Arabic font in the web app, unmodified (SIL Open Font License 1.1) | SIL Open Font License, copyright IBM Corp. | Yes |
Attribution: Arabic NER Offset Validator (arabic-ner-validator) by Bayanat Labs. https://github.com/Bayanat-Labs/arabic-ner-validator
Intended uses
- Check an Arabic NER annotation file before training, delivery or acceptance, with a code for each finding.
- Find offsets counted in the wrong unit, or text that changed after annotation, when data moves between doccano, Label Studio, spaCy, CoNLL and Hugging Face token rows.
- Convert between character offsets and BIOES or BILUO tags, and check tag sequences, in scripts and continuous integration.
Out of scope
- Judging whether an entity label is correct: the validator checks offsets, text, boundaries and tag structure, not the meaning of a label.
- Repairing data without review: suggested offsets are listed as an audit diff, and a repaired copy changes offsets only.
Rights at a glance
Training, display, redistribution and synthetic-voice use are separate permissions.
| Use | Status | Note |
|---|---|---|
| Training | Not applicable | A validator and test cases, not training data. The test cases are CC BY 4.0 if you reuse them. |
| Display | Allowed | Test cases, matrix and documentation under CC BY 4.0, with attribution. |
| Redistribution | Allowed | Code under Apache-2.0; test cases, matrix and documentation under CC BY 4.0; Unicode-derived data under the Unicode License v3; the bundled font under the SIL Open Font License. |
| Synthetic voice | Not applicable | No audio. |
Limitations
- The offset unit must be declared; the validator never guesses it.
- Some changes leave no trace in a record: when the stored text and the span texts were both normalised after annotation, the validator reports the mismatch but cannot name the cause. The quality report explains each acceptance case that does not pass.
- 96 of the 100 acceptance cases pass; on the build frozen before the acceptance cases were read, 86 passed. The changes made after reading them are listed in the changelog, and no test case was edited.
- A span that ends with Arabic punctuation gets a warning, which a project's own guidelines may allow.
- The test cases are synthetic sentences written for these sets, with places, organisations, public or historical figures or invented names. The Arabic text has not yet been reviewed by a native Arabic writer; the English governs.
- Install from GitHub for now; the package is not on PyPI yet.
Sources and licences
| Source | Licence | Redistributed here |
|---|---|---|
| Unicode Character Database 16.0.0 and 17.0.0 (UnicodeData.txt, DerivedNormalizationProps.txt, GraphemeBreakTest.txt) | Unicode License v3; derived tables included with the notice | Yes |
| spaCy 3.8.18, used as a test oracle for the BILUO conversions | MIT; used in the tests only, not bundled | No |
| Label Studio and doccano source code, read for the offset-convention matrix | Apache-2.0 (Label Studio) and MIT (doccano); cited by file, line and SHA-256, no code included | No |
The test cases were written for the validator: synthetic sentences with places, organisations, public or historical figures or invented names, none describing a real private person. The offset-convention matrix was measured with Python, JavaScript in Node and Chromium, spaCy and Hugging Face fast tokenizers on 20 Arabic probe texts; the Label Studio and doccano rows are read from their source code, not measured. Source details
How to cite
Cite as:
Bayanat Labs (2026). Arabic NER Offset Validator (arabic-ner-validator), version 0.1.0. Bayanat Labs. https://github.com/Bayanat-Labs/arabic-ner-validator
No DOI. Cite the URL in the citation above and the date you read it.
@misc{bayanatlabs2026arabicnervalidator,
author = {{Bayanat Labs}},
title = {Arabic NER Offset Validator (arabic-ner-validator), version 0.1.0},
year = {2026},
month = oct,
howpublished = {\url{https://github.com/Bayanat-Labs/arabic-ner-validator}}
}
Changelog
| Date | Version | Change |
|---|---|---|
| v0.1.0 | Python library, command-line tool, test cases and offset-convention matrix on GitHub; web app in English and Arabic on Hugging Face Spaces; test cases as a Hugging Face dataset. |
Corrections and removal requests
If something in this release should not be there, or is wrong, email hello@bayanatlabs.com. We handle removal requests within 30 days, and platform requests within 24 hours. How removal requests work
Related product: Bayanat Documents