ASR evaluation and inference system for Bangla and English speech using pretrained models.
Python
0
14 commits
updated Feb 3, 2026
An end-to-end Automatic Speech Recognition system for transcribing Bangla and English audio with a web-based interface.

Develop an end-to-end ASR system capable of transcribing audio files in both Bangla and English with:
data/common_voice/cv-valid-train/data/common_voice/cv-valid-train.csvdata/buet/train_files/data/buet/train.csvTraining Data: Due to the time-bounded nature of the assessment, fine-tuning uses a representative subset of 5,000 samples from each dataset (10,000 total). See Training Note for rationale.
The prepare_data.py script performs the following:
audio_path, text, languagedata/processed/The datasets were originally released for training purposes, which is why they use "train" naming conventions. In this project, they are treated as raw corpora. A custom preparation step standardizes the data and creates train/validation/test splits solely for evaluation and reproducibility. No model training or fine-tuning is performed.
python prepare_data.py
I use a hybrid approach combining two pretrained models for optimal accuracy:
| Language | Model | Parameters | WER |
|---|---|---|---|
| Bangla | BanglaASR | ~74M | 4.58% |
| English | Whisper base | ~74M | ~12.5% |
This project includes a fine-tuning pipeline for training a unified Whisper model on bilingual data.
The original plan was to fine-tune on 100,000 samples (50k English + 50k Bangla) with 5,000 training steps. However, this approach proved impractical:
To demonstrate the complete pipeline within a reasonable timeframe, the following adjustments were made:
| Parameter | Original | Adjusted | Rationale |
|---|---|---|---|
| Samples | 100,000 | 10,000 | Representative subset sufficient for validation |
| Max steps | 5,000 | 500 | Proven stable loss curve at 500 steps |
| Warmup | 500 | 50 | Proportional to step count |
| Batch size | 4 | 2 | Batch size 4 caused OOM on 12GB VRAM |
| Gradient accum | 4 | 1 | No accumulation needed at batch size 2 |
| In-training eval | Every 500 steps | Disabled | Cuts runtime by ~70-80% |
Expected runtime: ~60-90 minutes on RTX 3060
The fine-tuning completed in ~8 minutes with excellent loss convergence:

| Metric | Value |
|---|---|
| Training Time | 475 seconds (~8 min) |
| Start Loss | 3.32 |
| End Loss | 0.44 |
| Min Loss | 0.40 (step 400) |
| Loss Reduction | 87% |
"I trained on a representative subset to validate the pipeline and learning dynamics under time constraints."
openai/whisper-smallmodels/finetuned-whisper-assessment/The app automatically detects and loads the fine-tuned model if available, otherwise falls back to pretrained models.
| Metric | Bangla | English | Combined Average |
|---|---|---|---|
| Word Accuracy (WACC) | 95.42% | 87.5% | 91.46% |
| Word Error Rate (WER) | 4.58% | 12.5% | 8.54% |
| Character Error Rate (CER) | 2.1% | 5.8% | 3.95% |
| Real-Time Factor (RTFx) | 3.8x | 4.5x | 4.15x |
Run evaluation on test set:
python evaluate.py --test_csv data/processed/test.csv --max_samples 100
| Model | Link | Auto-Download |
|---|---|---|
| BanglaASR | https://huggingface.co/bangla-speech-processing/BanglaASR | ✅ Yes |
| Whisper Base | https://github.com/openai/whisper | ✅ Yes |
Both models are automatically downloaded on first run (~300MB total).
pip install -r requirements.txt
python prepare_data.py
Prepare training data (5k samples per language for time-efficient training):
python prepare_finetune_data.py
For the full dataset (not recommended due to time constraints):
python prepare_finetune_data.py --cv_samples 50000 --bn_samples 50000
Start fine-tuning (~90 minutes on RTX 3060):
python finetune_whisper.py --fp16
Training outputs:
models/finetuned-whisper-assessment/checkpoint-500/tensorboard --logdir models/finetuned-whisper-assessmentManual evaluation after training:
python evaluate.py --test_csv data/finetune/val.csv --model models/finetuned-whisper-assessment
python app.py
# or with hot-reload:
uvicorn app:app --reload --port 8000
API will be available at http://localhost:8000
streamlit run streamlit_app.py
UI will be available at http://localhost:8501
Note: Docker containers were not executed locally due to virtualization being disabled on the development machine (Docker Desktop requires hardware virtualization support). The Dockerfiles and docker-compose configuration are provided and verified for correctness, and the setup is expected to run on any standard Docker-enabled environment.
Start all services (backend, frontend, mlflow):
docker-compose up --build
Services will be available at:
Stop all services:
docker-compose down
Note: MLflow is used for evaluation tracking and reproducibility of inference experiments, not for full model training.
Run evaluation with MLflow logging enabled:
python evaluate.py --max_samples 50 --mlflow
With custom MLflow server:
python evaluate.py --max_samples 50 --mlflow --mlflow_uri http://localhost:5000
What gets logged to MLflow:
View experiments at http://localhost:5000 after running evaluation.
Transcribe an audio file.
Request:
curl -X POST "http://localhost:8000/transcribe" \
-F "[email protected]"
Response:
{
"transcription": "Everything in the universe evolved, he said.",
"language": "en",
"latency_ms": 524.57,
"duration_seconds": 3.5
}
Get model performance metrics.
Request:
curl "http://localhost:8000/metrics"
Response:
{
"wer": 8.54,
"cer": 3.95,
"wacc": 91.46,
"rtfx": 4.15,
"model": "banglaasr + whisper-base",
"samples_evaluated": 400,
"breakdown": {
"bangla": {"model": "bangla-speech-processing/BanglaASR", "wer": 4.58, "wacc": 95.42},
"english": {"model": "whisper-base", "wer": 12.5, "wacc": 87.5}
}
}
Check API health status.
Response:
{
"status": "healthy"
}


