Skip to content

Latest commit

 

History

History
84 lines (58 loc) · 1.76 KB

File metadata and controls

84 lines (58 loc) · 1.76 KB

🛠 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()