Skip to content

Repository files navigation

🤖 AI Support Ticket Classification & Priority Prediction System

Python Flask Scikit-Learn NLP License

An industry-grade Machine Learning application that automatically classifies incoming customer support tickets into 11 distinct categories and predicts their priority (High, Medium, Low) to streamline enterprise helpdesk operations.

📌 Problem Statement

In large organizations, support agents spend countless hours manually triaging tickets. This causes bottlenecks, delayed responses to critical bugs, and SLA breaches. This project automates the triage process using Natural Language Processing (NLP) and Ensemble Machine Learning.

🚀 Features

  • Automated Categorization: Routes tickets into 11 departments (Billing, Tech Issue, Password Reset, etc.).
  • Priority Prediction: Automatically flags High-Urgency tickets for immediate escalation.
  • Smart SLAs: Recommends estimated response times and actionable next steps for human agents.
  • Live Dashboard: Real-time analytics, pie charts, and prediction history.
  • Dark Mode UI: Beautiful, premium glassmorphism interface built with Bootstrap 5.
  • REST API: Includes a JSON endpoint (/api/predict) for integration with mobile apps or other microservices.

🧠 Architecture

  1. Data Engineering: Synthetic generation of realistic support tickets using Faker.
  2. Text Preprocessing: Tokenization, Stopword Removal, Regex cleaning, and Lemmatization via NLTK.
  3. Feature Extraction: Term Frequency-Inverse Document Frequency (TF-IDF).
  4. Model Selection: Automated benchmarking of Logistic Regression, SVM, Naive Bayes, Decision Trees, Random Forest, and Gradient Boosting.
  5. Deployment: Flask WSGI application serving a Jinja2 HTML frontend.

📂 Folder Structure

SupportTicketClassifier/
├── dataset/
│   ├── generate_dataset.py
│   └── support_tickets.csv
├── notebooks/
│   └── eda.py
├── models/
│   ├── best_category_model.joblib
│   └── tfidf_vectorizer.joblib
├── static/
│   ├── css/style.css
│   └── js/main.js
├── templates/
│   ├── base.html
│   ├── index.html
│   ├── result.html
│   └── dashboard.html
├── app.py
├── predict.py
├── preprocess.py
├── train.py
├── requirements.txt
└── README.md

🛠️ Installation & Usage

  1. Clone the repository:

    git clone https://github.com/yourusername/SupportTicketClassifier.git
    cd SupportTicketClassifier
  2. Install dependencies:

    pip install -r requirements.txt
  3. Generate Data & Train Models:

    python dataset/generate_dataset.py
    python preprocess.py
    python train.py
  4. Run the Application:

    python app.py

    Navigate to http://127.0.0.1:5000 in your browser.

☁️ Deployment Guide

Deploying to Render

  1. Create a Render account and connect your GitHub.
  2. Select New Web Service.
  3. Build Command: pip install -r requirements.txt
  4. Start Command: gunicorn app:app
  5. Click Deploy.

Deploying to Railway or PythonAnywhere

  • Follow standard Python WSGI deployment steps using the provided requirements.txt and gunicorn.

🔮 Future Scope

  • Deep Learning: Upgrade TF-IDF to a transformer-based model like BERT or RoBERTa.
  • Multilingual Support: Implement translation APIs to handle tickets in Spanish, French, etc.
  • Database Integration: Migrate prediction_history.json to PostgreSQL.

🤝 Contributors

  • Built by [Your Name]

📜 License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages