Logo Lanfrica
  • Home
  • Atlas
  • Insights
  • Docs
  • Sign in

© 2026 Lanfrica. All rights reserved. All copyrights of the resources shown on the Lanfrica website belong to the original copyright holders, unless explicitly stated otherwise.

btissammkouka/Whisper_darija_finetuned

Domain:

natural language processing

Record type:

softwaremodel
Creator:
bti
Host:
# **Whisper Fine-Tuning for Moroccan Darija (Latin Script) 🇲🇦** This repository contains a Jupyter Notebook for fine-tuning OpenAI's **Whisper Small** model to transcribe Moroccan Darija audio directly into **Latin script (Arabizi/Chat Darija)**. Standard Whisper models typically transcribe Darija into Arabic script. This project uses **LoRA (Low-Rank Adaptation)** to efficiently retrain the model to switch writing systems and recognize dialect-specific phonetics without requiring massive computational resources. ## **🚀 Key Features** * **Model:** openai/whisper-small * **Technique:** PEFT (Parameter-Efficient Fine-Tuning) using **LoRA**. * **Objective:** Force the model to output Latin script (e.g., "kifach") instead of Arabic script (e.g., "كيفاش"). * **Evaluation:** Comprehensive evaluation using both **WER** (Word Error Rate) and **CER** (Character Error Rate). ## **📂 Dataset** The project utilizes two primary datasets from Hugging Face: 1. **Training:** atlasia/DODa-audio-dataset * Filtered to ensure valid audio and non-empty Latin transcriptions (darija\_Latn). 2. **Testing/Evaluation:** Snousnou/Moroccan-Darija-ASR & atlasia/DODa-audio-dataset ## **🛠️ Installation & Dependencies** To replicate this notebook, you will need the following libraries: pip install transformers datasets librosa jiwer accelerate peft bitsandbytes ## **🧠 Methodology** ### **1\. Data Preparation** The notebook processes audio into **log-mel input features** (sampling rate: 16kHz) and tokenizes labels using the standard Whisper tokenizer. ### **2\. LoRA Configuration** We use LoRA to train only specific attention layers, significantly reducing memory usage: * **Rank (r):** 8 * **Target Modules:** k\_proj, v\_proj * **Task:** SEQ\_2\_SEQ\_LM ### **3\. Training** * **Batch Size:** 2 (with gradient accumulation steps \= 4\) * **Max Steps:** 500 * **FP16:** Enabled for training efficiency. ## **📊 Results & Performance** The evaluation highlights a significant improvemen …

Visit

github.com

Tasks

automatic speech recognitionspeech processing

Languages

Arabic, Algerian SpokenArabic, Moroccan Spoken