Downloads · 30 days
58
60% of all-time downloads
oddadmix/Nawah-Router-BERT-6M-bilingual-pretrained
Nawah-Router-BERT-6M-bilingual-pretrained is a zero-shot classification model from oddadmix. Use it when you need labels you did not train the model on. It is set up for transformers. The card lists the license as apache-2.0.
Same task as Nawah-Router-BERT-6M-bilingual — give it a text and any categories in English or Arabic, it scores all of them in one forward pass — but the backbone underneath is Nawah-BERT-6M-bilingual, pretrained
Downloads · 30 days
58
60% of all-time downloads
All-time downloads
96
Public
Parameters
6M
47.8 MB on disk
Likes
0
Public
Click a slice to open those files.
.pt24 MB · 47%
From the Hugging Face model README
Same task as Nawah-Router-BERT-6M-bilingual
— give it a text and any categories in English or Arabic, it scores all of them in one forward
pass — but the backbone underneath is
Nawah-BERT-6M-bilingual, pretrained
from scratch on 5B Arabic + 5B English tokens with a tokenizer built for both languages, instead
of an Arabic-only-pretrained backbone with a bilingual router head bolted on top.
Three backbones, same router-head code, same two datasets, scored in one session:
| eval split | Arabic-only backbone,<br>English-only router | Arabic-only backbone,<br>bilingual router | this model |
|---|---|---|---|
| en_unseen_lanes | 0.210 (chance) | 0.859 | 0.925 |
| en_unseen_domain | 0.239 (chance) | 0.590 | 0.695 |
| en_unseen_axis | 0.252 (chance) | 0.547 | 0.659 |
| en_hard | 0.213 (chance) | 0.839 | 0.907 |
| ar_unseen_lanes | — | 0.929 | 0.931 |
| ar_unseen_domain | — | 0.694 | 0.691 |
| ar_unseen_axis | — | 0.605 | 0.570 |
| ar_hard | — | 0.903 | 0.910 |
Pretraining the backbone bilingually — not just fine-tuning the head bilingually — closes most
of the English gap. Every English split gains 6–11 points over the Arabic-only backbone. Arabic
holds flat on three of four splits, with one real cost: unseen_axis (tools/retrieval, held out
of training entirely) drops 0.605 → 0.570. That's consistent with the tokenizer trade-off behind
the new backbone — Arabic went from 1.20 to 1.37 tokens/word to make room for English — and with
the backbone splitting fixed capacity across two languages rather than devoting all of it to one.
Row 1 is still the headline finding underneath all of this: an Arabic-only-pretrained backbone with an English-only router head learns nothing at all (flat loss, chance accuracy). Both fixes here — a bilingual router head, or a bilingual-pretrained backbone — depend on Arabic data being present somewhere in the pipeline.
from transformers import AutoTokenizer
from routing_model_bilingual import RouterModel, route # ships in this repo
M = "oddadmix/Nawah-Router-BERT-6M-bilingual-pretrained"
tok = AutoTokenizer.from_pretrained(M)
model = RouterModel.from_pretrained(M)
route(model, tok, "The order is an hour late and the driver isn't answering",
["delivery enquiry", "delayed-order complaint", "payment issue"])
# lang="en"/"ar"/"auto" (default) - auto picks by script
Trained on oddadmix/prompt-routing-en (173,223 rows) + oddadmix/arabic-prompt-routing
(207,097 rows) mixed in one run, 3 epochs, train_router_head_multi.py defaults (LR 3e-4, batch
32). Each row wrapped in its own language's template before the shared span-pooling head scores
it — see that script's docstring.
© KAND CA 2026 — PROJECT NAWAH