An AI agent assists users to translate between languages with a high support for the moroccan darija that is NOT exists in other tranlation apps
# Darija Translator 🇲🇦
An AI-powered translator specifically designed for Moroccan Darija (Moroccan Arabic). This tool provides accurate translations between Darija and other languages including Arabic, English, and French, focusing on contextual meaning rather than literal word-by-word translation.
## 🌟 Features
- **Contextual Translation**: Translates by meaning, not word-for-word (e.g., "زيد نقص" → "decrease more" not "add less")
- **Darija-Focused**: Specialized in Moroccan Arabic with cultural context understanding
- **Multi-language Support**: Translates between Darija and:
- 🇸🇦 Modern Standard Arabic (العربية الفصحى)
- 🇺🇸 English
- 🇫🇷 French
- **Clean Output**: Returns only the translation without explanations
- **Interactive Web Interface**: User-friendly Gradio interface
- **Bidirectional Translation**: Supports both directions (Darija ↔ Other Languages)
## 🚀 Getting Started
### Prerequisites
- Python 3.7 or higher
- OpenAI API key
### Installation
1. **Clone the repository**
```bash
git clone
github.com
cd darija-translator
```
2. **Install required packages**
```bash
pip install -r requirements.txt
```
3. **Set up environment variables**
Create a `.env` file in the project root:
```
OPENAI_API_KEY=your_openai_api_key_here
```
4. **Run the application**
```bash
jupyter notebook darjia_translator.ipynb
```
Or convert to Python and run directly:
```bash
jupyter nbconvert --to python darjia_translator.ipynb
python darjia_translator.py
```
## 📖 Usage
1. **Start the application** - The Gradio interface will launch automatically
2. **Access the translator** at `
127.0.0.1` (or the displayed URL)
3. **Enter your text** in the input field
4. **Select source and target languages**
5. **Click "Translate"** to get your translation
### Example Translations
| Input (Darija) | Output (English) |
|----------------|------------------|
| "Bghit nakul" | "I want to eat" |
| "Kifach ndir had shi?" | "How …