# πΏ Ethiopian Crop Recommendation Chatbot
### AI-Powered System for Endemic Plants in Ethiopia
---
## π Project Overview
This is a complete AI-powered chatbot that recommends the best **endemic Ethiopian crops**
based on soil conditions, climate, altitude, and region β using a **Random Forest ML model**
trained on real Ethiopian agro-ecological data (1,500 rows).
### Supported Crops
| Crop | Amharic | Type |
|------|---------|------|
| Teff | α€α | Highland grain |
| Enset | α₯αα°α΅ | Highland staple |
| Coffee Arabica | α‘α | Export crop |
| Noug | αα | Oilseed |
| Barley | αα₯α΅ | Highland grain |
| Sorghum | ααΎ | Lowland grain |
| Finger Millet | α³αα£ | Nutritious grain |
| Chickpea | α½αα₯α« | Legume |
| Linseed | α°αα£ | Oilseed |
| Maize | α αα | Staple grain |
---
## ποΈ Project Structure
```
ethiopian_crop_chatbot/
βββ backend/
β βββ app.py β Flask server + chatbot engine
β βββ requirements.txt β Python dependencies
β βββ ml/
β β βββ train_model.py β ML training script (run once)
β βββ models/ β Saved ML models (auto-generated)
β β βββ crop_model.pkl
β β βββ soil_encoder.pkl
β β βββ region_encoder.pkl
β β βββ crop_encoder.pkl
β β βββ meta.json
β βββ dataset/
β βββ ethiopian_crop_recommendation_dataset.xlsx
βββ frontend/
β βββ index.html β Full chatbot UI (pure HTML/JS)
βββ database/
βββ schema.sql β SQL Server schema + seed data
```
---
## βοΈ Installation & Setup
### Prerequisites
- Python 3.9 or higher
- pip (Python package manager)
### Step 1 β Install Python dependencies
```bash
cd backend
pip install -r requirements.txt
```
### Step 2 β Train the ML model (run once)
```bash
python ml/train_model.py
```
This reads the Excel dataset, trains a Random Forest classifier, and saves:
- `models/crop_model.pkl`
- `models/soil_encoder.pkl`
- `models/region_encoder.pkl`
- `models/crop_encoder.pkl`
- `models/meta.json`
Expected output:
```
β
Accuracy: ~68% β¦