Spaces:
Sleeping
Sleeping
File size: 4,094 Bytes
0cb5ef9 b48e580 532cbb3 0cb5ef9 1366473 0aaaec8 1366473 0aaaec8 1366473 0aaaec8 1366473 0aaaec8 1366473 0aaaec8 0cb5ef9 0aaaec8 b48e580 0aaaec8 532cbb3 0aaaec8 b48e580 0aaaec8 1366473 0aaaec8 1366473 0aaaec8 532cbb3 1366473 b48e580 0aaaec8 532cbb3 b48e580 1366473 0aaaec8 1366473 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | ---
title: Nawah Router
emoji: 🧭
colorFrom: green
colorTo: blue
sdk: docker
app_port: 7860
pinned: false
models:
- oddadmix/Nawah-Router-BERT-6M-v2
- oddadmix/Nawah-Router-v3
- oddadmix/Nawah-Router-BERT-6M-bilingual-pretrained
- oddadmix/Nawah-BERT-6M-v2
- oddadmix/Nawah-BERT-6M-bilingual
datasets:
- oddadmix/arabic-prompt-routing
- oddadmix/prompt-routing-en
tags:
- arabic
- english
- zero-shot-classification
- prompt-routing
short_description: توجيه عربي وإنجليزي صفري للفئات الحرة
---
# Nawah-Router — Arabic + English zero-shot prompt routing
Write a text and **any categories, in plain Arabic or English**; the model scores all of them in
a single forward pass. Categories are free text typed at runtime — the model has no fixed
taxonomy, so this is zero-shot classification over a label set it has never seen. Language is
detected automatically from the text.
Edit any category inline, add or remove lanes, and the routing updates as you type.
Counterpart to [LFM2.5-Encoder-350M-Prompt-Router](https://huggingface.co/LiquidAI/LFM2.5-Encoder-350-Prompt-Router).
## Three backbones, one head — switch from the picker
| | [`Nawah-Router-BERT-6M-v2`](https://huggingface.co/oddadmix/Nawah-Router-BERT-6M-v2) | [`Nawah-Router-v3`](https://huggingface.co/oddadmix/Nawah-Router-v3) | [`Nawah-Router-BERT-6M-bilingual-pretrained`](https://huggingface.co/oddadmix/Nawah-Router-BERT-6M-bilingual-pretrained) |
|---|---:|---:|---:|
| parameters | **5,977,985** | 52,049,409 | 5,977,985 |
| backbone | BERT encoder | Llama decoder | BERT encoder |
| languages | Arabic only | Arabic only | **Arabic + English** |
| base model | [`Nawah-BERT-6M-v2`](https://huggingface.co/oddadmix/Nawah-BERT-6M-v2) | `50M-2048-Emhotob` | [`Nawah-BERT-6M-bilingual`](https://huggingface.co/oddadmix/Nawah-BERT-6M-bilingual) |
The two Arabic-only backbones, scored in one session by the same `eval_router_only.py`
(Router-v3 reproduced its published card exactly):
| eval set | **6M encoder** | 52M decoder | random |
|---|---:|---:|---:|
| unseen category sets | **0.9327** | 0.9308 | 0.2137 |
| unseen domains | **0.7009** | 0.6975 | 0.2521 |
| deliberately adjacent categories | **0.9101** | 0.9017 | 0.2109 |
| unseen axes (dimensions absent from training) | 0.6000 | **0.6127** | 0.2358 |
The 6M wins three of four at **1/8.7 the size**. It loses on unseen axes — the column the 52M's
card calls its strongest claim — and three of the four margins are under one point, which is
inside what a single run can tell you.
The bilingual 6M — same architecture, pretrained from scratch on 5B Arabic + 5B English tokens
with a shared 32K tokenizer, then given a router head trained on both languages together — closes
most of the English gap an Arabic-only backbone has on this task, at a small Arabic cost on the
hardest split:
| eval set | **bilingual 6M — English** | **bilingual 6M — Arabic** | Arabic-only 6M (Arabic) |
|---|---:|---:|---:|
| unseen category sets | 0.9246 | 0.9305 | 0.9327 |
| unseen domains | 0.6946 | 0.6911 | 0.7009 |
| unseen axes | 0.6594 | 0.5697 | 0.6000 |
| deliberately adjacent categories | 0.9066 | 0.9101 | 0.9101 |
Full 3-way comparison, including the finding that an English-only router head on the Arabic-only
backbone learns nothing at all, in the [model card](https://huggingface.co/oddadmix/Nawah-Router-BERT-6M-bilingual-pretrained).
Confidence is not calibrated: clear cases saturate near 100%. Use the ranking, not the number.
Data: [`oddadmix/arabic-prompt-routing`](https://huggingface.co/datasets/oddadmix/arabic-prompt-routing)
(207,097 training rows, 58,008 distinct category sets, 12 routing axes) and its English
counterpart [`oddadmix/prompt-routing-en`](https://huggingface.co/datasets/oddadmix/prompt-routing-en)
(173,223 training rows) — both natively generated per language, not translations of each other,
with the full generation and verification pipeline.
CPU-only, one forward pass regardless of how many categories you give it.
© KAND CA 2026 — PROJECT NAWAH
|