/ Модель

Характеристики

Контекст
40 960 токенов
Параметры
508 млн
Размер весов
1,2 ГБ
Лицензия
Apache 2.0
Архитектура
qwen3 · dense
Базовая модель
Qwen3-0.6B
Библиотека
transformers
Опубликована
27 ноя 2026

qwen3-0.6b-roman-urdu-to-urdu

Генерация текстаТекст → текст3 профессии
381скачиваний за 30 дней0лайковвеса обновлены27 ноя 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Компактная модель преобразует короткие фразы на романизированном урду в письмо урду и подходит для локальной обработки сообщений.

Qwen3-0.6B Roman Urdu → Urdu script — компактная дообученная модель семейства Qwen3, созданная для преобразования романизированного урду в письмо урду. Она принимает короткие фразы, набранные латиницей, и восстанавливает написание и пунктуацию на урду; предназначена, в частности, для локального преобразования сообщений и предложений на устройстве. В основе — плотная причинная языковая модель Qwen3ForCausalLM примерно на 508 млн параметров.

В репозитории есть слитая с базовыми весами LoRA-версия, отдельный адаптер и 4-битная сборка MLX; модель работает с Transformers и может запускаться через Ollama или MLX. Для базовой модели указано окно контекста 40 960 токенов, однако автор проверял целевые входы длиной до примерно 30 слов. На тестах авторов символная ошибка составила 10,6% на 60 бытовых предложениях и 11,3% на 300 предложениях из Википедии; точное совпадение целого предложения было соответственно 18,3% и 9,7%. Модель лучше справляется с обычными словами на урду, чем с английскими заимствованиями, которые могут искажаться. Лицензия — Apache-2.0.

Сценарии применения

  • Перевод коротких сообщений из латинской записи урду в письмо урду
  • Преобразование фраз из чатов в стандартную письменность урду
  • Подготовка коротких предложений на урду для форм и документов
  • Локальная транслитерация бытовых предложений на устройстве

Ограничения

Английские заимствования часто преобразуются с ошибками; оценка на бытовых фразах основана всего на 60 предложениях. Модель настроена на отдельные предложения примерно до 30 слов, а длинные тексты не проверялись.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Qwen3-0.6B Roman Urdu → Urdu script

A 0.6B model that turns Roman Urdu, the way people type it on WhatsApp, into proper Urdu script. It runs offline on a laptop: 643 MB in Ollama, about 0.3 s per sentence on a MacBook Air M2.

Roman Urdu (input)Urdu script (this model)
golgappay khane chalein?گولگپے کھانے چلیں؟
aap ka naam kya haiآپ کا نام کیا ہے؟
ye kaam kaun karay ga?یہ کام کون کرے گا؟

Built for the Qwen Local Hackathon 2026 (Qwen Pakistan).

Why

Most Pakistanis type Urdu in Latin letters, because that's what phone keyboards make easy. But forms, documents, signage and printed material need real Urdu script, and typing it is slow for most people. Rule-based converters struggle because Roman Urdu has no fixed spelling: hai, he and hy are all the same word. A small model can learn those patterns from examples. It can also run locally, so private messages never leave the device.

The base Qwen3-0.6B can't do this task at all. It echoes the Roman text back unchanged (see results).

Files in this repo

PathWhat it is
model.safetensors and config files (repo root)Merged full-precision model: LoRA fused into Qwen3-0.6B. Use with Transformers, or import into Ollama.
mlx-4bit/4-bit MLX version (331 MB) for Apple Silicon.
adapter/The LoRA adapter on its own (MLX format).
ModelfileOllama import file (int4).
demo.pyCommand-line demo that calls Ollama. Python standard library only.
scripts/Data preparation and evaluation scripts.
results/Every model output on both test sets, plus training logs.

Run it locally

Ollama (tested with Ollama 0.40.16 on macOS, Apple M2)

hf download narjisb99/qwen3-0.6b-roman-urdu-to-urdu --exclude "mlx-4bit/*" --exclude "adapter/*" --local-dir roman-urdu-to-urdu
cd roman-urdu-to-urdu
ollama create roman-urdu-to-urdu -q int4 -f Modelfile
python3 demo.py "aap ka naam kya hai"
python3 demo.py            # interactive mode

