Skip to content

storytellingengineer/LLM_Classification_using_chatbot_conversation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chatbot Conversation Classifier

This project implements an LLM-based classifier that analyzes chatbot conversations to determine sentiment and context. It provides a FastAPI-based REST API for easy integration.

Features

  • Sentiment analysis of chatbot conversations
  • Context classification
  • REST API endpoints for classification
  • Docker support for easy deployment
  • FastAPI for high-performance API serving

Project Structure

.
├── app/
│   ├── __init__.py
│   ├── main.py
│   ├── models.py
│   ├── classifier.py
│   └── utils.py
├── tests/
│   └── test_classifier.py
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── README.md

Installation

  1. Clone the repository:
git clone <repository-url>
cd chatbot-conversation-classifier
  1. Install dependencies:
pip install -r requirements.txt
  1. Run with Docker:
docker-compose up --build

API Usage

The API provides the following endpoints:

POST /classify

Classifies a chatbot conversation based on sentiment and context.

Request body:

{
    "conversation": [
        {"role": "user", "content": "Hello, how are you?"},
        {"role": "assistant", "content": "I'm doing well, thank you!"}
    ]
}

Response:

{
    "sentiment": "positive",
    "context": "greeting",
    "confidence_score": 0.95
}

Development

  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install development dependencies:
pip install -r requirements.txt
  1. Run tests:
pytest tests/

License

MIT License

About

This project implements an LLM-based classifier that analyzes chatbot conversations to determine sentiment and context.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published