Logo Lanfrica

Ilyass-42/lost-in-darija

Domaine:

natural language processing

Type de record:

model
Créateur:
ILy
Hôte:
# 🗣️ Lost in Darija 🔗 **Try it live on HuggingFace Spaces** A speech-to-speech translation pipeline that converts spoken English into Moroccan Darija, designed for tourists navigating Morocco. 📝 **Read the full write-up** how a model that scored 18.30 BLEU on its own test set dropped to 10.23 on an independent benchmark, what that revealed about the data, and the engineering lessons from building the fix. --- ## ✨ Features - 🎙️ **Speech-to-Text** — transcribes English audio using OpenAI Whisper - 🌍 **Neural Machine Translation** — translates English to Moroccan Darija using a fine-tuned MarianMT model (Helsinki-NLP/opus-mt-en-ar) - 🔊 **Text-to-Speech** — synthesizes Darija audio using Microsoft Edge TTS (ar-MA-JamalNeural voice) - 📊 **BLEU score evaluation** — measures translation quality on a test set (BLEU = 18.30 after 8 epochs) --- ## 💬 Example | Input (English) | Output (Darija, Arabic script) | |---|---| | "Excuse me, can you help me find a good restaurant?" | سمح ليا, واش تقدر تعاوني نلقى شي ريسطورة زوينة? | ## 🗂️ Project Structure ``` lost-in-darija/ ├── data/ │ ├── Train.csv # Training set (eng → darija_ar) │ ├── Val.csv # Validation set │ ├── Test.csv # Test set │ └── sentences.csv # Sample sentences ├── notebooks/ │ └── notebook.ipynb # Experimentation notebook ├── src/ │ ├── pipeline.py # End-to-end pipeline (STT → Translation → TTS) │ ├── stt/ │ │ └── transcribe.py # Whisper transcription │ ├── translation/ │ │ ├── fine_tune.py # MarianMT fine-tuning script │ │ ├── translate.py # Inference with fine-tuned model │ │ └── evaluate.py # BLEU score evaluation │ └── tts/ │ └── synthetise.py # Edge TTS synthesis ├── tests/ │ └── test_pipeline.py ├── requirements.in # Direct dependencies (source) ├── requirements.txt # Pinned dependencies (generated by pip-compile) ├── app.py # Gradio web interface ├── evaluate_terjama.py # …