The int4 model is 643 MB and used about 660 MB of memory while loaded (from ollama ps). Context is 4096 tokens, though inputs are single sentences.

System prompt (baked into the Modelfile):

Convert the Roman Urdu text into Urdu script. Return only the Urdu text, with no explanation.

Qwen3 starts every answer with an empty <think></think> block, even with thinking turned off. demo.py removes it. Through the API, send "think": false and strip the tags yourself.

MLX (Apple Silicon)

pip install mlx-lm
hf download narjisb99/qwen3-0.6b-roman-urdu-to-urdu --include "mlx-4bit/*" --local-dir rutu
mlx_lm.generate --model rutu/mlx-4bit --temp 0 \
  --system-prompt "Convert the Roman Urdu text into Urdu script. Return only the Urdu text, with no explanation." \
  --prompt "golgappay khane chalein?"

The chat template in mlx-4bit/ already turns thinking off.

Results

All numbers come from held-out sentences the model never saw in training, decoded greedily (temperature 0).

  • Exact match: the whole sentence is character-perfect.
  • CER (character error rate): Levenshtein edit distance divided by reference length. Lower is better.

Both are measured after Unicode NFC normalisation and whitespace collapsing.

Everyday sentences (60 test sentences written by the team)

ModelExact matchCER
Qwen3-0.6B base (4-bit MLX)0%107.7%
v1: trained on Wikipedia only3.3%17.8%
v2: Wikipedia + everyday (this model), 4-bit MLX + adapter18.3%10.6%
v2 merged, then 4-bit MLX (mlx-4bit/)18.3%11.0%
v2 merged, then int4 in Ollama21.7%11.0%

Wikipedia sentences (300 test sentences from Dakshina)

ModelExact matchCERSeconds per sentence (M2)
Qwen3-0.6B base0%100.2%0.39
v110.7%10.2%1.13
v2 (this model)9.7%11.3%0.54

Exact match looks low because one wrong letter fails the whole sentence. About 89% of characters are right. For scale: the Dakshina paper reports that human annotators disagreed with each other on roughly 3.5–8.5% of characters. The Wikipedia set was not re-run on the Ollama int4 build. On the everyday set, int4 cost about half a CER point.

Same prompt, base and fine-tuned (everyday test set)

InputReferenceBasev1v2
ye kaam kaun karay ga?یہ کام کون کرے گا؟ye kaam kaun karay ga?یہ کام کارے گا؟یہ کام کون کرے گا؟ ✅
golgappay khane chalein?گول گپے کھانے چلیں؟golgappay khane chalein?گلوگپائے خانے چلیں؟گولگپے کھانے چلیں؟ (missing space only)
office ki bus subah saat baje aati haiآفس کی بس صبح سات بجے آتی ہے۔(echoed back)آفیس کی بس سب سب سات سات بجے ایتی ہےایجو کی بس صبح سات بجے آتی ہے۔

Where it still fails

English loanwords are the main weakness. Dakshina is Wikipedia text and contains almost no casual English, so words like discount, walk and WhatsApp come out garbled:

InputReferencev2 output
thora sa discount kar dein bhaiتھوڑا سا ڈسکاؤنٹ کر دیں بھائی۔اٹھارا سا ڈسکٹ کر دیں بھائی۔
meeting ka link mujhe whatsapp kar doمیٹنگ کا لنک مجھے واٹس ایپ کر دو۔میٹنگ کا لائن مجھے ویٹم ایٹر کر دو۔
rozana thori der walk kiya karoروزانہ تھوڑی دیر واک کیا کرو۔روزنہ طوری ڈیر وکل کیا کرو۔

Other limits:

  • The everyday test set is only 60 sentences, so differences of a few points (for example, int4 scoring 21.7% vs 18.3%) are within noise.
  • It's tuned for single sentences of up to about 30 words. Long paragraphs are untested.
  • Quantization cost a little: kaun came out as کاون in the Ollama int4 build, though it was correct before quantizing.

Dataset

1. Dakshina, Urdu subset (Google Research, CC BY-SA 4.0). These are Urdu Wikipedia sentences that native speakers romanised by hand. We used the copy at Anvesh-Lankala/Copy_Dakshina_Google_research_dataset, file data/ur-00000-of-00001.parquet.

  • Filtered to sentences of 30 words or fewer.
  • Removed empty rows and deduplicated on both the Roman and the Urdu side.
  • Shuffled with seed 42 and split into 7,892 train / 200 validation / 300 test.
  • See scripts/prepare_data.py.

