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.
- Sentiment analysis of chatbot conversations
- Context classification
- REST API endpoints for classification
- Docker support for easy deployment
- FastAPI for high-performance API serving
.
├── app/
│ ├── __init__.py
│ ├── main.py
│ ├── models.py
│ ├── classifier.py
│ └── utils.py
├── tests/
│ └── test_classifier.py
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── README.md
- Clone the repository:
git clone <repository-url>
cd chatbot-conversation-classifier
- Install dependencies:
pip install -r requirements.txt
- Run with Docker:
docker-compose up --build
The API provides the following endpoints:
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
}
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install development dependencies:
pip install -r requirements.txt
- Run tests:
pytest tests/
MIT License