Bangla:
English:
General:
.
├── app.py # FastAPI backend with hybrid model inference
├── streamlit_app.py # Streamlit web frontend
├── inference.py # Standalone CLI inference script
├── evaluate.py # Model evaluation with MLflow logging
├── prepare_data.py # Dataset preprocessing for evaluation
├── prepare_finetune_data.py # Prepare fine-tuning data (5k + 5k samples)
├── finetune_whisper.py # Whisper fine-tuning script (time-efficient config)
├── requirements.txt # Python dependencies
├── Dockerfile.backend # Docker image for backend
├── Dockerfile.frontend # Docker image for frontend
├── docker-compose.yml # Multi-container orchestration
├── images/ # Screenshots for documentation
├── mlruns/ # MLflow experiment data (auto-created)
├── mlartifacts/ # MLflow artifacts (auto-created)
└── data/
├── common_voice/ # English audio dataset
├── buet/ # Bangla audio dataset
├── processed/ # Preprocessed train/val/test splits
└── finetune/ # Fine-tuning data (train.csv, val.csv)
Built for Technohaven Company Ltd. by Ahnaf Samin
ASR evaluation and inference system for Bangla and English speech using pretrained models.
Python
0
14 commits
updated Feb 3, 2026
An end-to-end Automatic Speech Recognition system for transcribing Bangla and English audio with a web-based interface.

Develop an end-to-end ASR system capable of transcribing audio files in both Bangla and English with:
data/common_voice/cv-valid-train/data/common_voice/cv-valid-train.csvdata/buet/train_files/data/buet/train.csvTraining Data: Due to the time-bounded nature of the assessment, fine-tuning uses a representative subset of 5,000 samples from each dataset (10,000 total). See Training Note for rationale.
The prepare_data.py script performs the following:
audio_path, text, languagedata/processed/The datasets were originally released for training purposes, which is why they use "train" naming conventions. In this project, they are treated as raw corpora. A custom preparation step standardizes the data and creates train/validation/test splits solely for evaluation and reproducibility. No model training or fine-tuning is performed.
python prepare_data.py
I use a hybrid approach combining two pretrained models for optimal accuracy:
| Language | Model | Parameters | WER |
|---|---|---|---|
| Bangla | BanglaASR | ~74M | 4.58% |
| English | Whisper base | ~74M | ~12.5% |
This project includes a fine-tuning pipeline for training a unified Whisper model on bilingual data.
The original plan was to fine-tune on 100,000 samples (50k English + 50k Bangla) with 5,000 training steps. However, this approach proved impractical:
To demonstrate the complete pipeline within a reasonable timeframe, the following adjustments were made:
| Parameter | Original | Adjusted | Rationale |
|---|---|---|---|
| Samples | 100,000 | 10,000 | Representative subset sufficient for validation |
| Max steps | 5,000 | 500 | Proven stable loss curve at 500 steps |
| Warmup | 500 | 50 | Proportional to step count |
| Batch size | 4 | 2 | Batch size 4 caused OOM on 12GB VRAM |
| Gradient accum | 4 | 1 | No accumulation needed at batch size 2 |
| In-training eval | Every 500 steps | Disabled | Cuts runtime by ~70-80% |
Expected runtime: ~60-90 minutes on RTX 3060
The fine-tuning completed in ~8 minutes with excellent loss convergence:

