SENTIMENT & URGENCY DETECTOR
๐ง AI-Powered Customer Support Ticket Intelligence System
Sentiment & Urgency Detector is an AI-based system that analyzes customer support tickets to automatically detect Sentiment, Urgency, and Churn Risk using Large Language Models (OpenAI + Hugging Face) and triggers real-time alerts through Discord for critical issues.
| Field | Details |
|---|---|
| ๐ข Organization | Infinity Computer Solutions |
| ๐ Category | Service Desk |
| ๐ฅ Team Number | Team 8 |
| ๐ UC ID | UC-4 |
| ๐ Project Title | Sentiment & Urgency Detector |
| ๐ง Domain | AI / LLM-Based Automation System |
| ๐ Type | Placement Drive Submission |
| Name | Role |
|---|---|
| Leela | Project Lead & System Design |
| Mohan | Backend Developer (FastAPI Integration) |
| Lalitha | AI/ML Engineer (OpenAI + Hugging Face) |
| Sunitha | Testing, Documentation & UI Support |
Customer support teams receive thousands of tickets daily. Many critical messages containing anger, urgency, frustration, or cancellation intent are often missed due to manual handling.
This results in:
- Delayed responses
- Poor customer satisfaction
- Increased customer churn
- Revenue loss
The system automatically: โ Detects sentiment of customer messages โ Calculates urgency level โ Identifies churn-risk behavior โ Generates AI-based explanations โ Sends real-time alerts via Discord
Organizations face difficulty in identifying high-priority tickets among large volumes of incoming customer requests.
Manual handling leads to:
- Slow response time
- Missed urgent complaints
- Inefficient escalation process
This project solves it using AI-driven automation and LLM intelligence.
๐ https://sentiment-and-urgency-detector-dqg64ccmtf28dul7pead9m.streamlit.app/
๐ฝ๏ธ https://drive.google.com/file/d/1l609UCGY_uJ-B57SB1o6_vdm3HbB9MO6/view?usp=sharing
- ๐ Sentiment Detection (Positive / Neutral / Negative)
- โก Urgency Scoring System
- ๐จ Churn Risk Prediction
- ๐ง Explainable AI Reasoning
- ๐ Confidence Score Generation
- Discord Webhook Alerts
- Real-time Ticket Analysis
- Automatic Escalation Trigger
- REST API (FastAPI)
- JSON Structured Output
- Streamlit UI Support
Customer Ticket Input
โ
โผ
LLM Processing Layer (OpenAI / Hugging Face)
โ
โโโ Sentiment Analysis
โโโ Urgency Detection
โโโ Churn Risk Analysis
โ
โผ
Risk Evaluation Engine
โ
High Risk?
โ
YES โผ
Discord Webhook Alert System
โ
Support Team Notification
- ๐ Python
- โก FastAPI
- ๐ค OpenAI API
- ๐ง Hugging Face Models
- ๐ Streamlit
- ๐ Discord Webhooks
- ๐ฆ JSON Processing
- ๐งฐ Git & GitHub
Sentiment-and-Urgency-detector/
โโโ app.py
โโโ requirements.txt
โโโ .env
โโโ backend/
โโโ ai_model/
โโโ utils/
โโโ alerts/
โโโ README.md
git clone https://github.com/konathalaleela2005-collab/Sentiment-and-Urgency-detector
cd Sentiment-and-Urgency-detectorpython -m venv venvvenv\Scripts\activatepip install -r requirements.txtOPENAI_API_KEY=your_api_key
DISCORD_WEBHOOK_URL=your_webhook_url
ALERT_THRESHOLD=0.75python app.pyOR
streamlit run app.py{
"ticket": "I am extremely disappointed. If this issue is not fixed today, I will cancel my subscription."
}{
"sentiment": "Negative",
"sentiment_score": 0.94,
"urgency_score": 0.91,
"churn_risk_score": 0.88,
"overall_risk": "High",
"flagged": true
}๐จ HIGH PRIORITY TICKET
Risk Level: HIGH Sentiment Score: 0.94 Urgency Score: 0.91 Churn Risk Score: 0.88
Reason:
- Negative emotional tone
- Immediate action required
- Customer may churn
โ Faster response to critical tickets โ Reduced customer churn โ Improved support efficiency โ Automated escalation system โ Better customer satisfaction
- Handling ambiguous customer tone
- Prompt optimization for LLM accuracy
- Reducing false positives
- Real-time webhook integration
- ๐ Multi-language support
- ๐ Analytics dashboard
- ๐ฉ Email/SMS alerts
- ๐ค Fine-tuned domain model
- ๐ Sentiment trend tracking
<title>Sentiment & Urgency Detector</title> <style> * { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
background-color: #f8f9fa;
color: #212529;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 20px;
}
.container {
width: 100%;
max-width: 700px;
background: #ffffff;
padding: 40px;
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
h1 {
font-size: 2rem;
font-weight: 700;
color: #1a1e21;
margin-bottom: 24px;
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
font-size: 0.85rem;
color: #6c757d;
margin-bottom: 8px;
font-weight: 500;
}
textarea {
width: 100%;
height: 120px;
padding: 16px;
border: 1px solid #dee2e6;
border-radius: 8px;
background-color: #e9ecef; /* Matching the muted blue-gray tone from the image */
font-family: inherit;
font-size: 1rem;
color: #495057;
resize: vertical;
outline: none;
transition: border-color 0.2s ease, background-color 0.2s ease;
}
textarea:focus {
background-color: #f1f3f5;
border-color: #ced4da;
}
button {
background-color: #f1f3f5;
color: #495057;
border: 1px solid #ced4da;
padding: 10px 24px;
font-size: 0.95rem;
border-radius: 20px; /* Rounded pill style matching the image */
cursor: pointer;
font-weight: 500;
transition: all 0.2s ease;
margin-bottom: 32px;
}
button:hover {
background-color: #e2e6ea;
border-color: #adb5bd;
}
.result-section {
border-top: 1px solid #e9ecef;
padding-top: 24px;
}
h2 {
font-size: 1.5rem;
font-weight: 600;
color: #212529;
margin-bottom: 16px;
}
.result-item {
font-size: 1rem;
margin-bottom: 12px;
color: #495057;
}
.result-value {
font-weight: 500;
color: #212529;
}
</style>
<div class="form-group">
<label for="complaintInput">Enter Customer Complaint</label>
<textarea id="complaintInput" placeholder="Type customer complaint here...">I am frustrated and nobody helped me</textarea>
</div>
<button onclick="analyzeSentiment()">Analyze</button>
<div class="result-section">
<h2>Result</h2>
<div class="result-item">
Sentiment: <span id="sentimentResult" class="result-value">Angry / Negative</span>
</div>
<div class="result-item">
Urgency: <span id="urgencyResult" class="result-value">High</span>
</div>
</div>
The Sentiment & Urgency Detector demonstrates how Artificial Intelligence can transform customer support systems by automatically prioritizing critical tickets and enabling faster decision-making through LLM-based automation.
๐ผ Built for Infinity Computer Solutions Placement Drive
๐ AI-Powered Customer Support Intelligence System