Skip to content

πŸ“Š PoC ML project using scikit-learn to classify support tickets by intent, as a service

Notifications You must be signed in to change notification settings

kajoban/SupportTicketClassifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›  Support Ticket Classifier

A simple scikit-learn + FastAPI + MongoDB + Docker project that classifies support tickets by intent.
Built as a learning project for ML + backend integration.

⚑ Quickstart

Tip

For more comprehensive steps, go to Setup

cd support-ticket-classifier && docker compose up --build

πŸš€ Features

  • FastAPI API with /predict endpoint
  • Uses a scikit-learn model
    • Provides script to generate synthetic data
    • Provides script to train model locally
  • Logs predictions to MongoDB (for potential retraining)
  • Dockerized for easy startup

πŸ“ Prerequisites

Before running the project, make sure you have:

  1. Docker
  2. Optional: mongosh installed locally if you want to inspect the db.

⚑ Setup

  1. Clone the repo:
git clone https://github.com/kajoban/support-ticket-classifier.git
cd support-ticket-classifier
  1. Build and start services
docker compose up --build

This will spin up

  • MongoDB (container: mongo)
  • FastAPI server (container: support-ticket-classifier-api)

The API will be available at http://127.0.0.1:8000.

Tip

The API docs will be available at http://127.0.0.1:8000/docs

  1. Make predictions using /predict endpoint.

Example cURL:

curl -X POST "http://127.0.0.1:8000/predict" \
  -H "Content-Type: application/json" \
  -d '{"text": "I can’t log into my account"}'

Possible response:

{
  "intent": "login_issue",
  "certainty": 0.87
}

Where certainty is a float between 0 and 1 representing the model's confidence in the predicted intent.

  1. Inspecting stored predictions

Predictions are stored to mongodb:

mongosh mongodb://localhost:27017
use support_ticket_classifier
db.predictions.find().pretty()

About

πŸ“Š PoC ML project using scikit-learn to classify support tickets by intent, as a service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published