--- license: apache-2.0 base_model: - Qwen/Qwen3.5-4B library_name: mlx pipeline_tag: text-generation language: - en - zh - ja - hi - ar tags: - mlx - transliteration - pinyin - romaji - hinglish - arabizi - ime - qwen3.5 - v2.1 --- # UnimeType Transliteration 2.0 4B — v2.1 (Long-Sentence Upgrade · MLX 6-bit) > **Current Release**: **`v2.1` (`2.0-v4` Multi-Clause Long-Sentence Upgrade)** · **Protocol**: `unimetype-convert-short-v3` (100% drop-in compatible with all `Transliteration-2.0` clients) **UnimeType Transliteration 2.0 4B (`v2.1`)** is a specialized multilingual input-method transliteration model built on [`Qwen/Qwen3.5-4B`](https://huggingface.co/Qwen/Qwen3.5-4B). It converts **Chinese Pinyin**, **Japanese Romaji**, **Romanized Hindi / Hinglish**, and **Arabic Arabizi** into their native scripts across both **short phrases** and **multi-clause long sentences (60–240+ chars)** while preserving English technical terms, `@handles`, URLs, code spans, JSON literals, numbers, line breaks, and emoji in place. - **[🚀 Launch Interactive Playground Space →](https://huggingface.co/spaces/UnimeType/Transliteration-Playground)** (Test 25 verified multi-clause & edge presets or run live WebAssembly inference in your browser) - **[⌨️ Download the UnimeType Keyboard App →](https://unimetype.com/download?utm_source=huggingface&utm_medium=referral&utm_campaign=transliteration_2_1)** (Type in-place across macOS, Windows, Linux, iOS, Android & ChromeOS — no copy-paste or manual JSON wrapping needed) - **[📖 Technical Report & LM Studio Setup Guide →](https://unimetype.com/blog/how-we-evaluate-transliteration-models?utm_source=huggingface&utm_medium=referral&utm_campaign=transliteration_2_1)** --- ## Quickstart: `unimetype-convert-short-v3` JSON Protocol (LM Studio / `llama.cpp` / `mlx_lm`) > **Important for LM Studio / Ollama / GGUF Users**: This model is a deterministic **IME transliteration engine**, not a general chat bot. Pass a single-line compact JSON object as the `user` message (with **empty System Prompt** and **`temperature: 0.0`**), or use the **[UnimeType Keyboard App](https://unimetype.com/download?utm_source=huggingface&utm_medium=referral&utm_campaign=transliteration_2_1)** which formats requests and replaces text in-place automatically. | Language | `user` Message JSON (`content`) | Direct `assistant` Output | | --- | --- | --- | | **Chinese Pinyin (`zh`)** | `{"operation":"convert","input":"qing xian zai staging huanjing pao yi bian suoyou unit test, queren API latency meiyou shenggao zhi hou, women zai anpai production deploy","enabled_languages":["chinese","english"],"primary_language":"chinese"}` | `请先在 staging 环境跑一遍所有 unit test, 确认 API latency 没有升高之后, 我们再安排 production deploy` | | **Japanese Romaji (`ja`)** | `{"operation":"convert","input":"staging kankyou de atarashii API endpoint no dousa wo kakunin shite kara, mondai ga nakereba ban-gohan no ato ni production deploy shimasu","enabled_languages":["english","japanese"],"primary_language":"japanese","japanese_output_style":"natural"}` | `staging 環境で新しい API endpoint の動作を確認してから, 問題がなければ晩ご飯の後に production deploy します` | | **Hindi Hinglish (`hi`)** | `{"operation":"convert","input":"maine GitHub par naya PR open kar diya hai, aap ek baar code review kar lijiye, phir hum shaam ko staging server par deploy karenge","enabled_languages":["english","hindi"],"primary_language":"hindi"}` | `मैंने GitHub पर नया PR open कर दिया है, आप एक बार code review कर लीजिए, फिर हम शाम को staging server पर deploy करेंगे` | | **Arabic Arabizi (`ar`)** | `{"operation":"convert","input":"ana 7a2a3od fel office l7ad el sa3a 8 3ashan a5allas el deployment, law 3andak ay update eb3atli 3ala Slack aw WhatsApp","enabled_languages":["arabic","english"],"primary_language":"arabic"}` | `أنا هقعد في ال office لحد الساعة 8 عشان أخلص ال deployment, لو عندك أي update ابعتلي على Slack أو WhatsApp` | ```bash curl http://127.0.0.1:1234/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "UnimeType/Transliteration-2.0-4B", "temperature": 0, "max_tokens": 256, "messages": [ { "role": "user", "content": "{\"operation\":\"convert\",\"input\":\"mingtian 3pm he @alex review auth-service de PR #412, ranhou deploy dao staging\",\"enabled_languages\":[\"chinese\",\"english\"],\"primary_language\":\"chinese\"}" } ] }' ``` --- ## What's New in `v2.1` (Long-Sentence Upgrade) 1. **Multi-Clause Long-Sentence Mastery (`v2.0` → `v2.1`)**: Trained on a balanced curriculum where **67.2%** of training inputs are multi-clause sentences (`60–240` chars, `2–5` clauses, `max_seq_len=1024`) covering spaced, phrase-grouped, and unspaced romanization, bilingual technical code-switching, protected placeholders, multiline layouts, and `Another` (`reconvert`) cycling: - **`0.8B` (`v2.0` → `v2.1`)**: Multi-clause strict pass up **13×** (`0.6% → 8.1%`), long-sentence character accuracy `69.2% → 76.5%` (`ja` `+11.9%`, `ar` `+9.2%`), and standard 414-case benchmark up from `66.4%` (`275/414`) to **`72.7%` (`301/414`)**, surpassing `DeepSeek V4.1 Flash` (`70.5%`). - **`4B` (`v2.0` → `v2.1`)**: Multi-clause strict pass up from `20.0%` (`32/160`) to **`28.8%` (`46/160`, `29.4%` normalized)**, long-sentence character accuracy **`90.4% → 93.21%`** (all 4 languages `>90.9%`), contract violations cut by `-76.9%` (`13 → 3`), and standard 414-case benchmark up from `87.4%` (`362/414`) to **`88.4%` (`366/414`)** (`ja` `61.5% → 76.9%`). 2. **Unconditional Non-Thinking Generation Template**: Ships with an unconditional non-thinking `chat_template.jinja` (`<|im_start|>assistant\n\n\n\n\n`) across all formats (`MLX 6-bit`, `BF16 Safetensors`, and `GGUF`), preventing `Thinking Process:` token waste or truncation in LM Studio, `mlx-lm`, and `llama.cpp`. --- ## Evaluation Benchmarks (`v2.0` vs `v2.1`) ### 1. Multi-Clause Long-Sentence Benchmark (160 cases · 2–5 clauses, 60–240 chars) | Language / Metric | v2.0 (`0.8B` before) | **v2.1 (`0.8B` now)** | v2.0 (`4B` before) | **v2.1 (`4B` now)** | | --- | ---: | ---: | ---: | ---: | | **Overall Strict Pass (160 cases)** | 1 / 160 (0.6%) | **12 / 160 (7.5%)** | 32 / 160 (20.0%) | **46 / 160 (28.7%)** | | **Overall Normalized Pass (160 cases)** | 1 / 160 (0.6%) | **12 / 160 (7.5%)** | 33 / 160 (20.6%) | **47 / 160 (29.4%)** | | **Mean Character Accuracy (160 cases)** | 69.2% | **76.49%** | 90.4% | **93.21%** | | **Chinese Pinyin (`zh`, 40 cases)** | 0 / 40 (0.0% · 61.7% char) | **1 / 40 (2.5%) · 66.7% char** | 6 / 40 (15.0% · 92.6% char) | **9 / 40 (22.5%) · 92.6% char** | | **Japanese Romaji (`ja`, 40 cases)** | 0 / 40 (0.0% · 51.7% char) | **0 / 40 (0.0%) · 63.7% char** | 6 / 40 (15.0% · 86.0% char) | **9 / 40 (22.5%) · 91.0% char** | | **Hindi Hinglish (`hi`, 40 cases)** | 1 / 40 (2.5% · 91.9% char) | **11 / 40 (27.5%) · 94.8% char** | 20 / 40 (50.0% · 96.7% char) | **25 / 40 (62.5%) · 98.1% char** | | **Arabic Arabizi (`ar`, 40 cases)** | 0 / 40 (0.0% · 71.6% char) | **0 / 40 (0.0%) · 80.8% char** | 0 / 40 (0.0% · 86.4% char) | **3 / 40 (7.5%) · 91.2% char** | ### 2. Standard 414-Case Short-Sentence & Edge-Case Benchmark | Slice / Metric | v1.0 (`Transliteration-4B`) | DeepSeek V4.1 Flash | **v2.1 (`Transliteration-2.0-0.8B`)** | **v2.1 (`Transliteration-2.0-4B`)** | | --- | ---: | ---: | ---: | ---: | | **Overall Strict Pass (414 cases)** | 230 / 414 (55.6%) | 292 / 414 (70.5%) | **301 / 414 (72.7%)** | **366 / 414 (88.4%)** | | **Overall Expanded Pass (414 cases)** | 242 / 414 (58.5%) | 297 / 414 (71.7%) | **301 / 414 (72.7%)** | **366 / 414 (88.4%)** | | **Chinese Pinyin (`zh`)** | 151 / 207 (72.9%) | 171 / 207 (82.6%) | **168 / 207 (81.2%)** | **195 / 207 (94.2%)** | | **Japanese Romaji (`ja`)** | 15 / 52 (28.8%) | 37 / 52 (71.2%) | **22 / 52 (42.3%)** | **40 / 52 (76.9%)** | | **Hindi / Hinglish (`hi`)** | 41 / 71 (57.7%) | 49 / 71 (69.0%) | **51 / 71 (71.8%)** | **61 / 71 (85.9%)** | | **Arabic Arabizi (`ar`)** | 23 / 84 (27.4%) | 35 / 84 (41.7%) | **60 / 84 (71.4%)** | **70 / 84 (83.3%)** | --- ## Version History & Reproducible Revisions This repository tracks the latest `2.x` release on `main` while preserving immutable Git tags for every milestone: - **`v2.1` (default / `main`)**: Multi-clause long-sentence upgrade (`2.0-v4`, `max_seq_len=1024`). ```bash huggingface-cli download UnimeType/Transliteration-2.0-4B --revision v2.1 ``` - **`v2.0`**: Initial short-protocol release (`2.0-v3`, `max_seq_len=640`). ```bash huggingface-cli download UnimeType/Transliteration-2.0-4B --revision v2.0 ```