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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
pinned: false
|
9 |
---
|
10 |
|
11 |
+
# Hostel Grievance Redressal System
|
12 |
|
13 |
+
## Overview
|
14 |
+
|
15 |
+
The Hostel Grievance Redressal System is designed to efficiently manage and resolve grievances raised by residents. By leveraging AI/ML functionalities, the system aims to enhance communication, streamline grievance handling, and provide timely resolutions. This document outlines the implementation plans for various AI/ML features, system architecture, and usage instructions.
|
16 |
+
|
17 |
+
---
|
18 |
+
|
19 |
+
## Table of Contents
|
20 |
+
|
21 |
+
1. [System Architecture Overview](#system-architecture-overview)
|
22 |
+
2. [AI/ML Functionalities](#aiml-functionalities)
|
23 |
+
- [1. Intelligent Routing and Workflow Automation](#1-intelligent-routing-and-workflow-automation)
|
24 |
+
- [2. Advanced Sentiment and Emotional Intelligence Analysis](#2-advanced-sentiment-and-emotional-intelligence-analysis)
|
25 |
+
- [3. Multilingual Translation in Chatroom](#3-multilingual-translation-in-chatroom)
|
26 |
+
- [4. Worker Job Recommendation](#4-worker-job-recommendation)
|
27 |
+
3. [Directory Structure](#directory-structure)
|
28 |
+
4. [Conclusion](#conclusion)
|
29 |
+
5. [License](#license)
|
30 |
+
6. [Contact](#contact)
|
31 |
+
|
32 |
+
---
|
33 |
+
|
34 |
+
## System Architecture Overview
|
35 |
+
|
36 |
+
The Hostel Grievance Redressal System is built as a centralized Flask API server that hosts all AI/ML models. This architecture allows different services and applications to interact with the models by sending HTTP requests containing input data and receiving model predictions in response. Each AI/ML functionality is exposed through distinct endpoints, enabling modularity and scalability.
|
37 |
+
|
38 |
+
### Key Components
|
39 |
+
|
40 |
+
1. **Flask API Server**
|
41 |
+
- Central hub for all AI/ML models.
|
42 |
+
- RESTful API design for standardized interactions.
|
43 |
+
- Authentication and authorization mechanisms.
|
44 |
+
|
45 |
+
2. **Model Endpoints**
|
46 |
+
- `/api/intelligent-routing` - Endpoint for intelligent routing and workflow automation.
|
47 |
+
- `/api/sentiment-analysis` - Endpoint for advanced sentiment and emotional intelligence analysis.
|
48 |
+
- `/api/multilingual-translation` - Endpoint for multilingual translation in chatroom.
|
49 |
+
- `/api/job-recommendation` - Endpoint for worker job recommendation.
|
50 |
+
|
51 |
+
3. **Data Handling and Validation**
|
52 |
+
- Input validation using libraries like `pydantic` or `marshmallow`.
|
53 |
+
|
54 |
+
4. **Scalability and Deployment**
|
55 |
+
- Docker for containerization.
|
56 |
+
- Kubernetes or cloud-based services for orchestration.
|
57 |
+
|
58 |
+
---
|
59 |
+
|
60 |
+
## AI/ML Functionalities
|
61 |
+
|
62 |
+
### 1. Intelligent Routing and Workflow Automation
|
63 |
+
|
64 |
+
**Purpose:** Efficiently assign grievances to the most suitable personnel or department based on various factors.
|
65 |
+
|
66 |
+
**Model Design Pipeline:**
|
67 |
+
- Data Collection: Grievance data, staff data, historical assignments.
|
68 |
+
- Data Preprocessing: Cleaning, feature engineering, encoding.
|
69 |
+
- Model Selection: Reinforcement Learning (RL) and Multi-Criteria Decision-Making (MCDM).
|
70 |
+
- Training and Evaluation: Define environment, implement reward functions, and evaluate using metrics like resolution time.
|
71 |
+
|
72 |
+
**API Endpoint:** `https://archcoder-hostel-management-and-greivance-redres-2eeefad.hf.space/api/intelligent-routing`
|
73 |
+
|
74 |
+
**Example Input:**
|
75 |
+
```json
|
76 |
+
{
|
77 |
+
"grievance_id": "G12346",
|
78 |
+
"category": "electricity",
|
79 |
+
"submission_timestamp": "2023-10-02T08:15:00Z",
|
80 |
+
"student_room_no": "204",
|
81 |
+
"hostel_name": "bh2",
|
82 |
+
"floor_number": 2,
|
83 |
+
"current_staff_status": [
|
84 |
+
{
|
85 |
+
"staff_id": "S67890",
|
86 |
+
"department": "electricity",
|
87 |
+
"current_workload": 3,
|
88 |
+
"availability_status": "Available",
|
89 |
+
"past_resolution_rate": 0.95
|
90 |
+
},
|
91 |
+
{
|
92 |
+
"staff_id": "S67891",
|
93 |
+
"department": "plumber",
|
94 |
+
"current_workload": 2,
|
95 |
+
"availability_status": "Available",
|
96 |
+
"past_resolution_rate": 0.90
|
97 |
+
}
|
98 |
+
],
|
99 |
+
"floor_metrics": {
|
100 |
+
"number_of_requests": 15,
|
101 |
+
"total_delays": 1
|
102 |
+
},
|
103 |
+
"availability_data": {
|
104 |
+
"staff_availability": [
|
105 |
+
{
|
106 |
+
"staff_id": "S67890",
|
107 |
+
"time_slot": "08:00-12:00",
|
108 |
+
"availability_status": "Available"
|
109 |
+
}
|
110 |
+
],
|
111 |
+
"student_availability": [
|
112 |
+
{
|
113 |
+
"student_id": "STU204",
|
114 |
+
"time_slot": "08:00-10:00",
|
115 |
+
"availability_status": "Unavailable"
|
116 |
+
}
|
117 |
+
]
|
118 |
+
}
|
119 |
+
}
|
120 |
+
```
|
121 |
+
|
122 |
+
**Example Output:**
|
123 |
+
```json
|
124 |
+
{
|
125 |
+
"job_id": "J12346",
|
126 |
+
"assigned_worker_id": "W67890",
|
127 |
+
"assignment_timestamp": "2023-10-02T08:16:00Z",
|
128 |
+
"expected_resolution_time": "1 hour",
|
129 |
+
"location": {
|
130 |
+
"grievance_id": "G12346",
|
131 |
+
"assigned_staff_id": "S67890",
|
132 |
+
...
|
133 |
+
}
|
134 |
+
```
|
135 |
+
|
136 |
+
---
|
137 |
+
### 2. Advanced Sentiment and Emotional Intelligence Analysis
|
138 |
+
|
139 |
+
**Purpose:** Detect complex emotional states in grievances to enhance responses from administrators.
|
140 |
+
|
141 |
+
**Model Design Pipeline:**
|
142 |
+
- Data Collection: Grievance texts and emotional labels.
|
143 |
+
- Data Preprocessing: Text cleaning, tokenization, and normalization.
|
144 |
+
- Model Selection: Transformer-based models like BERT.
|
145 |
+
|
146 |
+
**API Endpoint:** `https://archcoder-hostel-management-and-greivance-redres-2eeefad.hf.space/api/sentiment-analysis`
|
147 |
+
|
148 |
+
**Example Input:**
|
149 |
+
```json
|
150 |
+
{
|
151 |
+
"grievance_id": "G12349",
|
152 |
+
"text": "Why hasn't the maintenance team fixed the leaking roof yet?"
|
153 |
+
}
|
154 |
+
```
|
155 |
+
|
156 |
+
**Example Output:**
|
157 |
+
```json
|
158 |
+
{
|
159 |
+
"grievance_id": "G12349",
|
160 |
+
"predicted_emotional_label": "Anger",
|
161 |
+
...
|
162 |
+
}
|
163 |
+
```
|
164 |
+
|
165 |
+
---
|
166 |
+
|
167 |
+
### 3. Multilingual Translation in Chatroom
|
168 |
+
|
169 |
+
**Purpose:** Facilitate communication between residents and workers who speak different languages.
|
170 |
+
|
171 |
+
**Model Design Pipeline:**
|
172 |
+
- Data Collection: Multilingual conversation logs and translation pairs.
|
173 |
+
- Data Preprocessing: Cleaning, tokenization, and alignment.
|
174 |
+
- Model Selection: Neural Machine Translation (NMT) models.
|
175 |
+
|
176 |
+
**API Endpoint:** `https://archcoder-hostel-management-and-greivance-redres-2eeefad.hf.space/api/multilingual-translation`
|
177 |
+
|
178 |
+
**Example Input:**
|
179 |
+
```json
|
180 |
+
{
|
181 |
+
"user_message": "toilet me paani nahi aa rha hain",
|
182 |
+
"source_language": "Hindi",
|
183 |
+
"target_language": "English"
|
184 |
+
}
|
185 |
+
```
|
186 |
+
|
187 |
+
**Example Output:**
|
188 |
+
```json
|
189 |
+
{
|
190 |
+
"translated_message": "There is no water coming in the toilet."
|
191 |
+
}
|
192 |
+
```
|
193 |
+
|
194 |
+
---
|
195 |
+
|
196 |
+
### 4. Worker Job Recommendation
|
197 |
+
|
198 |
+
**Purpose:** Optimize job assignments to workers based on various factors.
|
199 |
+
|
200 |
+
**Model Design Pipeline:**
|
201 |
+
- Data Collection: Job requests, worker profiles, historical assignments.
|
202 |
+
- Data Preprocessing: Cleaning, feature engineering, encoding.
|
203 |
+
- Model Selection: Collaborative Filtering and Decision Trees.
|
204 |
+
|
205 |
+
**API Endpoint:** `https://archcoder-hostel-management-and-greivance-redres-2eeefad.hf.space/api/job-recommendation`
|
206 |
+
|
207 |
+
**Example Input:**
|
208 |
+
```json
|
209 |
+
{
|
210 |
+
"job_id": "J12346",
|
211 |
+
"type": "Electrical",
|
212 |
+
"description": "Fan not working in room 204.",
|
213 |
+
"urgency_level": "High",
|
214 |
+
"submission_timestamp": "2023-10-02T08:15:00Z",
|
215 |
+
"hostel_name": "Hostel A",
|
216 |
+
"floor_number": 2,
|
217 |
+
"room_number": "204"
|
218 |
+
}
|
219 |
+
```
|
220 |
+
|
221 |
+
**Example Output:**
|
222 |
+
```json
|
223 |
+
{
|
224 |
+
"job_id": "J12346",
|
225 |
+
"assigned_worker_id": "W67890",
|
226 |
+
"current_timestamp": "2023-10-02T08:30:00Z",
|
227 |
+
"expected_resolution_time": "2023-10-02T10:00:00Z",
|
228 |
+
"location": {
|
229 |
+
"hostel_name": "Hostel A",
|
230 |
+
"floor_number": 2,
|
231 |
+
"room_number": "210"
|
232 |
+
}
|
233 |
+
}
|
234 |
+
```
|
235 |
+
|
236 |
+
---
|
237 |
+
|
238 |
+
# Directory Structure
|
239 |
+
|
240 |
+
```
|
241 |
+
π config
|
242 |
+
π __init__.py
|
243 |
+
π config.py
|
244 |
+
π docs
|
245 |
+
π README.md
|
246 |
+
π ai_plan.md
|
247 |
+
π data_plan.md
|
248 |
+
π plan.md
|
249 |
+
π models
|
250 |
+
π intelligent_routing
|
251 |
+
π saved_model
|
252 |
+
π model.keras
|
253 |
+
π test_data
|
254 |
+
π __init__.py
|
255 |
+
π test_data.json
|
256 |
+
π test_results
|
257 |
+
π confusion_matrix.png
|
258 |
+
π roc_curve.png
|
259 |
+
π test_report.json
|
260 |
+
π train_data
|
261 |
+
π __init__.py
|
262 |
+
π training_data.json
|
263 |
+
π generate_data.py
|
264 |
+
π model.py
|
265 |
+
π test_model.py
|
266 |
+
π train.py
|
267 |
+
π job_recommendation
|
268 |
+
π saved_model
|
269 |
+
π model.keras
|
270 |
+
π test_data
|
271 |
+
π __init__.py
|
272 |
+
π test_data.json
|
273 |
+
π test_results
|
274 |
+
π test_report.json
|
275 |
+
π train_data
|
276 |
+
π __init__.py
|
277 |
+
π training_data.json
|
278 |
+
π generate_data.py
|
279 |
+
π model.py
|
280 |
+
π test.py
|
281 |
+
π train.py
|
282 |
+
π multilingual_translation
|
283 |
+
π test_data
|
284 |
+
π __init__.py
|
285 |
+
π test_data.json
|
286 |
+
π test_results
|
287 |
+
π test_report.json
|
288 |
+
π train_data
|
289 |
+
π __init__.py
|
290 |
+
π training_data.json
|
291 |
+
π model.py
|
292 |
+
π test_model.py
|
293 |
+
π sentiment_analysis
|
294 |
+
π test_data
|
295 |
+
π __init__.py
|
296 |
+
π test_data.json
|
297 |
+
π test_results
|
298 |
+
π test_report.json
|
299 |
+
π train_data
|
300 |
+
π __init__.py
|
301 |
+
π training_data.json
|
302 |
+
π model.py
|
303 |
+
π test_model.py
|
304 |
+
π test_results
|
305 |
+
π endpoint_test_results.json
|
306 |
+
π utils
|
307 |
+
π __init__.py
|
308 |
+
π logger.py
|
309 |
+
π .env
|
310 |
+
π .gitignore
|
311 |
+
π app.py
|
312 |
+
π readme.md
|
313 |
+
π requirements.txt
|
314 |
+
π routes.py
|
315 |
+
π test_endpoints.py
|
316 |
+
```
|
317 |
+
---
|
318 |
+
|
319 |
+
> To test the application, you can use the `test_endpoints.py` script, which provides a convenient way to verify the functionality of the API endpoints.
|
320 |
+
|
321 |
+
|
322 |
+
## Conclusion
|
323 |
+
|
324 |
+
Implementing these AI/ML functionalities will significantly enhance the efficiency and effectiveness of the Hostel Grievance Redressal System. By leveraging advanced technologies and integrating them within a Flask API framework, the system will provide a more responsive, empathetic, and proactive approach to managing resident grievances.
|
325 |
+
|
326 |
+
---
|
327 |
+
|
328 |
+
## License
|
329 |
+
|
330 |
+
This project is licensed under the [MIT License](LICENSE).
|
331 |
+
|
332 |
+
## Contact
|
333 |
+
|
334 |
+
For any questions or feedback, please contact [imt_2022089@iiitm.ac.in](mailto:imt_2022089@iiitm.ac.in).
|