A robust Automatic Speech Recognition (ASR) engine for the Tunisian dialect, featuring code-switching support, a FastAPI-based and deployment configurations for Docker, Azure, and Kubernetes.
# 🇹🇳 Tunisian STT API Service
This repository contains a production-ready **FastAPI** service for **Tunisian Arabic Speech-to-Text (ASR)**. It wraps a specialized Vosk/Kaldi model (`STT_Tun_Model`) into a REST API and provides complete configuration for deployment on **Azure**.
## 🚀 Features
* **FastAPI Backend**: High-performance, asynchronous REST API.
* **Tunisian Dialect Support**: Optimized for Tunisian Arabic with code-switching (French/English).
* **Dockerized**: Complete `Dockerfile` for consistent environments.
* **Azure Ready**: Scripts and documentation for deploying to Azure Container Instances (ACI).
* **Streaming Support**: Real-time transcription capabilities.
## 📂 Project Structure
```
Tunisian_STT/
├── app.py # FastAPI application
├── Dockerfile # Docker configuration
├── requirements.txt # Python dependencies
├── deploy_to_azure.sh # Automated Azure deployment script
├── testing.py # CLI script for testing the model
└── test_api.py # Script to test the deployed API
```
## 🛠️ Local Setup
### Prerequisites
* Python 3.10+
* Docker (optional, for containerization)
### 1. Install Dependencies
```bash
pip install -r requirements.txt
```
### 2. Prepare the Model
You can download the model directly using `curl`:
```bash
sudo apt-get install curl
curl -L
huggingface.co \
--output STT_Tun_Model.zip
```
Then extract it and organize the directory structure:
```bash
unzip STT_Tun_Model.zip
mkdir -p model
mv STT_Tun_Model model/
```
### 3. Run Locally
```bash
uvicorn app:app --host 0.0.0.0 --port 8000
```
Access the API documentation at `
localhost`.
---
## ☁️ Azure Deployment
This project includes a fully automated script to deploy the service to **Azure Container Instances (ACI)**.
### Prerequisites
* **Azure CLI**: Install Azure CLI
* **Azure Account**: You need an active subscription. …