A neural machine translation system for Hassaniya Arabic dialect spoken in Mauritania to English, built with PyTorch and Seq2Seq architecture with attention mechanism.
# Hassaniya-Translator
# π Hassaniya-Bridge: Neural Machine Translation for Hassaniya Arabic
A neural machine translation system for Hassaniya Arabic (a Maghrebi Arabic dialect spoken in Mauritania and Western Sahara) to English, built with PyTorch and Seq2Seq architecture with attention mechanism.
## π Project Overview
**Hassaniya-Bridge** aims to bridge the language gap for one of the world's under-resourced languages. Hassaniya Arabic, spoken by over 3 million people across West Africa, has minimal digital presence and virtually no machine translation support. This project represents a step toward digital inclusion and language preservation.
### Why This Matters
- π£οΈ **Language Preservation**: Hassaniya is an oral tradition language with limited written resources
- π **Digital Inclusion**: Enables Hassaniya speakers to access global information
- π **Research Foundation**: First open-source NMT system for this dialect
- π€ **Cultural Bridge**: Connects Hassaniya-speaking communities with the wider world
## β¨ Features
- β‘ **Seq2Seq with Attention**: LSTM-based encoder-decoder with Bahdanau attention
- π **Custom Vocabulary Builder**: Handles Arabic script and dialect-specific terms
- π― **Teacher Forcing**: Accelerated training with configurable forcing ratio
- πΎ **Model Checkpointing**: Automatic saving of best models
- π **Training Visualization**: Real-time loss tracking and metrics
- π **Inference Pipeline**: Easy-to-use translation interface
## π Quick Start
### Prerequisites
```bash
python >= 3.8
torch >= 2.0.0
numpy >= 1.21.0
matplotlib >= 3.5.0
```
### Installation
```bash
# Clone the repository
git clone
github.com
cd hassaniya-bridge
# Install dependencies
pip install -r requirements.txt
```
### Basic Usage
```python
from model import Seq2Seq, Encoder, Decoder, Attention
from utils import translate_sentence
# Load trained model
model = torch.load('best_model.pt')
# Translate a sentence
hassa β¦