# Ibani Translator π
A neural machine translation system for English to Ibani language using Hugging Face transformers.
## Features
- **Neural Translation**: Fine-tuned MarianMT model for English to Ibani translation
- **REST API**: FastAPI service with interactive documentation
- **Training Pipeline**: Train custom models on your own Ibani data
- **Batch Translation**: Translate multiple texts efficiently
- **Model Hosting**: Ready for deployment to Hugging Face Hub
## Quick Start
### 1. Install Dependencies
```bash
pip install -r requirements.txt
```
### 2. Start API Server
```bash
python api_server.py
```
The server will start at `
localhost`
Visit `
localhost` for interactive API documentation.
### 3. Use the API Client
```bash
python api_client.py
```
## Project Structure
```
ibani-translator/
βββ api_server.py # FastAPI server
βββ api_client.py # API client with examples
βββ API_USAGE.md # Comprehensive API documentation
βββ huggingface_translator.py # Neural translation core
βββ train_from_ibani_eng.py # Model training script
βββ ibani_eng.json # Training data source
βββ ibani_eng.csv # Training data (CSV format)
βββ ibani_eng_training_data.json # Formatted training data
βββ ibani_single_words.csv # Single word translations
βββ ibani_model/ # Trained model files (output directory)
βββ requirements.txt # Python dependencies
βββ README.md # This file
```
## Usage
### API Translation
#### Single Translation
```bash
curl -X POST "
localhost" \
-H "Content-Type: application/json" \
-d '{"text": "I am eating fish"}'
```
**Response:**
```json
{
"source": "I am eating fish",
"translation": "A nji fα»arα»",
"model": "ibani-translator"
}
```
#### Batch Translation
```bash
curl -X POST "
localhost" \
-H "Content-Type: application/json" \
-d '{"texts": ["Good mornin β¦