Downloads · 30 days
0
Abdullah-afify/egy-names-fallback-classifier
egy-names-fallback-classifier is a text classification model from Abdullah-afify. Use it when you need a label for a piece of text. It is set up for scikit-learn. The card lists the license as mit.
A precision-calibrated fallback model for Egyptian names that are not in the egy-names catalog.
Downloads · 30 days
0
Access
Public
Updated Aug 30, 2026
Repo size
1.9 MB
Likes
0
Public
Click a slice to open those files.
.gz1.9 MB · 100%
From the Hugging Face model README
A precision-calibrated fallback model for Egyptian names that are not in the egy-names catalog.
egy-names is a book-first engine: 44,626 hand-annotated Egyptian name lemmas with empirical gender, religion, generational-slot, and role labels, derived from 15.88M+ real name records (dataset). The book is always tried first and is always the ground truth.
This model exists only for the names the book has never seen — foreign surnames, rare spellings, brand-new coinages. It infers gender, religion, and role from morphology and character n-grams, and every prediction it returns is explicitly labeled inferred: true so a caller can never confuse a guess with an attested fact.
Most name-classification models are tuned to maximize aggregate accuracy. This one is tuned to maximize precision at the moment it chooses to speak, and to abstain (unknown / neutral) rather than guess when it isn't confident enough. That distinction matters for names, where a confidently wrong gender or religion label is worse than no label at all.
Abstention thresholds were not picked by feel — they were measured directly with a held-out precision-at-threshold calibration script and recalibrated after an initial pass under-delivered on its own promise (role="given" was returning only 81.8% precision, religion="christian" only 89.4%, at the original cutoffs):
| Class | Abstention threshold | Measured precision at that threshold |
|---|---|---|
| gender = male | p ≥ 0.70 | 93.3% |
| gender = female | p ≥ 0.70 | 95.5% |
| religion = muslim | p ≥ 0.85 | 96.6% |
| religion = christian | p ≥ 0.90 | 95.1% |
| role = given | p ≥ 0.88 | 93.0% |
عبد-prefixed compounds → male/Muslim with very high confidence) run before the statistical model and short-circuit it when they fire — the same rule table the book-index detectors use, shared via logic_config.json.unknown (religion/role) or neutral (gender) rather than force a label.infer_model.json.gz — the exported model weights (TF-IDF vocabulary/IDF, logistic regression coefficients for all three heads) in a small, dependency-free JSON format, runnable from any language without needing scikit-learn at inference time.Fallback-only inference for names absent from the egy-names catalog, inside the egy-names Python SDK's identify()/identify_all() API. Not intended as a standalone general-purpose name classifier outside that context — it was trained and calibrated specifically against Egyptian-Arabic naming patterns.
Abdullah-afify/egyptian-names — the same 44,626-lemma canonical catalog that powers the egy-names library, filtered to exclude non-personal and low-confidence/fabricated rows before training.
MIT — free for academic, commercial, and research use.
@misc{afify2026egynames_fallback,
author = {Abdullah Afify},
title = {egy-names ML Fallback Classifier},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/Abdullah-afify/egy-names-fallback-classifier}}
}