Update README.md
Browse files
README.md
CHANGED
|
@@ -1,141 +1,27 @@
|
|
| 1 |
-
# πΎ Project Samarth β Intelligent Q&A System
|
| 2 |
-
**Bridging Agriculture & Climate Insights using Live Government Data**
|
| 3 |
-
|
| 4 |
-
---
|
| 5 |
-
|
| 6 |
-
### π§ Overview
|
| 7 |
-
|
| 8 |
-
**Project Samarth** is an intelligent **Q&A system** built to analyze and answer complex, data-driven questions about **Indiaβs agricultural economy** and its relationship with **climate patterns** β powered entirely by **live datasets from [data.gov.in](https://data.gov.in/)**.
|
| 9 |
-
|
| 10 |
-
This system fetches real-time data from the:
|
| 11 |
-
- ποΈ **Ministry of Agriculture & Farmers Welfare**
|
| 12 |
-
- π¦οΈ **India Meteorological Department (IMD)**
|
| 13 |
-
|
| 14 |
-
It integrates both datasets and allows users to query them in **natural language** through a clean **Streamlit-based interface**.
|
| 15 |
-
|
| 16 |
-
---
|
| 17 |
-
|
| 18 |
-
### π― Problem Statement
|
| 19 |
-
|
| 20 |
-
Government portals like **data.gov.in** contain thousands of valuable datasets β but they exist in diverse formats across ministries, making it difficult to extract cross-domain insights.
|
| 21 |
-
|
| 22 |
-
**Your Mission:**
|
| 23 |
-
To design and build a **functional end-to-end prototype** that:
|
| 24 |
-
1. Fetches live government data using APIs.
|
| 25 |
-
2. Integrates multiple datasets (Agriculture + IMD Rainfall).
|
| 26 |
-
3. Enables users to ask **natural language questions**.
|
| 27 |
-
4. Returns accurate, traceable, and data-backed insights with proper citations.
|
| 28 |
-
|
| 29 |
---
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
- Automatically merges climate and crop production datasets using cleaned and normalized state names.
|
| 40 |
-
|
| 41 |
-
β
**Intelligent Q&A Engine**
|
| 42 |
-
- Understands queries like:
|
| 43 |
-
- βCompare rainfall and rice production in Bihar and Jharkhand for the last 5 years.β
|
| 44 |
-
- βAnalyze crop trends in Andhra Pradesh.β
|
| 45 |
-
|
| 46 |
-
β
**Streamlit Chat Interface**
|
| 47 |
-
- Simple user input box.
|
| 48 |
-
- Clean, markdown-based formatted answers.
|
| 49 |
-
- Auto-citation of data sources.
|
| 50 |
-
|
| 51 |
-
β
**Accuracy & Traceability**
|
| 52 |
-
- Every answer is directly backed by the live dataset and cited source.
|
| 53 |
-
|
| 54 |
-
---
|
| 55 |
-
|
| 56 |
-
### π§© System Architecture
|
| 57 |
-
|
| 58 |
-
User (Streamlit UI)
|
| 59 |
-
β
|
| 60 |
-
βΌ
|
| 61 |
-
Natural Language Parser (LLM / Keyword Extractor)
|
| 62 |
-
β
|
| 63 |
-
βΌ
|
| 64 |
-
Query Engine (Pandas Logic)
|
| 65 |
-
β
|
| 66 |
-
βΌ
|
| 67 |
-
Data Layer (APIs + Local CSV Integration)
|
| 68 |
-
β
|
| 69 |
-
βΌ
|
| 70 |
-
Answer Generator (Formatter + Citation)
|
| 71 |
-
|
| 72 |
-
|
| 73 |
---
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
| Layer | Tools / Libraries |
|
| 78 |
-
|-------|--------------------|
|
| 79 |
-
| Data Fetching | `requests`, `pandas`, `json` |
|
| 80 |
-
| Data Integration | `pandas`, `numpy` |
|
| 81 |
-
| NLP Parsing | Custom keyword parser / rule-based |
|
| 82 |
-
| Visualization | `matplotlib`, `seaborn`, `plotly` |
|
| 83 |
-
| Frontend | `streamlit`, `style.css` |
|
| 84 |
-
| Backend Logic | Python 3.10+ |
|
| 85 |
-
| Source | [data.gov.in](https://data.gov.in) APIs |
|
| 86 |
|
| 87 |
-
|
|
|
|
| 88 |
|
| 89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
-
|
| 92 |
```bash
|
| 93 |
-
git clone https://github.com/<your-username>/Project_Samarth.git
|
| 94 |
-
cd Project_Samarth
|
| 95 |
-
|
| 96 |
-
2οΈβ£ Create a Virtual Environment
|
| 97 |
-
|
| 98 |
-
python -m venv venv
|
| 99 |
-
source venv/bin/activate # (or venv\Scripts\activate on Windows)
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
3οΈβ£ Install Dependencies
|
| 103 |
-
|
| 104 |
pip install -r requirements.txt
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
4οΈβ£ Fetch & Integrate Data
|
| 108 |
-
|
| 109 |
-
python main.py
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
5οΈβ£ Run the Streamlit Q&A Interface
|
| 113 |
-
|
| 114 |
-
streamlit run ui/app_streamlit.py
|
| 115 |
-
|
| 116 |
-
π§ Example Query
|
| 117 |
-
|
| 118 |
-
Input:
|
| 119 |
-
|
| 120 |
-
Compare rainfall and rice production in Andaman and Nicobar Islands for the last 5 years
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
Output:
|
| 124 |
-
|
| 125 |
-
π Analysis for Andaman and Nicobar Islands β Crop: Rice
|
| 126 |
-
|
| 127 |
-
π§οΈ Average Rainfall (mm):
|
| 128 |
-
β’ Andaman and Nicobar Islands: 1142.46
|
| 129 |
-
|
| 130 |
-
πΎ Total Production (tonnes):
|
| 131 |
-
β’ Andaman and Nicobar Islands: 45,451
|
| 132 |
-
|
| 133 |
-
π Data Source: Ministry of Agriculture & Farmers Welfare and India Meteorological Department (IMD), data.gov.in
|
| 134 |
-
|
| 135 |
-
π§© Key Dataset References
|
| 136 |
-
Dataset Ministry API Resource ID
|
| 137 |
-
District-wise Crop Production Statistics (1997β2014) Ministry of Agriculture & Farmers Welfare xxxxx
|
| 138 |
-
Sub-divisional Rainfall Data (1901β2017) India Meteorological Department (IMD) xxxxxx
|
| 139 |
-
|
| 140 |
-
π¨βπ» Developed By
|
| 141 |
-
Satyam Kumar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: "πΎ Project Samarth β Intelligent Q&A System"
|
| 3 |
+
emoji: π¦οΈ
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: blue
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: "1.38.0"
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# πΎ Project Samarth β Intelligent Q&A System
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
An AI-powered Q&A interface that integrates live government data from **data.gov.in**
|
| 16 |
+
to answer natural language questions about agriculture and climate.
|
| 17 |
|
| 18 |
+
## π§ Features
|
| 19 |
+
- Real-time data fetching via official APIs (Agriculture + IMD)
|
| 20 |
+
- Automatic data cleaning, merging, and correlation
|
| 21 |
+
- Streamlit chatbot for user-friendly question answering
|
| 22 |
+
- Source citation for every answer
|
| 23 |
|
| 24 |
+
## βοΈ Run Locally
|
| 25 |
```bash
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
pip install -r requirements.txt
|
| 27 |
+
streamlit run app.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|