# Kinyarwanda Hate Speech Detection App
A machine learning app to detect **hate**, **normal**, or **sarcasm** in Kinyarwanda text using a transformer model. Includes a Chrome extension (Developer Mode) for real-time classification.
---
## 🚀 Features
- Detects `hate`, `normal`, or `sarcasm` in Kinyarwanda
- Uses a fine-tuned `afro-xlmr-mini` transformer model
- Highlights key words with attention-based explanations
- Web interface for text analysis
- Chrome extension for live web integration
---
## 📁 Project Structure
```
project/
│
├── app.py # Flask app
├── README.md
├── Procfile
├── requirements.txt
├── css/
│ ├── dashboard.css
│ ├── index.css
│ ├── login.css
│ ├── register.css
│ ├── moderator_dashboard.css
│ ├── verify.css
│ ├── forgot_password.css
│ ├── reset_password.css
├── templates/
│ ├── dashboard.html
│ ├── index.html
│ ├── login.html
│ ├── register.html
│ ├── moderator_dashboard.html
│ ├── verify.html
│ ├── forgot_password.html
│ ├── reset_password.html
├── model/
│ ├── kinyamodel2.ipynb # Model training notebook
│ ├── kinyarwanda_hard_texts.csv
│ ├── realistic_kinyarwanda_hate_sarcasm_normal.csv
│ ├── label_encoder.pkl
│ ├── kinyarwanda-hatespeech-model/ # Transformer model directory
│ │ ├── config.json
│ │ ├── pytorch_model.bin
│ │ ├── tokenizer_config.json
│ │ ├── sentencepiece.bpe.model
│ │ ├── special_tokens_map.json
├── RHD_extension/ # Chrome extension source files
│ ├── manifest.json
│ ├── popup.html
│ ├── popup.js
│ ├── icon.png
│ ├── content.js
│ ├── background.js
```
---
## 🛠️ Installation
1. **Clone the Repository**
```bash
git clone
github.com
cd kinyarwanda-hate-speech-app
```
2. **Create Virtual Environment**
```bash
python -m venv venv
venv\Scripts\activate # Windows
source venv/bin/activate # macOS/Linux
```
3. **Install Dependencies**
```ba …