Amharic predictive text keyboard with next-word suggestion using N-gram + Bi-LSTM models. Built for faster typing in አማርኛ.
# ⌨️ Smart Amharic Predictive Keyboard
**Amharic next-word prediction keyboard** built with a **Trigram N-gram Model**.
A practical Machine Learning mini-project that helps users type faster in አማርኛ by suggesting the next word based on typing history.
## ✨ Features
- Real-time next-word suggestions (top 5)
- Clickable suggestion buttons (just like phone keyboards)
- Trained on **765,167** real Amharic news sentences
- Large vocabulary (~555k words)
- Clean and responsive Streamlit web interface
- Supports full Ge'ez (Amharic) script
## 🛠️ Tech Stack
- **Python**
- **N-gram (Trigram)** language model with backoff
- **Pandas** + **Regex** for Amharic text preprocessing
- **Streamlit** for the interactive keyboard demo
## 📁 Project Structure
```
smart-amharic-predictive-keyboard/
├── data/
│ ├── raw/ # (ignored - contains Amharic News Dataset.csv)
│ └── processed/
│ └── cleaned_sentences.txt
├── src/
│ ├── preprocess.py
│ └── ngram_model.py
├── app/
│ └── main.py # Streamlit keyboard demo
├── models/
│ └── amharic_trigram.pkl # Trained model (run training script to generate)
├── notebooks/
├── requirements.txt
└── README.md
```
## 🚀 How to Run
### 1. Clone the repo
```bash
git clone
github.com
cd smart-amharic-predictive-keyboard
```
### 2. Install dependencies
```bash
pip install -r requirements.txt
```
### 3. Add the dataset
Download the Amharic News Text Classification Dataset and place the CSV in:
```
data/raw/Amharic News Dataset.csv
```
### 4. Preprocess the data
```bash
python src/preprocess.py
```
### 5. Train the model (only once)
```bash
python src/ngram_model.py
```
### 6. Run the keyboard
```bash
streamlit run app/main.py
```
---
## 📊 Dataset
- **Source**: Amharic News Text Classification Dataset
- **Size**: 51,483 news articles → 765,167 cleaned sentences
- **Used for**: Training the trigram language model
---
# …