Update README.md
Browse files
README.md
CHANGED
|
@@ -1,58 +1,323 @@
|
|
| 1 |
-
---
|
| 2 |
-
library_name: transformers
|
| 3 |
-
language:
|
| 4 |
-
- hy
|
| 5 |
-
tags:
|
| 6 |
-
- asr
|
| 7 |
-
- audio
|
| 8 |
-
- speech
|
| 9 |
-
- whisper
|
| 10 |
-
- low-resource
|
| 11 |
-
-
|
| 12 |
-
|
| 13 |
-
-
|
| 14 |
-
-
|
| 15 |
-
|
| 16 |
-
-
|
| 17 |
-
|
| 18 |
-
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
#
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
-
|
| 48 |
-
|
| 49 |
-
-
|
| 50 |
-
-
|
| 51 |
-
-
|
| 52 |
-
|
| 53 |
-
###
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
language:
|
| 4 |
+
- hy
|
| 5 |
+
tags:
|
| 6 |
+
- asr
|
| 7 |
+
- audio
|
| 8 |
+
- speech
|
| 9 |
+
- whisper
|
| 10 |
+
- low-resource
|
| 11 |
+
- morpheme-tokenization
|
| 12 |
+
- armenian
|
| 13 |
+
- compact-model
|
| 14 |
+
- generated_from_trainer
|
| 15 |
+
datasets:
|
| 16 |
+
- Chillarmo/common_voice_20_armenian
|
| 17 |
+
model-index:
|
| 18 |
+
- name: ATOM (Armenian Tiny Optimized Model)
|
| 19 |
+
results:
|
| 20 |
+
- task:
|
| 21 |
+
type: automatic-speech-recognition
|
| 22 |
+
name: Automatic Speech Recognition
|
| 23 |
+
dataset:
|
| 24 |
+
name: Common Voice 20.0 Armenian
|
| 25 |
+
type: mozilla-foundation/common_voice_20_0
|
| 26 |
+
config: hy
|
| 27 |
+
split: test
|
| 28 |
+
metrics:
|
| 29 |
+
- type: wer
|
| 30 |
+
value: 42.1
|
| 31 |
+
name: Word Error Rate
|
| 32 |
+
- type: exact_match
|
| 33 |
+
value: 10.06
|
| 34 |
+
name: Exact Match
|
| 35 |
+
license: mit
|
| 36 |
+
metrics:
|
| 37 |
+
- wer
|
| 38 |
+
pipeline_tag: automatic-speech-recognition
|
| 39 |
+
---
|
| 40 |
+
|
| 41 |
+
# ATOM: Armenian Tiny Optimized Model
|
| 42 |
+
|
| 43 |
+
A compact, morpheme-aware Automatic Speech Recognition (ASR) model that **significantly outperforms** OpenAI's Whisper on Armenian speech recognition.
|
| 44 |
+
|
| 45 |
+
## Model Description
|
| 46 |
+
|
| 47 |
+
ATOM is a specialized ASR model for low-resource Armenian, achieving **64.5% lower WER** than vanilla Whisper-tiny **on Armenian** while using **28% fewer parameters**. The model combines:
|
| 48 |
+
|
| 49 |
+
- **Frozen Whisper-tiny encoder** (pre-trained audio feature extraction)
|
| 50 |
+
- **Custom compact decoder** (2 layers, trained from scratch on Armenian)
|
| 51 |
+
- **Morpheme-level BPE tokenization** (5,000 tokens optimized for Armenian morphology vs Whisper's 51k multilingual tokens)
|
| 52 |
+
|
| 53 |
+
### Architecture
|
| 54 |
+
|
| 55 |
+
```
|
| 56 |
+
Input: Audio (16kHz)
|
| 57 |
+
↓
|
| 58 |
+
Whisper Encoder (frozen, 4 layers, 384 hidden, 1536 FFN)
|
| 59 |
+
↓
|
| 60 |
+
Compact Decoder (trainable, 2 layers, 384 hidden, 1024 FFN)
|
| 61 |
+
↓
|
| 62 |
+
Morpheme Vocabulary (5,000 tokens)
|
| 63 |
+
↓
|
| 64 |
+
Output: Armenian Text
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
**Total Parameters:** ~28M (28% smaller than Whisper-tiny's 39M)
|
| 68 |
+
|
| 69 |
+
## Performance
|
| 70 |
+
|
| 71 |
+
Evaluated on Common Voice 20.0 Armenian test set:
|
| 72 |
+
|
| 73 |
+
| Model | Parameters | WER (Armenian) | Relative Improvement |
|
| 74 |
+
|-------|------------|----------------|---------------------|
|
| 75 |
+
| Whisper-tiny | 39M | 118.6%* | Baseline |
|
| 76 |
+
| Whisper-base | 74M | 126.3%* | -6.5% (worse) |
|
| 77 |
+
| Whisper-small | 244M | 86.6%* | +27.0% |
|
| 78 |
+
| Whisper-medium | 769M | 60.1%* | +49.3% |
|
| 79 |
+
| Whisper-large | 1550M | 53.7%* | +54.7% |
|
| 80 |
+
| Whisper-large-v2 | 1550M | 44.6%* | +62.4% |
|
| 81 |
+
| **ATOM** | **28M** | **42.1%** | **+64.5%** ✅ |
|
| 82 |
+
|
| 83 |
+
*Whisper WER values for Armenian from published benchmarks
|
| 84 |
+
|
| 85 |
+
### Key Insights:
|
| 86 |
+
- **ATOM outperforms ALL Whisper models on Armenian**, including models up to 55× larger
|
| 87 |
+
- **Word Error Rate (WER):** 42.1% vs Whisper-tiny's 118.6% on Armenian
|
| 88 |
+
- **Model Size:** 28M parameters (28% smaller than Whisper-tiny, 55× smaller than Whisper-large-v2)
|
| 89 |
+
- **Training Efficiency:** Trained on minimal Armenian speech data vs Whisper's 680k hours multilingual
|
| 90 |
+
|
| 91 |
+
**Note:** While Whisper models achieve strong performance on high-resource languages (e.g., Whisper-tiny: 79.0% average WER), they perform significantly worse on low-resource Armenian (118.6% WER), demonstrating the need for language-specific approaches.
|
| 92 |
+
|
| 93 |
+
## Why ATOM Outperforms Whisper
|
| 94 |
+
|
| 95 |
+
1. **Morpheme-Aware Tokenization:** Armenian is an agglutinative language where words combine multiple morphemes (e.g., "չէինք" = "չ" [negation] + "է" [to be] + "ինք" [we/past]). ATOM's morpheme-level vocabulary (5k tokens) captures this linguistic structure better than Whisper's multilingual word-level BPE (51k tokens).
|
| 96 |
+
|
| 97 |
+
2. **Language-Specific Training:** While Whisper is trained on 99 languages (680k hours), ATOM's decoder is trained exclusively on Armenian, allowing deep specialization on Armenian phonology and morphology.
|
| 98 |
+
|
| 99 |
+
3. **Efficient Architecture:** The compact 2-layer decoder prevents overfitting on limited training data while the frozen pre-trained encoder provides robust audio feature extraction.
|
| 100 |
+
|
| 101 |
+
4. **Low-Resource Optimization:** Whisper's multilingual training spreads capacity across languages, disadvantaging low-resource Armenian. ATOM dedicates all decoder capacity to Armenian.
|
| 102 |
+
|
| 103 |
+
## Intended Uses
|
| 104 |
+
|
| 105 |
+
**Primary Uses:**
|
| 106 |
+
- Armenian speech-to-text transcription
|
| 107 |
+
- Real-time subtitling for Armenian content
|
| 108 |
+
- Accessibility tools for Armenian speakers
|
| 109 |
+
- Research on morpheme-aware ASR for agglutinative languages
|
| 110 |
+
|
| 111 |
+
**Best Performance:**
|
| 112 |
+
- Clear speech in quiet environments
|
| 113 |
+
- Native Armenian speakers
|
| 114 |
+
- Standard Eastern/Western Armenian dialects
|
| 115 |
+
|
| 116 |
+
## Limitations
|
| 117 |
+
|
| 118 |
+
- Trained on limited data (relatively small dataset)
|
| 119 |
+
- May struggle with heavy accents or noisy audio
|
| 120 |
+
- Optimized for Armenian only (not multilingual)
|
| 121 |
+
- 10% exact match rate indicates room for improvement in perfect transcriptions
|
| 122 |
+
- Performance may degrade on out-of-domain audio (non-Common Voice data)
|
| 123 |
+
|
| 124 |
+
## Training Details
|
| 125 |
+
|
| 126 |
+
### Training Data
|
| 127 |
+
|
| 128 |
+
- **Dataset:** Common Voice 20.0 Armenian
|
| 129 |
+
- **Splits Used:** Train + Other
|
| 130 |
+
- **Duration:** Approximately 30 hours of Armenian speech
|
| 131 |
+
- **Speakers:** 400+ unique speakers
|
| 132 |
+
- **Demographics:**
|
| 133 |
+
- Gender: 55% Female, 25% Male, 20% Undefined
|
| 134 |
+
- Age: Primarily 20s-30s (70%+)
|
| 135 |
+
- **Test Set:** Common Voice test split (separate, unseen data)
|
| 136 |
+
|
| 137 |
+
### Training Hyperparameters
|
| 138 |
+
|
| 139 |
+
```python
|
| 140 |
+
learning_rate: 1e-4
|
| 141 |
+
train_batch_size: 32
|
| 142 |
+
gradient_accumulation_steps: 1
|
| 143 |
+
warmup_steps: 500
|
| 144 |
+
max_steps: 12,000
|
| 145 |
+
save_steps: 3,000
|
| 146 |
+
fp16: True
|
| 147 |
+
optimizer: AdamW (torch)
|
| 148 |
+
lr_scheduler_type: cosine
|
| 149 |
+
max_grad_norm: 1.0
|
| 150 |
+
gradient_checkpointing: True
|
| 151 |
+
dataloader_num_workers: 8
|
| 152 |
+
```
|
| 153 |
+
|
| 154 |
+
### Training Infrastructure
|
| 155 |
+
|
| 156 |
+
- **GPU:** NVIDIA RTX 3060 ti with FP16 mixed precision
|
| 157 |
+
- **Framework:**
|
| 158 |
+
- Transformers 4.56.2
|
| 159 |
+
- PyTorch 2.8.0+cu129
|
| 160 |
+
- Datasets 3.5.0
|
| 161 |
+
- Tokenizers 0.22.1
|
| 162 |
+
- **Final Checkpoint:** Step 9,000
|
| 163 |
+
- **Evaluation Loss:** 1.36
|
| 164 |
+
|
| 165 |
+
## Usage
|
| 166 |
+
|
| 167 |
+
### Installation
|
| 168 |
+
|
| 169 |
+
```bash
|
| 170 |
+
pip install transformers torch torchaudio
|
| 171 |
+
```
|
| 172 |
+
|
| 173 |
+
### Basic Inference
|
| 174 |
+
|
| 175 |
+
```python
|
| 176 |
+
from transformers import WhisperForConditionalGeneration, WhisperProcessor
|
| 177 |
+
import torch
|
| 178 |
+
|
| 179 |
+
# Load model and processor
|
| 180 |
+
model = WhisperForConditionalGeneration.from_pretrained("Chillarmo/ATOM")
|
| 181 |
+
processor = WhisperProcessor.from_pretrained("Chillarmo/ATOM")
|
| 182 |
+
|
| 183 |
+
# Load audio (16kHz)
|
| 184 |
+
import torchaudio
|
| 185 |
+
audio, sr = torchaudio.load("audio.wav")
|
| 186 |
+
if sr != 16000:
|
| 187 |
+
resampler = torchaudio.transforms.Resample(sr, 16000)
|
| 188 |
+
audio = resampler(audio)
|
| 189 |
+
|
| 190 |
+
# Process
|
| 191 |
+
input_features = processor(
|
| 192 |
+
audio.squeeze().numpy(),
|
| 193 |
+
sampling_rate=16000,
|
| 194 |
+
return_tensors="pt"
|
| 195 |
+
).input_features
|
| 196 |
+
|
| 197 |
+
# Generate
|
| 198 |
+
with torch.no_grad():
|
| 199 |
+
predicted_ids = model.generate(
|
| 200 |
+
input_features,
|
| 201 |
+
max_length=448,
|
| 202 |
+
num_beams=5,
|
| 203 |
+
repetition_penalty=1.2,
|
| 204 |
+
no_repeat_ngram_size=3
|
| 205 |
+
)
|
| 206 |
+
|
| 207 |
+
# Decode
|
| 208 |
+
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0]
|
| 209 |
+
print(transcription)
|
| 210 |
+
```
|
| 211 |
+
|
| 212 |
+
### Advanced Usage with Pipeline
|
| 213 |
+
|
| 214 |
+
```python
|
| 215 |
+
from transformers import pipeline
|
| 216 |
+
|
| 217 |
+
# Create ASR pipeline
|
| 218 |
+
asr_pipeline = pipeline(
|
| 219 |
+
"automatic-speech-recognition",
|
| 220 |
+
model="Chillarmo/ATOM",
|
| 221 |
+
device=0 # Use GPU if available
|
| 222 |
+
)
|
| 223 |
+
|
| 224 |
+
# Transcribe
|
| 225 |
+
result = asr_pipeline(
|
| 226 |
+
"audio.wav",
|
| 227 |
+
generate_kwargs={
|
| 228 |
+
"max_length": 448,
|
| 229 |
+
"num_beams": 5,
|
| 230 |
+
"repetition_penalty": 1.2
|
| 231 |
+
}
|
| 232 |
+
)
|
| 233 |
+
print(result["text"])
|
| 234 |
+
```
|
| 235 |
+
|
| 236 |
+
## Technical Details
|
| 237 |
+
|
| 238 |
+
### Morpheme Tokenization
|
| 239 |
+
|
| 240 |
+
The model uses a custom BPE tokenizer trained on Armenian text with morpheme-level granularity:
|
| 241 |
+
- **Vocabulary Size:** 5,000 tokens
|
| 242 |
+
- **Special Tokens:** `<pad>`, `<s>`, `</s>`, `<unk>`
|
| 243 |
+
- **Training Corpus:** Armenian Wikipedia + Common Voice transcriptions
|
| 244 |
+
- **Morpheme Segmentation:** Whitespace pre-tokenization optimized for Armenian word structure
|
| 245 |
+
|
| 246 |
+
Example tokenization:
|
| 247 |
+
```
|
| 248 |
+
Word: "չէինք" (we were not)
|
| 249 |
+
Morphemes: ["չ", "է", "ինք"]
|
| 250 |
+
Translation: [negation] + [to be] + [we/past]
|
| 251 |
+
```
|
| 252 |
+
|
| 253 |
+
### Model Architecture
|
| 254 |
+
|
| 255 |
+
**Encoder (Frozen):**
|
| 256 |
+
- 4 Transformer encoder layers
|
| 257 |
+
- 384 hidden dimensions
|
| 258 |
+
- 1536 feed-forward dimensions
|
| 259 |
+
- 6 attention heads
|
| 260 |
+
- Pre-trained on Whisper's 680k hour multilingual dataset
|
| 261 |
+
|
| 262 |
+
**Decoder (Trained from Scratch):**
|
| 263 |
+
- 2 Transformer decoder layers (50% reduction)
|
| 264 |
+
- 384 hidden dimensions
|
| 265 |
+
- 1024 feed-forward dimensions (33% reduction)
|
| 266 |
+
- 6 attention heads
|
| 267 |
+
- Trained exclusively on Armenian
|
| 268 |
+
|
| 269 |
+
**Parameter Breakdown:**
|
| 270 |
+
- Encoder (frozen): ~20M parameters
|
| 271 |
+
- Decoder (trainable): ~6M parameters
|
| 272 |
+
- Embeddings: ~2M parameters
|
| 273 |
+
- **Total:** ~28M parameters
|
| 274 |
+
|
| 275 |
+
## Reproduction
|
| 276 |
+
|
| 277 |
+
To reproduce training:
|
| 278 |
+
|
| 279 |
+
```bash
|
| 280 |
+
# Install dependencies
|
| 281 |
+
pip install transformers datasets evaluate jiwer accelerate
|
| 282 |
+
|
| 283 |
+
# Train
|
| 284 |
+
python train.py \
|
| 285 |
+
--model_name_or_path openai/whisper-tiny \
|
| 286 |
+
--dataset Chillarmo/common_voice_20_armenian \
|
| 287 |
+
--output_dir ./atom-model \
|
| 288 |
+
--learning_rate 1e-4 \
|
| 289 |
+
--per_device_train_batch_size 32 \
|
| 290 |
+
--max_steps 12000 \
|
| 291 |
+
--fp16 \
|
| 292 |
+
--save_steps 3000
|
| 293 |
+
```
|
| 294 |
+
|
| 295 |
+
## Citation
|
| 296 |
+
|
| 297 |
+
```bibtex
|
| 298 |
+
@misc{movsesyan2025atom,
|
| 299 |
+
title={ATOM: Morpheme-Aware Whisper for Low-Resource Armenian ASR},
|
| 300 |
+
author={Movsesyan, Movses},
|
| 301 |
+
year={2025},
|
| 302 |
+
institution={California State University, Sacramento}
|
| 303 |
+
}
|
| 304 |
+
```
|
| 305 |
+
|
| 306 |
+
## References
|
| 307 |
+
|
| 308 |
+
Whisper Armenian benchmarks from published evaluations on Common Voice datasets.
|
| 309 |
+
|
| 310 |
+
## Acknowledgments
|
| 311 |
+
|
| 312 |
+
- Built on OpenAI's Whisper architecture ([Radford et al., 2022](https://arxiv.org/abs/2212.04356))
|
| 313 |
+
- Trained on Mozilla Common Voice data
|
| 314 |
+
- Morpheme tokenization inspired by Armenian linguistic structure
|
| 315 |
+
- California State University, Sacramento
|
| 316 |
+
|
| 317 |
+
## License
|
| 318 |
+
|
| 319 |
+
[Specify license - typically MIT or Apache 2.0]
|
| 320 |
+
|
| 321 |
+
---
|
| 322 |
+
|
| 323 |
+
**Model Card Contact:** movsesmovsesyan@csus.edu
|