Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Complaint Category Classifier — AI/ML

An NLP-based machine learning model that automatically classifies customer complaints into predefined categories, enabling faster and more accurate complaint routing.

📋 Overview

Manual complaint sorting is slow and inconsistent. This project uses natural language processing to automatically categorize incoming complaints — helping route them to the right department faster and reducing manual workload.

✨ Features

  • Classifies complaints into 4 categories: Water, Electricity, Roads, Sanitation
  • TF-IDF vectorization + Naive Bayes classification model
  • FastAPI backend for serving predictions
  • Streamlit dashboard for an interactive user interface
  • Admin correction panel to fix misclassified complaints
  • Prediction history export for tracking and analysis

🛠️ Tech Stack

  • Language: Python
  • ML/NLP: scikit-learn (TF-IDF, Naive Bayes)
  • Backend: FastAPI
  • Frontend: Streamlit
  • Data handling: Pandas

🚀 How to Run

  1. Clone the repository

    git clone https://github.com/maha-434/complaint-classifier.git
    cd complaint-classifier
  2. Install dependencies

    pip install -r requirements.txt
  3. Train the model

    python train.py
  4. Run the FastAPI backend

    uvicorn app:app --reload
  5. Run the Streamlit dashboard (in a separate terminal)

    streamlit run dashboard.py

📂 Project Structure

complaint-classifier/
├── data.csv           # Labeled complaint dataset
├── train.py            # Model training script
├── app.py               # FastAPI backend
├── dashboard.py    # Streamlit frontend
└── requirements.txt

📈 Future Improvements

  • Expand dataset for improved model accuracy
  • Add train/test split with evaluation metrics
  • Support for additional complaint categories
  • Multi-language complaint support

👤 Author

Mahalakshmi M
LinkedIn · GitHub

About

NLP-based ML model that classifies customer complaints into categories (Water, Electricity, Roads, Sanitation) using TF-IDF and Naive Bayes, deployed with FastAPI and Streamlit.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages