Cropiee / README.md
Novadotgg
Add Hugging Face Spaces configuration to README.md
3c19be3
metadata
title: Cropiee Assistant
emoji: 🌿
colorFrom: green
colorTo: blue
sdk: docker
pinned: false

🌿 Cropiee | Smart Agricultural Intelligence

Cropiee is a state-of-the-art agricultural assistant powered by Machine Learning and Deep Learning. It provides farmers and agricultural researchers with precision insights on crop recommendations, soil analysis, and real-time market trends through a modern, responsive web interface.


πŸš€ Key Features

  • 🌾 Crop Recommendation Engine: Uses an AdaBoost model to suggest the most suitable crops based on a user's geographical location (weather) and soil chemical readings (N, P, K, pH).
  • 🌱 In-Depth Soil Analysis: Predicts the ideal soil parameters for a specific crop in a given location using a specialized soil prediction model.
  • πŸ“Š Interactive Data Visuals: Features dynamic Radar Charts directly in the chat bubbles to visualize soil health and chemical distribution.
  • πŸ’° Market Pricing Insights: Integration with the National Data API (data.gov.in) to fetch real-time modal prices for crops in specific districts.
  • πŸ€– Advanced NLP: Utilizes DistilBERT for intent classification and sentiment analysis to provide more human-like, empathic responses.
  • πŸŒ™ Eco-Dark & Light Modes: A premium glassmorphism-based UI designed for both day and night use.
  • πŸ“± Fully Responsive: Optimized for Desktop, Tablet, and Mobile devices.

πŸ› οΈ Technology Stack

  • Backend: Python, Flask, Flask-Session
  • Frontend: Vanilla JS (ES6+), CSS3 (Glassmorphism), HTML5
  • Machine Learning: Scikit-learn (AdaBoost, Random Forest), XGBoost, Prophet
  • Deep Learning: HuggingFace Transformers (DistilBERT)
  • APIs: OpenWeatherMap (Weather), Data.gov.in (Market Prices), Ngrok (Tunneling)
  • Visualizations: Chart.js

πŸ“‚ Project Structure

Mtech dissertation/
β”œβ”€β”€ executable_code/         # Main Application Dashboard
β”‚   β”œβ”€β”€ app.py               # Flask Backend & Logic
β”‚   β”œβ”€β”€ templates/           # UI Components (index.html)
β”‚   β”œβ”€β”€ requirements.txt     # Python Dependencies
β”‚   └── run_app.bat          # One-click Windows Launcher
β”œβ”€β”€ models/                  # Trained ML/DL Model Binaries (.pkl)
β”œβ”€β”€ papers/                  # Research & Analysis Papers (Git Ignored)
└── documentation/           # System Manuals & Presentation

βš™οΈ Installation & Setup

1. Prerequisites

Ensure you have Python 3.8+ installed on your system.

2. Set Up Virtual Environment

It is highly recommended to use a virtual environment to avoid dependency conflicts.

# Create venv
python -m venv venv

# Activate venv (Windows)
.\venv\Scripts\activate

3. Install Dependencies

pip install -r executable_code/requirements.txt

4. Natural Language Model

The app uses SpaCy for entity extraction. Ensure the English model is downloaded:

python -m spacy download en_core_web_sm

πŸƒ How to Run

Option 1: Windows (Recommended)

Double-click the run_app.bat file located inside the executable_code folder.

Option 2: Terminal

cd executable_code
python app.py

After starting, the application will be accessible at:

  • Local: http://127.0.0.1:5000
  • Public (Ngrok): The terminal will display a unique public URL if your Ngrok token is valid.

πŸ“– Usage Guide

  1. Onboarding: On your first visit, follow the 3-step guide to learn how to interact with Cropiee.
  2. Crop Recommendation: Click the "🌿 Recommend" chip or type "What should I grow in [Location]?" follow the prompts to enter your soil test values.
  3. Soil Advice: Type "Soil for rice in [Location]" to see a graphical radar chart of the ideal parameters.
  4. Dark Mode: Use the moon icon in the top right for a low-light "Eco-Dark" interface.

πŸŽ“ Academic Context

This project was developed as part of an M.Tech Dissertation to demonstrate the feasibility of bringing complex Deep Learning models to the edge in an accessible, user-friendly format for precision agriculture.