houshino-whisper-fa
houshino-whisper-fa is a fine-tuned checkpoint of openai/whisper-small (244M parameters) adapted for informal conversational Persian and regional dialectal variations, including Kurdish and Lori accents.
While base Whisper models handle formal, standard written Persian reasonably well, they degrade significantly on informal speech, colloquial contractions, and regional pronunciations. This model was fine-tuned specifically to address that gap.
- Base Model:
openai/whisper-small - Live Demo: Houshinoo on Hugging Face Spaces
- Primary Task: Automatic Speech Recognition (
automatic-speech-recognition)
Architecture Selection & Trade-Offs
Before selecting whisper-small, we evaluated several candidate architectures against informal Persian audio samples:
- WavLM: Strong acoustic representations and noise handling, but inference latency and memory requirements were higher than needed for responsive serving.
- wav2vec 2.0: Performed well on clean phonetic alignment, but degraded quickly under real acoustic noise and lacked an integrated autoregressive text decoder for natural Persian sentence completion.
- Qwen-Audio: Capable multimodal foundation model, but the parameter overhead was impractical for a dedicated, low-latency speech-to-text service.
- Whisper (small): Provided the best trade-off between inference speed, memory footprint (244M parameters), and adaptation capability for non-standard Persian phonology.
Data Preparation & Filtering Pipeline
Conversational speech collected from real environments is messy. The initial dataset was roughly 53 GB of raw, uncurated audio.
Feeding this raw data directly into training degraded attention heads due to prolonged silences, low signal-to-noise ratios, clipped audio, and background chatter. We built a dedicated preprocessing and filtering pipeline using Librosa and FFmpeg:
- Stripped dead silence and non-vocal frequencies.
- Removed distorted, clipped, or heavily overlapping segments.
- Aligned verified speech chunks to match Whisper's 30-second log-mel spectrogram input.
This process filtered the raw 53 GB dump down to a 7.7 GB curated training subset of clear, vocal-dense colloquial Persian, Kurdish, and Lori speech samples.
Fine-Tuning & Benchmarks
The model was fine-tuned using PyTorch and Hugging Face transformers. The focus was adjusting the cross-attention and decoder layers so token predictions reflect conversational grammar and colloquial phrasing rather than formal literary Persian.
Evaluation Metrics
Evaluated on an informal conversational and dialectal test set:
- Word Error Rate (WER): 27.435%
- Character Error Rate (CER): 25.342%
(For context: off-the-shelf zero-shot base models typically show >50% WER on these informal and dialectal test samples).
Usage
Using the Pipeline API
import torch
import librosa
from transformers import WhisperProcessor, WhisperForConditionalGeneration
processor = WhisperProcessor.from_pretrained("Abolfazl27Aflhami88/houshino-whisper-fa")
model = WhisperForConditionalGeneration.from_pretrained("Abolfazl27Aflhami88/houshino-whisper-fa")
# Ensure 16kHz mono audio input
audio, sr = librosa.load("path_to_audio.wav", sr=16000)
input_features = processor(audio, sampling_rate=16000, return_tensors="pt").input_features
with torch.no_grad():
predicted_ids = model.generate(input_features, language="persian", task="transcribe")
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0]
print(transcription)