<aside>
An AI-powered support ticket prioritization system that automatically classifies customer support tickets into priority levels using advanced sentiment analysis and keyword detection.
🌟 Features
🎯 Priority Levels
🚀 Quick Start
Prerequisites
Installation
git clone <https://github.com/yourusername/ticket-prioritization-api.git>
cd ticket-prioritization-api
python -m venv venv
# Windows
venv\\Scripts\\activate
# macOS/Linux
source venv/bin/activate
pip install -r requirements.txt
Running the Application
python main.py
API will be available at: http://localhost:8000 Interactive docs: http://localhost:8000/docs
streamlit run app.py
Web app will be available at: http://localhost:8501
📖 Usage Examples
API Endpoint
import requests
payload = {
"ticket_id": "TKT-001",
"text": "URGENT! Production database is down and customers are affected!",
"customer_tier": "enterprise"
}
response = requests.post("<http://localhost:8000/classify-ticket>", json=payload)
result = response.json()
print(f"Priority: {result['priority']}")
print(f"Score: {result['final_score']:.1%}")
Web Interface
🧠 Technical Architecture
Core Components
Scoring Algorithm
Final Score = (Sentiment × 0.35) + (Keywords × 0.45) + (Tier × 0.20)
Where:
- Sentiment: 0-1 based on negative sentiment confidence
- Keywords: 0-1 based on critical/high priority keywords detected
- Tier: Customer tier multiplier (Standard: 1.0, Premium: 1.15, Enterprise: 1.3)
Project Structure
ticket-prioritization-api/
├── main.py # FastAPI application
├── app.py # Streamlit web interface
├── utils.py # Classification logic
├── config.py # Keywords and configuration
├── requirements.txt # Dependencies
└── README.md # This file
🔧 Configuration
Adding Keywords
Edit config.py to add new keywords:
CRITICAL_KEYWORDS = [
"urgent", "critical", "emergency", "down", "hack",
# Add your keywords here
]
Adjusting Scoring Weights
Modify weights in config.py:
WEIGHTS = {
"sentiment": 0.35, # Sentiment analysis weight
"keywords": 0.45, # Keyword detection weight
"customer_tier": 0.20 # Customer tier weight
}
📊 Performance
🛠️ Built With
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)

View GitHub Repository: