Views
No views yet
arabnamer Python library.
It predicts the Arabic transliteration of a lowercase English name token via per-character
multiclass classification (335 Arabic label tokens).pip install arabnamer1from arabnamer import translit
2r = translit("Mohammed Ali")
3print(r.arabic) # 'محمد علي'| Framework | XGBoost 2.0+ (saved in UBJ binary format, gzipped) |
| Boosting rounds (trees × 335 classes) | 386 × 335 = 129,310 trees |
| Max depth | 12 |
| Output classes | 335 (Arabic label tokens + empty string for silent-char) |
| Input features | 34 per character: padded char IDs, position, phonetic class, bigram/trigram IDs |
| File size | 160 MB uncompressed .ubj, 38 MB gzipped .ubj.gz |
| Inference speed | ~0.5 ms per 8-char token on CPU |
training/train_xgboost.pyfind_min_k.py to search for the smallest k whose per-name scores exactly match the baseline → result: 386 roundstree_method="hist"); use n_jobs=1 for bit-perfect reproducibility| Metric | Value |
|---|---|
| Average lenient similarity | 98.4 |
| Pass rate ≥ 70 | 25 / 25 |
| Pass rate ≥ 90 | 24 / 25 |
| Exact match (= 100) | 21 / 25 |
max(fuzz.ratio, fuzz.partial_ratio)).1@software{yousef_arabnamer_2026,
2 author = {Yousef, Elsayed},
3 title = {arabnamer: Arabic name transliteration and similarity},
4 year = {2026},
5 version = {0.1.0},
6 url = {https://github.com/sayedyousef/arabnamer},
7}