# Amharic Hate Speech Detection
This is a prototype-level hate speech detection system for Amharic language text. The model classifies input text into one of three categories: **hate**, **normal**, or **offensive**.
---
## Project Overview
- **Data:** Amharic labeled dataset with text samples categorized as hate, normal, or offensive speech.
- **Model:** Multinomial Naive Bayes classifier trained on TF-IDF features extracted from cleaned text.
- **Preprocessing:** Text cleaning function handles noise removal and normalization.
- **Deployment:** Flask web app exposing a REST API endpoint `/predict` and a simple frontend form for testing predictions.
---
## Features
- Clean and preprocess Amharic text data
- Encode categorical labels
- Train/test split and model evaluation with classification report
- Save and load model, vectorizer, and label encoder using `joblib`
- Flask backend API for prediction
- Interactive web frontend for user input and real-time prediction display
---
## Requirements
- Python 3.7+
- Required packages (install via `pip install -r requirements.txt`):
```bash
Flask
scikit-learn
pandas
joblib
this is how you can run the model on localhost end point
cd C:/your-project-folder
# 1. Create a virtual environment (Windows)
python -m venv venv
# 2. Activate the virtual environment (Windows PowerShell)
.\venv\Scripts\activate
# 3. Upgrade pip (optional but recommended)
python -m pip install --upgrade pip
# 4. Install required packages
pip install flask scikit-learn joblib pandas
# 5. Run the Flask app
python src/app.py
# 6. There is a link that look like
Running on
127.0.0.1 (Press CTRL+C to quit)
# 7.
click ctrl+
127.0.0.1
so it runs on default browser