ArchCoder's picture
Update README.md
9a21088 verified
metadata
title: Hostel Management System
emoji: 🏨
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
pinned: false

Hostel Grievance Redressal System

Overview

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.


Table of Contents

  1. System Architecture Overview
  2. AI/ML Functionalities
  3. Directory Structure
  4. Conclusion
  5. License
  6. Contact

System Architecture Overview

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.

Key Components

  1. Flask API Server

    • Central hub for all AI/ML models.
    • RESTful API design for standardized interactions.
    • Authentication and authorization mechanisms.
  2. Model Endpoints

    • /api/intelligent-routing - Endpoint for intelligent routing and workflow automation.
    • /api/sentiment-analysis - Endpoint for advanced sentiment and emotional intelligence analysis.
    • /api/multilingual-translation - Endpoint for multilingual translation in chatroom.
    • /api/job-recommendation - Endpoint for worker job recommendation.
  3. Data Handling and Validation

    • Input validation using libraries like pydantic or marshmallow.
  4. Scalability and Deployment

    • Docker for containerization.

AI/ML Functionalities

1. Intelligent Routing and Workflow Automation

Purpose: Efficiently assign grievances to the most suitable personnel or department based on various factors.

Model Design Pipeline:

  • Data Collection: Grievance data, staff data, historical assignments.
  • Data Preprocessing: Cleaning, feature engineering, encoding.
  • Model Selection: Reinforcement Learning (RL) and Multi-Criteria Decision-Making (MCDM).
  • Training and Evaluation: Define environment, implement reward functions, and evaluate using metrics like resolution time.

API Endpoint: https://archcoder-hostel-management-and-greivance-redres-2eeefad.hf.space/api/intelligent-routing

Example Input:

{
  "grievance_id": "G12346",
  "category": "electricity",
  "submission_timestamp": "2023-10-02T08:15:00Z",
  "student_room_no": "204",
  "hostel_name": "bh2",
  "floor_number": 2,
  "current_staff_status": [
    {
      "staff_id": "S67890",
      "department": "electricity",
      "current_workload": 3,
      "availability_status": "Available",
      "past_resolution_rate": 0.95
    },
    {
      "staff_id": "S67891",
      "department": "plumber",
      "current_workload": 2,
      "availability_status": "Available",
      "past_resolution_rate": 0.90
    }
  ],
  "floor_metrics": {
    "number_of_requests": 15,
    "total_delays": 1
  },
  "availability_data": {
    "staff_availability": [
      {
        "staff_id": "S67890",
        "time_slot": "08:00-12:00",
        "availability_status": "Available"
      }
    ],
    "student_availability": [
      {
        "student_id": "STU204",
        "time_slot": "08:00-10:00",
        "availability_status": "Unavailable"
      }
    ]
  }
}

Example Output:

