# Kikuyu-English-Machine-Translation
# Thiomi Multilingual Machine Translation (MMT): Kikuyu ⇄ English
👉 **[Live Demo on Hugging Face Spaces]
huggingface.co ** 👉 **[Model Checkpoint on Hugging Face Hub]
huggingface.co **
An end-to-end Machine Translation (MT) pipeline featuring a fine-tuned, bidirectional...
# Thiomi Multilingual Machine Translation (MMT): Kikuyu ⇄ English
An end-to-end Machine Translation (MT) pipeline featuring a fine-tuned, bidirectional **NLLB-200 (No Language Left Behind)** model optimized for high-quality translation between **English (eng_Latn)** and **Gĩkũyũ / Kikuyu (kik_Latn)**. This repository also contains an interactive deployment interface powered by **Gradio**.
---
## Project Overview
Low-resource language technology often relies on massive datasets or brittle parallel architectures. This project adapts Meta's `nllb-200-distilled-600M` via targeted sequence-to-sequence fine-tuning on localized language pairs.
### Key Features
* **True Bidirectional Performance:** A single model checkpoint handling both `English ➔ Kikuyu` and `Kikuyu ➔ English` without code changes, using exact target prefix token controls.
* **Balanced Shuffling:** The text preprocessing architecture flattens parallel rows into explicit language directions and interleaves them perfectly ($50\%$ train/test per path direction) to prevent model steering or catastrophic forgetting.
* **Optimized VRAM Profile:** Implemented using 8-bit Paged AdamW optimizers, gradient checkpointing, and expandable segment allocation configs, enabling stable training loops on single-GPU instances.
---
## 📊 Dataset & Preprocessing
The model is fine-tuned using the parallel text repository: `NjeriKahoro/thiomi-multilingual-text`.
* **Train Samples:** 10,906 total rows (5,453 base parallel pairs flattened bidirectionally)
* **Test Samples:** 2,730 total rows (1,365 base parallel p …