--- language: - fa - en license: gpl-3.0 library_name: tinyasr pipeline_tag: automatic-speech-recognition tags: [persian, farsi, asr, zipformer, transducer, shenava, on-device] base_model_relation: finetune --- # Shenava Rizeh v1.6 **Small, fast, offline Persian speech recognition, now much better at poetry.** A 60M-parameter Zipformer2 transducer with 4-bit weights (34 MB). It runs on CPU through the [tinyasr](https://github.com/dkaraush/tinyasr) engine on Android, iOS, desktop and in the browser (WASM). v1.6 = 0.5 × [v1.5](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.5) + 0.5 × a fine-tune of v1.5 on 641 h: - 250 h of Ganjoor poetry recitation with checked text; - 93 h of spoken poetry commentary (sharh) and announcements, transcribed by Gemini 4 Hydrogen and cross-checked against Rizeh; - v1.5's 149 h of everyday speech, replayed. ## Results The [PersianASR Triple Threat](https://huggingface.co/spaces/Reza2kn/PersianASR-TrippleThreat) benchmark covers all 11,010 clips: VisualEars-Golden-6669 (in-the-wild) plus FLEURS-fa-4341. TT = 0.6·S³ + 0.2·WER + 0.2·CER, lower is better. | Model | Uniform TT | Official TT | FLEURS / golden (uniform) | Poetry WER (2 h held-out Ganjoor, no LM) | |---|---:|---:|---|---:| | v1.5 + Persian LM | 3.201 | 3.790 | 3.47 / 2.93 | 18.8% | | **v1.6 + Persian LM** | **3.119** | **3.740** | **3.47 / 2.77** | **13.7%** | | v1.5, no LM | 3.692 | 4.397 | | | | **v1.6, no LM** | **3.623** | | | | - **Board position:** with the LM, v1.6 is #4 on the uniform board, ahead of ElevenLabs Scribe v2 (3.141). Only Gemini 4 Argon, Gemini 4 Hydrogen and Gemini 3.5 Flash are ahead. - **Benchmark leakage:** training text sharing any 6-word sequence with a benchmark sentence was removed. - **Poetry:** the 2 h held-out Ganjoor test comes from a shard that wasn't used in training, though the same reciter may still appear in training shards. The fine-tune on its own reaches 10.4% poetry WER but gives up some FLEURS; the average keeps both. ## Files | File | What it is | |---|---| | `shenava-rizeh-v1.6.tzf` | the model, tinyasr TZF3 format (int4/int8) | | `silero_vad.onnx` | Silero VAD v5, required by tinyasr | | `lm/shenava-fa-wiki-4gram.bin` | KenLM 4-gram (benchmark sentences removed), optional | | `engine/` | tinyasr patch adding in-beam KenLM fusion and hotwords, plus a KenLM shim and a CLI (`tbench_fz`) | | `training/` | TZF ⇄ PyTorch converter, fbank port, tokenizer, QAT fine-tuning and averaging scripts. `training/v1.6/` holds the Ganjoor audit, the Hydrogen labeling, data assembly and the full-benchmark scoring script. | ## Usage **Plain tinyasr** (no LM): a drop-in replacement for `en-fa.tzf`. Persian is language code `fa`. **With the LM:** apply `engine/tinyasr-lm-fusion-hotwords.patch`, build `engine/tbench_fz`, then run: ``` tbench_fz shenava-rizeh-v1.6.tzf silero_vad.onnx list.tsv out.tsv 16 lm/shenava-fa-wiki-4gram.bin 0.2 1.5 - 0 ``` ## On-device LMs (small) The full LM (`lm/shenava-fa-wiki-4gram.bin`, 989 MB) is meant for desktops and servers. For phones, use one of these compact KenLM tries. They're built from the same corpus plus Persian poetry (the Ganjoor couplet corpus and poet biographies), with the vocabulary capped at 120k/200k words, heavy pruning and 4-bit packing. They use the same engine flags; only the file changes (α 0.2, β 1.5, beam 16). | LM | Size | Uniform TT (full benchmark) | Poetry WER (held-out Ganjoor) | |---|---|---:|---:| | none | 0 | 3.623 | 13.7% | | `lm/shenava-fa-lit-3gram-43mb.bin` | 43 MB | 3.240 | 11.9% | | `lm/shenava-fa-lit-3gram-66mb.bin` | 66 MB | 3.220 | 11.7% | | `lm/shenava-fa-wiki-4gram.bin` | 989 MB | 3.119 | 10.6% | The 43 MB LM keeps about 75% of the full LM's benchmark gain. Any benchmark sentence, any held-out test sentence, and any line sharing a 6-word sequence with one was removed from the LM text. ## Training - Same recipe as v1.5: - quantization-aware training on the exact TZF int4/int8 groups; - RNN-T loss on the Persian vocabulary; - an encoder-distillation anchor to v1.5. - One epoch, AdamW lr 1e-5. - The model is then averaged 50/50 with v1.5 and re-quantized. - **Ganjoor data:** Rizeh v1.5 first audited all 1,043 h of Ganjoor recitations. Training used only the chunks whose canonical text matches the audio (CER ≤ 20%). - **Commentary labels:** these chunks had wrong labels. Gemini 4 Hydrogen relabeled all 114 h, and chunks where Hydrogen and Rizeh disagree by more than 40% CER were dropped. ## All formats - [Shenava-Rizeh-v1.6](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6): int4 `.tzf` for the tinyasr engine (CPU/WASM), KenLM, engine patch, training code - [Shenava-Rizeh-v1.6-sherpa-onnx](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6-sherpa-onnx): offline + streaming, fp32 / int8 / int4 - [Shenava-Rizeh-v1.6-ONNX-fp16](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6-ONNX-fp16) - [Shenava-Rizeh-v1.6-tract-streaming](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6-tract-streaming): pure Rust - [Shenava-Rizeh-v1.6-CoreML-fp16](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6-CoreML-fp16) and [Shenava-Rizeh-v1.6-CoreML-iOS15-fp16](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6-CoreML-iOS15-fp16) (streaming) - [Shenava-Rizeh-v1.6-Diarization](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6-Diarization): who spoke when, 3.5M parameters on top of this encoder ## License and credits GPL-3.0-or-later, like the tinyasr engine and models it derives from. Base model and engine: [dkaraush/tinyasr](https://github.com/dkaraush/tinyasr). The original models were trained primarily on [YODAS v3](https://huggingface.co/datasets/espnet/yodas3) (CC BY 3.0). Architecture: Zipformer2 from [k2-fsa/icefall](https://github.com/k2-fsa/icefall) (Apache-2.0). Poetry audio: Ganjoor recitations. Voice activity detection: [Silero VAD](https://github.com/snakers4/silero-vad) (MIT).