```markdown
# Amharic-English Machine Translation with mT5 & LoRA
This repository contains the complete pipeline for fine-tuning a multilingual Text-to-Text Transfer Transformer (mT5) to translate Amharic to English. The project leverages **Low-Rank Adaptation (LoRA)** to achieve high-performance results on consumer-grade hardware (Google Colab T4 GPU).
---
## 🚀 Project Overview
Amharic is a "low-resource" language with significant morphological complexity. This project addresses these challenges through a specialized preprocessing pipeline and parameter-efficient fine-tuning (PEFT).
### Key Features
* **Base Model**: `google/mt5-small` (Encoder-Decoder architecture).
* **Efficiency**: **LoRA** (Rank 16, Alpha 32) updates <1% of total parameters.
* **Preprocessing**: Phonetic-aware Unicode Normalization for the Ge'ez script.
* **Evaluation**: Multi-angle assessment using **BLEU** and **chrF** scores.
---
## 📂 Project Structure
* `preprocessing.py`: Contains the `clean_and_normalize_dataset` function for Unicode mapping and data cleaning.
* `main.py`: The fine-tuning script utilizing Hugging Face `Trainer` and `peft` for LoRA training.
* `dataset/`: Directory containing dataset files.
* Various CSV files: `cleaned_dataset.csv`, `cleaned_master.csv`, `converted_test.csv`, `converted_train_1.csv`, `converted_train.csv`, `preprocessed_dataset.csv` - processed datasets at different stages.
---
## 🛠️ Installation
### Prerequisites
- Python 3.8+
- CUDA-compatible GPU (recommended for training, though CPU training is possible)
### Dependencies
```bash
pip install pandas torch numpy datasets transformers peft evaluate sacrebleu chrf sentencepiece
```
---
## 📖 Methodology
### 1. Unicode Normalization
Amharic features redundant characters (e.g., ሐ, ኀ, ሀ) that represent the same sound. Our preprocessing script maps these to a canonical form, which:
* Reduces vocabulary sparsity.
* Prevents the model from treating identical phonetic concepts as different words.
* …