Downloads · 30 days
14
38% of all-time downloads
nsa01n/qwen3-0.6b-ar-codeswitch
qwen3-0.6b-ar-codeswitch is a text generation model from nsa01n. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
A 0.6B text normalizer that repairs English technical terms mangled by Arabic speech-to-text. It is not an ASR model and not a chat model — it runs after transcription, as a cleanup pass.
Downloads · 30 days
14
38% of all-time downloads
All-time downloads
37
Public
Parameters
596M
1.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.2 GB · 99%
From the Hugging Face model README
A 0.6B text normalizer that repairs English technical terms mangled by Arabic speech-to-text. It is not an ASR model and not a chat model — it runs after transcription, as a cleanup pass.
in: الـ query رجع نتائج ناقصة، يمكن الصب نت حاصر بعض الاتصالات
out: الـ query رجع نتائج ناقصة، يمكن الـ subnet حاصر بعض الاتصالات
in: طلع لنا بريكنج تشينج بعد التحديث، ولازم نبلغ الفريق قبل الدمج
out: طلع لنا breaking change بعد التحديث، ولازم نبلغ الفريق قبل الدمج
Deliberately narrow — a 0.6B model does one job reliably.
Does: restore English terms that ASR transliterated into Arabic script or mis-spelled phonetically.
Does not: translate English into Arabic, convert Arabizi, add diacritics, restructure sentences, or correct Arabic spelling. Arabic text passes through untouched.
enable_thinking=False is required. Qwen3 renders an empty <think></think> block and
training used that form — a mismatch produces empty output.
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL = "nsa01/qwen3-0.6b-ar-codeswitch"
tok = AutoTokenizer.from_pretrained(MODEL)
model = AutoModelForCausalLM.from_pretrained(MODEL, dtype="auto")
SYSTEM = (
"You restore English technical terms in Arabic speech-to-text transcripts. "
"Fix only mangled English words. Leave all Arabic text, punctuation, and meaning "
"unchanged. Output only the corrected transcript."
)
def normalize(transcript):
msgs = [{"role": "system", "content": SYSTEM},
{"role": "user", "content": transcript}]
text = tok.apply_chat_template(
msgs, tokenize=False, add_generation_prompt=True, enable_thinking=False
)
inp = tok(text, return_tensors="pt").to(model.device)
out = model.generate(**inp, max_new_tokens=512, do_sample=False)
return tok.decode(out[0][inp.input_ids.shape[1]:], skip_special_tokens=True).strip()
Greedy decoding. Sampling adds nothing here and invites drift.
| Base | Qwen/Qwen3-0.6B (596M params, 28 layers) |
| Method | Full supervised fine-tune — not LoRA |
| Precision | bf16 |
| LR / schedule | 1e-5, cosine, 25 warmup steps |
| Epochs | 3 (846 steps, effective batch 32) |
| Max length | 1024 tokens |
| Loss | Completion-only — prompt tokens masked |
| Hardware | 1 x RTX 4090 (24 GB), ~45 min |
Held-out synthetic validation — 20 examples, 27 English terms.
| Metric | Result | Target |
|---|---|---|
| Term Restoration Rate | 88.89% (24/27) | >= 95% |
| Over-edit rate | 0.00% | < 2% |
| Identity pass rate | 100.00% (7/7) | >= 98% |
Over-edit rate and identity pass are the release-critical numbers and both are clean: the model does not alter text it is meant to leave untouched. Its failure mode is omission, not corruption.
Term restoration sits below target, but the sample is small — at 27 terms the 95% confidence interval spans roughly 71-97%, so the figure is not yet statistically distinguishable from the target. Of the three misses, one asked the model to restore a word absent from the input entirely and one had a corrupted source string; a single miss was a genuine vocabulary gap.
Not yet evaluated on real dictation.
Term Restoration Rate 88.89% target >= 95 (24/27)
Over-edit rate 0.00% target < 2 <-- RELEASE GATE
Identity pass rate 100.00% target >= 98 (7/7)
missing: accuracy
in : نحتاج نرفع ونحافظ على Precision قبل ما نعلن النتيجة.
want : نحتاج نرفع accuracy ونحافظ على precision قبل ما نعلن النتيجة.
got : نحتاج نرفع ونحافظ على precision قبل ما نعلن النتيجة.
missing: whisper
in : الوسبر التقط الكلام زين، لكن لخبط بالأسماء الأجنبية شوي.
want : الـ Whisper التقط الكلام زين، لكن لخبط بالأسماء الأجنبية شوي.
got : الـ voice التقط الكلام زين، لكن لخبط بالأسماء الأجنبية شوي.
missing: foreign
in : جانا اتصال (فورًا إن ومصدره مشبوه، اقفله مؤقت لين نفهم السالفة.
want : جانا اتصال foreign ومصدره مشبوه، اقفله مؤقت لين نفهم السالفة.
got : جانا اتصال forward، ومصدره مشبوه، اقفله مؤقت لين نفهم السالفة.
الوسبر clearly encodes Whisper; the model produced a
semantic near-guess. A vocabulary gap.forward is a
phonetically defensible reading of فورًا.RAID stay uppercase, commands such as
git and systemd stay lowercase.Apache 2.0, inherited from Qwen3-0.6B.