Home
Softono
Intent-classifier-model

Intent-classifier-model

Open source Python
55
Stars
163
Forks
4
Issues
0
Watchers
6 months
Last Commit

About Intent-classifier-model

Intent-classifier-model is a lightweight machine learning tool designed to categorize short customer support text into specific intents such as greeting, question, complaint, praise, or other. The project demonstrates the end-to-end workflow of training a small text classification model, serializing the model artifact to disk, and deploying it as a production-ready service. Users can set up a local virtual environment, install dependencies, and execute the training script to generate the model file. The software includes a Flask-based API server that exposes a predict endpoint for real-time inference. Developers can send JSON payloads containing customer messages via HTTP POST requests to receive the predicted intent class along with confidence probabilities for each category. This solution is ideal for integrating automated intent detection into chatbots, helpdesk systems, or automated routing pipelines without requiring heavy computational resources.

Platforms

Web Self-hosted

Languages

Python

Links

Intent Classifier Model

This small project demonstrates:

  • Training a tiny text classifier.
  • Saving the model artifact.
  • Serving predictions via a Flask API (/predict).

Quick start (local)

  1. Create a virtualenv and install: python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt

  2. Train the model: python model/train.py This will create model/artifacts/intent_model.pkl.

  3. Run the API: python app.py The API will be available at http://127.0.0.1:6000

  4. Example request: curl -X POST http://127.0.0.1:6000/predict -H "Content-Type: application/json" -d '{"text":"I want to cancel my subscription"}'

    Response: { "intent": "complaint", "probabilities": {"complaint": 0.85, "question": 0.05, ...} }