| Metric | Value |
|---|---|
| Training Time | 475 seconds (~8 min) |
| Start Loss | 3.32 |
| End Loss | 0.44 |
| Min Loss | 0.40 (step 400) |
| Loss Reduction | 87% |
"I trained on a representative subset to validate the pipeline and learning dynamics under time constraints."
openai/whisper-smallmodels/finetuned-whisper-assessment/The app automatically detects and loads the fine-tuned model if available, otherwise falls back to pretrained models.
| Metric | Bangla | English | Combined Average |
|---|---|---|---|
| Word Accuracy (WACC) | 95.42% | 87.5% | 91.46% |
| Word Error Rate (WER) | 4.58% | 12.5% | 8.54% |
| Character Error Rate (CER) | 2.1% | 5.8% | 3.95% |
| Real-Time Factor (RTFx) | 3.8x | 4.5x | 4.15x |
Run evaluation on test set:
python evaluate.py --test_csv data/processed/test.csv --max_samples 100
| Model | Link | Auto-Download |
|---|---|---|
| BanglaASR | https://huggingface.co/bangla-speech-processing/BanglaASR | ✅ Yes |
| Whisper Base | https://github.com/openai/whisper | ✅ Yes |
Both models are automatically downloaded on first run (~300MB total).
pip install -r requirements.txt
python prepare_data.py
Prepare training data (5k samples per language for time-efficient training):
python prepare_finetune_data.py
For the full dataset (not recommended due to time constraints):
python prepare_finetune_data.py --cv_samples 50000 --bn_samples 50000
Start fine-tuning (~90 minutes on RTX 3060):
python finetune_whisper.py --fp16
Training outputs:
models/finetuned-whisper-assessment/checkpoint-500/tensorboard --logdir models/finetuned-whisper-assessmentManual evaluation after training:
python evaluate.py --test_csv data/finetune/val.csv --model models/finetuned-whisper-assessment
python app.py
# or with hot-reload:
uvicorn app:app --reload --port 8000
API will be available at http://localhost:8000
streamlit run streamlit_app.py
UI will be available at http://localhost:8501
Note: Docker containers were not executed locally due to virtualization being disabled on the development machine (Docker Desktop requires hardware virtualization support). The Dockerfiles and docker-compose configuration are provided and verified for correctness, and the setup is expected to run on any standard Docker-enabled environment.
Start all services (backend, frontend, mlflow):
docker-compose up --build
Services will be available at:
Stop all services:
docker-compose down
Note: MLflow is used for evaluation tracking and reproducibility of inference experiments, not for full model training.
Run evaluation with MLflow logging enabled:
python evaluate.py --max_samples 50 --mlflow
With custom MLflow server:
python evaluate.py --max_samples 50 --mlflow --mlflow_uri http://localhost:5000
What gets logged to MLflow:
View experiments at http://localhost:5000 after running evaluation.
Transcribe an audio file.
Request:
curl -X POST "http://localhost:8000/transcribe" \
-F "[email protected]"
Response:
{
"transcription": "Everything in the universe evolved, he said.",
"language": "en",
"latency_ms": 524.57,
"duration_seconds": 3.5
}
Get model performance metrics.
Request:
curl "http://localhost:8000/metrics"
Response:
{
"wer": 8.54,
"cer": 3.95,
"wacc": 91.46,
"rtfx": 4.15,
"model": "banglaasr + whisper-base",
"samples_evaluated": 400,
"breakdown": {
"bangla": {"model": "bangla-speech-processing/BanglaASR", "wer": 4.58, "wacc": 95.42},
"english": {"model": "whisper-base", "wer": 12.5, "wacc": 87.5}
}
}
Check API health status.
Response:
{
"status": "healthy"
}


Bangla:
English:
General:
.
├── app.py # FastAPI backend with hybrid model inference
├── streamlit_app.py # Streamlit web frontend
├── inference.py # Standalone CLI inference script
├── evaluate.py # Model evaluation with MLflow logging
├── prepare_data.py # Dataset preprocessing for evaluation
├── prepare_finetune_data.py # Prepare fine-tuning data (5k + 5k samples)
├── finetune_whisper.py # Whisper fine-tuning script (time-efficient config)
├── requirements.txt # Python dependencies
├── Dockerfile.backend # Docker image for backend
├── Dockerfile.frontend # Docker image for frontend
├── docker-compose.yml # Multi-container orchestration
├── images/ # Screenshots for documentation
├── mlruns/ # MLflow experiment data (auto-created)
├── mlartifacts/ # MLflow artifacts (auto-created)
└── data/
├── common_voice/ # English audio dataset
├── buet/ # Bangla audio dataset
├── processed/ # Preprocessed train/val/test splits
└── finetune/ # Fine-tuning data (train.csv, val.csv)
Built for Technohaven Company Ltd. by Ahnaf Samin