2. Everyday sentences (182, written by the two of us for this project). These are short texting-style sentences across 10 categories: greetings, family, office, shopping, travel, food, health, questions, English loanwords, and places and events.

  • We wrote them ourselves. We did not copy them from websites or chats, and they contain no personal details.
  • We reviewed every row by hand. 4 rows were corrected because the Urdu column had been translated or reordered instead of transliterated (see the FIXES list in scripts/prepare_everyday.py).
  • Shuffled with seed 42 and split into 60 test / 122 train. No sentence appears in both.
  • The 122 training sentences were repeated 5 times, so they carry weight next to 7,892 Wikipedia rows. Final training set: 8,502 rows.

Every row uses the same system prompt and chat format: system prompt, then the Roman Urdu as the user turn, then the Urdu script as the assistant turn.

Training

SettingValue
Base modelQwen/Qwen3-0.6B
MethodLoRA on a 4-bit (MLX) base, i.e. QLoRA
Toolmlx-lm 0.32.2 (mlx 0.32.4), using the Apple Silicon path from the finetune-anywhere starter repo
HardwareMacBook Air, Apple M2, 16 GB unified memory
LoRA settingsrank 16, scale 2.0, dropout 0, last 16 layers
OptimiserAdam, learning rate 2e-4, batch size 4, max sequence length 256, seed 42
Steps3,000, with loss on the assistant turn only (--mask-prompt)
Training data seenabout 539k tokens
Compute timeabout 55 minutes, from the MLX step logs
Validation loss2.713 → 0.293

Commands:

mlx_lm.convert --hf-path Qwen/Qwen3-0.6B --mlx-path outputs/base-4bit -q --q-bits 4

mlx_lm.lora --model outputs/base-4bit --train --data data/mixed --iters 3000 \
  --batch-size 4 --num-layers 16 --learning-rate 0.0002 --max-seq-length 256 \
  --mask-prompt --adapter-path outputs/adapters-v2 \
  --config lora.yaml --steps-per-report 100 --steps-per-eval 500 --save-every 500 --val-batches 25
# lora.yaml: lora_parameters {rank: 16, scale: 2.0, dropout: 0.0}, seed: 42

mlx_lm.fuse --model Qwen/Qwen3-0.6B --adapter-path outputs/adapters-v2 --save-path outputs/merged
# then set a non-thinking chat template (configure_chat.py in the starter repo)
mlx_lm.convert --hf-path outputs/merged --mlx-path outputs/mlx-4bit -q --q-bits 4
ollama create roman-urdu-to-urdu -q int4 -f Modelfile

python scripts/evaluate.py --model outputs/base-4bit --adapter outputs/adapters-v2 \
  --eval data/everyday_test.jsonl --out results/everyday-v2.json

What we learned

  • Test data matters most. v1 looked good on Wikipedia text (10.2% CER) but was weak on how people actually type (17.8%). Writing 182 sentences of our own fixed most of that gap. It cut everyday CER by about 40%, at the cost of about 1 CER point on Wikipedia.
  • Masking the prompt also helped. v2 trains only on the answer, and that made generation faster (0.54 s vs 1.13 s per sentence), mostly because v1 sometimes rambled with repeated words.
  • 4-bit is nearly free here. The quantized builds score within about half a CER point of the full model.
  • Still open: English loanwords need many more examples than our 122. That's the next thing to fix.

Team and credits

Built by two sisters for the Qwen Local Hackathon 2026. Syeda Narjis Batool (syeda-batool99) built the training and evaluation pipeline. The other sister wrote 150 of the 182 everyday sentences.

  • Base model: Qwen3-0.6B by the Qwen team, Apache 2.0.
  • Data: Dakshina dataset, Roark et al., Processing South Asian Languages Written in the Latin Script: the Dakshina Dataset, LREC 2020, CC BY-SA 4.0.
  • Tools: MLX / mlx-lm, Ollama, and the finetune-anywhere starter repo from Qwen Pakistan.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Нельзя запустить

MLX-модели работают только на Apple Silicon, на GPU NVIDIA они не запускаются.

Класс архитектуры
Qwen3ForCausalLM
Ревизия весов
be26340

0 моделей