DpirASR / README.md
Chillarmo's picture
Explain Armenian scoring differences and improvement ideas
f9425c5 verified
|
Raw History Blame Contribute Delete
5.77 kB
---
language:
- hy
license: apache-2.0
library_name: transformers
pipeline_tag: automatic-speech-recognition
base_model: Qwen/Qwen3-ASR-0.6B-hf
base_model_relation: finetune
tags:
- armenian
- eastern-armenian
- qwen3_asr
- safetensors
metrics:
- wer
- cer
---
# DpirASR
DpirASR is an Armenian speech-to-text model based on Qwen3-ASR-0.6B. It targets modern Eastern Armenian and was fine-tuned on real speech from podcast-style interviews, news, church recordings, and scripted television. This release contains the merged BF16 checkpoint for native Transformers inference. [Upstream Qwen3-ASR model](https://huggingface.co/Qwen/Qwen3-ASR-0.6B-hf)
## Evaluation
| Test set | Clips | Audio | Normalized WER | Normalized CER | Raw WER | Raw CER |
|---|---:|---:|---:|---:|---:|---:|
| Held-out Armenian web audio | 2,724 | 8.11 h | **23.56%** | **9.98%** | 31.54% | 11.70% |
| Armenian Common Voice 20 | 5,856 | 9.22 h | **27.35%** | **7.15%** | 39.69% | 9.24% |
WER and CER are corpus-level word and character error rates. Both scoring modes apply Unicode NFC and collapse whitespace. Normalized scoring keeps letters, digits, and whitespace and preserves case and spelling. CER includes spaces.
The web audio test split contains 28 held-out recordings and uses automatically generated references. Its scores measure agreement with those references. Both tests used BF16 greedy decoding with an initial 512-token cap and a retry at 2,048 tokens. The scores include all clips, including the five web audio clips and one Common Voice clip that reached the final cap. [Evaluation details and exact scores](eval-results.json)
### Colloquial speech and spelling
In an informal listening check on one clip of fast, reverberant Eastern Armenian speech, DpirASR preserved colloquial forms such as `ասում ա`, `չի կարա`, `ինքն ա`, and `իրա`. The same clip showed that spellings, word boundaries, and final consonants can still need review.
| Model output | Reference | Observed difference |
|---|---|---|
| `այրանը` | `արյանը` | Spelling followed the colloquial pronunciation. |
| `մեծը նարեց` | `մեծն արեց` | The model put the article consonant `ն` at the start of the next word. |
| `միացին` | `միածին` | The model substituted `ց` for `ծ`. |
| `Աստծու` | `Աստծուն` | The model omitted the final `ն` near the clip boundary. |
#### How these differences affect WER and CER
A transcript can sound close to the recording and still accumulate edits against a reference. The reported punctuation normalization preserves Armenian spelling and word boundaries. Scored in isolation, `մեծը նարեց` versus `մեծն արեց` counts as two word substitutions. Spelling differences such as `այրանը` versus `արյանը` also count in both WER and CER. A manual review of clips across the test sets would help measure how much each error type contributes to the aggregate scores.
#### Possible improvements
- Build a human-reviewed set of fast and colloquial speech with explicit conventions for spelling, clitics, and final consonants. Use it to target fine-tuning and measure which errors improve.
- Offer optional standard-spelling output through context-aware post-processing. Keep the original transcript available for users who want the spoken forms.
- Test overlapping context when splitting long recordings. Check whether it improves recognition of consonants near segment boundaries and whether overlap introduces duplicate words.
- Keep reporting WER and CER under the current scoring rules. Add a second score on human-reviewed clips with documented acceptable variants to measure the effect of spelling conventions.
## Use with Transformers
Install Transformers, PyTorch, and SoundFile. The example was verified with Transformers 5.16.1.
```bash
pip install "transformers>=5.16.1" torch soundfile
```
Use a short 16 kHz recording. Split long recordings into shorter segments before transcription.
```python
import soundfile as sf
import torch
from transformers import AutoModelForMultimodalLM, AutoProcessor
repo_id = "Chillarmo/DpirASR"
device = "cuda" if torch.cuda.is_available() else "cpu"
dtype = torch.bfloat16 if device == "cuda" and torch.cuda.is_bf16_supported() else torch.float32
processor = AutoProcessor.from_pretrained(repo_id)
model = AutoModelForMultimodalLM.from_pretrained(repo_id, dtype=dtype).to(device).eval()
audio, sample_rate = sf.read("armenian.wav", dtype="float32", always_2d=True)
if sample_rate != 16_000:
raise ValueError("Resample the recording to 16 kHz before transcription.")
conversation = [
{"role": "user", "content": [{"type": "audio", "audio": audio.mean(axis=1)}]},
{"role": "assistant", "content": [{"type": "text", "text": "language Armenian<asr_text>"}]},
]
inputs = processor.apply_chat_template(
[conversation], tokenize=True, return_dict=True, continue_final_message=True
).to(device, dtype)
with torch.inference_mode():
output = model.generate(**inputs, do_sample=False, max_new_tokens=512)
new_tokens = output[:, inputs["input_ids"].shape[1]:]
print(processor.decode(new_tokens, return_format="transcription_only")[0])
```
## Training
Fine-tuning started from an Armenian-adapted Qwen3-ASR checkpoint and used 25,219 clips (67.68 hours) from 236 recordings. Validation used 1,014 clips (2.85 hours) from 12 separate recordings. The run trained the upper audio-encoder layers, audio projector, and final language-model normalization, with rank-32 LoRA on the language-model layers. The released checkpoint was selected by validation loss after three epochs and 1,185 optimizer updates.
## License
The released weights derive from Qwen3-ASR under Apache 2.0. [License text](LICENSE)