{
  "job_id": "J12346",
  "assigned_worker_id": "W67890",
  "assignment_timestamp": "2023-10-02T08:16:00Z",
  "expected_resolution_time": "1 hour",
  "location": {
  "grievance_id": "G12346",
  "assigned_staff_id": "S67890",
  ...
}

2. Advanced Sentiment and Emotional Intelligence Analysis

Purpose: Detect complex emotional states in grievances to enhance responses from administrators.

Model Design Pipeline:

  • Data Collection: Grievance texts and emotional labels.
  • Data Preprocessing: Text cleaning, tokenization, and normalization.
  • Model Selection: Transformer-based models like BERT.

API Endpoint: https://archcoder-hostel-management-and-greivance-redres-2eeefad.hf.space/api/sentiment-analysis

Example Input:

{
  "grievance_id": "G12349",
  "text": "Why hasn't the maintenance team fixed the leaking roof yet?"
}

Example Output:

{
  "grievance_id": "G12349",
  "predicted_emotional_label": "Anger",
  ...
}

3. Multilingual Translation in Chatroom

Purpose: Facilitate communication between residents and workers who speak different languages.

Model Design Pipeline:

  • Data Collection: Multilingual conversation logs and translation pairs.
  • Data Preprocessing: Cleaning, tokenization, and alignment.
  • Model Selection: Neural Machine Translation (NMT) models.

API Endpoint: https://archcoder-hostel-management-and-greivance-redres-2eeefad.hf.space/api/multilingual-translation

Example Input:

{
  "user_message": "toilet me paani nahi aa rha hain",
  "source_language": "Hindi",
  "target_language": "English"
}

Example Output:

{
  "translated_message": "There is no water coming in the toilet."
}

4. Worker Job Recommendation

Purpose: Optimize job assignments to workers based on various factors.

Model Design Pipeline:

  • Data Collection: Job requests, worker profiles, historical assignments.
  • Data Preprocessing: Cleaning, feature engineering, encoding.
  • Model Selection: Collaborative Filtering and Decision Trees.

API Endpoint: https://archcoder-hostel-management-and-greivance-redres-2eeefad.hf.space/api/job-recommendation

Example Input:

{
  "job_id": "J12346",
  "type": "Electrical",
  "description": "Fan not working in room 204.",
  "urgency_level": "High",
  "submission_timestamp": "2023-10-02T08:15:00Z",
  "hostel_name": "Hostel A",
  "floor_number": 2,
  "room_number": "204"
}

Example Output:

{
  "job_id": "J12346",
  "assigned_worker_id": "W67890",
  "current_timestamp": "2023-10-02T08:30:00Z",
  "expected_resolution_time": "2023-10-02T10:00:00Z",
  "location": {
    "hostel_name": "Hostel A",
    "floor_number": 2,
    "room_number": "210"
  }
}

Directory Structure

πŸ“ config
  πŸ“„ __init__.py
  πŸ“„ config.py
πŸ“ docs
  πŸ“„ README.md
  πŸ“„ ai_plan.md
  πŸ“„ data_plan.md
  πŸ“„ plan.md
πŸ“ models
  πŸ“ intelligent_routing
    πŸ“ saved_model
      πŸ“„ model.keras
    πŸ“ test_data
      πŸ“„ __init__.py
      πŸ“„ test_data.json
    πŸ“ test_results
      πŸ“„ confusion_matrix.png
      πŸ“„ roc_curve.png
      πŸ“„ test_report.json
    πŸ“ train_data
      πŸ“„ __init__.py
      πŸ“„ training_data.json
    πŸ“„ generate_data.py
    πŸ“„ model.py
    πŸ“„ test_model.py
    πŸ“„ train.py
  πŸ“ job_recommendation
    πŸ“ saved_model
      πŸ“„ model.keras
    πŸ“ test_data
      πŸ“„ __init__.py
      πŸ“„ test_data.json
    πŸ“ test_results
      πŸ“„ test_report.json
    πŸ“ train_data
      πŸ“„ __init__.py
      πŸ“„ training_data.json
    πŸ“„ generate_data.py
    πŸ“„ model.py
    πŸ“„ test.py
    πŸ“„ train.py
  πŸ“ multilingual_translation
    πŸ“ test_data
      πŸ“„ __init__.py
      πŸ“„ test_data.json
    πŸ“ test_results
      πŸ“„ test_report.json
    πŸ“ train_data
      πŸ“„ __init__.py
      πŸ“„ training_data.json
    πŸ“„ model.py
    πŸ“„ test_model.py
  πŸ“ sentiment_analysis
    πŸ“ test_data
      πŸ“„ __init__.py
      πŸ“„ test_data.json
    πŸ“ test_results
      πŸ“„ test_report.json
    πŸ“ train_data
      πŸ“„ __init__.py
      πŸ“„ training_data.json
    πŸ“„ model.py
    πŸ“„ test_model.py
πŸ“ test_results
  πŸ“„ endpoint_test_results.json
πŸ“ utils
  πŸ“„ __init__.py
  πŸ“„ logger.py
πŸ“„ .env
πŸ“„ .gitignore
πŸ“„ app.py
πŸ“„ readme.md
πŸ“„ requirements.txt
πŸ“„ routes.py
πŸ“„ test_endpoints.py

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.

Conclusion

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.


License

This project is licensed under the MIT License.

Contact

For any questions or feedback, please contact [email protected].