Skip to content

Latest commit

Β 

History

History
155 lines (104 loc) Β· 3.64 KB

File metadata and controls

155 lines (104 loc) Β· 3.64 KB

πŸ› οΈ AI-Powered Support Ticket Classifier

A complete machine learning pipeline that classifies customer support tickets by issue type and urgency level, and extracts critical entities like product names, complaint keywords, and dates β€” all accessible through a sleek Gradio web interface.


πŸ“Œ Project Overview

Customer support teams handle thousands of tickets daily. Manually classifying and extracting key information from these tickets is time-consuming and error-prone. This project automates:

  • πŸ” Ticket Classification: Predicts issue_type and urgency_level.

  • 🧠 Entity Extraction: Extracts key entities such as product names, complaint keywords, and dates.

  • 🌐 Gradio Interface: Allows end users to interactively classify tickets in a user-friendly UI.


πŸš€ Features

  • Data Cleaning & Preprocessing (lowercasing, lemmatization, stopwords removal)

  • TF-IDF & Feature Engineering (ticket length, sentiment scores)

  • Multi-Task Classification using Logistic Regression, SVM, and Random Forest

  • Entity Extraction using rule-based NLP (product names, dates, complaint terms)

  • Saved Models for inference reuse

  • Gradio Frontend for real-time predictions


πŸ“ Project Structure

πŸ“¦ ai_based_complaint_classifier
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ ai_dev_assignment_tickets_complex_1000.xlsx
β”‚   └── cleaned_tickets.xlsx
β”‚ 
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ issue_type_model.pkl
β”‚   β”œβ”€β”€ urgency_level_model.pkl
β”‚   β”œβ”€β”€ tfidf_vectorizer.pkl
β”‚   └── feature_scaler.pkl
β”‚ 
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ data_preprocessing.py
β”‚   β”œβ”€β”€ feature_engineering.py
β”‚   β”œβ”€β”€ model_training.py
β”‚   β”œβ”€β”€ entity_extraction.py
β”‚   └── predict_ticket.py
β”‚ 
β”œβ”€β”€ app/
β”‚   └── app.py
β”‚ 
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
β”œβ”€β”€ requirements.txt
└── README.md

πŸ“¦ Installation

1. Clone the repository:

git clone https://github.com/yashdew3/AI_Based-Complaint-Classifier.git
cd ai_based_complaint_classifier

2. Install the dependencies:

pip install -r requirements.txt

3. Run the Gradio App

cd src
python app.py

🧠 ML Models

  • Multi-class Classification

    • issue_type: Logistic Regression, SVM, Random Forest (best one selected)

    • urgency_level: Trained similarly

  • Entity Extraction

    • Regex + Keyword-based patterns for products, dates, and complaint terms

✨ Sample Input

Input:

"I received the EcoBreeze AC and it’s broken. Also, I ordered on April 5th."

Output:

{
  "issue_type": "Product Defect",
  "urgency_level": "High",
  "extracted_entities":
  {
    "products": ["EcoBreeze AC"],
    "dates": ["April 5th"],
    "complaint_keywords": ["broken"]
  }
}

πŸ“š Dependencies

  • pandas, numpy, nltk, scikit-learn, textblob

  • gradio for UI


πŸ“Œ Future Improvements

  • Integrate deep learning models (e.g., BERT)

  • Use Named Entity Recognition (NER) with spaCy or transformers

  • Support multilingual ticket classification

  • Database/API backend for enterprise usage


🀝 Contributing

Contributions are welcome! Please open an issue or submit a PR for enhancements or fixes. Feel free to check the issues page (if you have one) or open a new issue to discuss changes. Pull requests are also appreciated.


πŸ§‘β€πŸ’» Author