Sentiment analytics are model-assisted indicators, not audited customer satisfaction scores.
Model
Kommander sentiment uses the npm sentiment lexicon model through backend/lib/sentimentAnalysis.ts. The service analyzes only user-authored text in each conversation, then assigns:
| Field | Definition |
|---|---|
score | Raw lexicon score from the sentiment package. |
comparative | Score normalized by token count. |
label | positive when score is above 0, negative when below 0, otherwise neutral. |
confidence | abs(comparative) * 100, capped at 100. |
The sentiment endpoint reads recent conversations from /api/analytics/sentiment, defaults to the last seven days, and analyzes up to limit=100 conversations unless another limit is supplied.
Satisfaction Score
Sentiment satisfaction is a heuristic score from 0 to 100:
| Adjustment | Effect |
|---|---|
| Baseline | Starts at 50. |
| Positive sentiment | Adds up to 30, based on confidence. |
| Negative sentiment | Subtracts up to 30, based on confidence. |
| More than 10 messages | Subtracts 5 because long threads can indicate friction or complexity. |
| Fewer than 3 messages | Adds 5 for short interactions. |
Last user message includes thank, perfect, or solved | Adds 15. |
Last user message includes not helpful, still, or doesn't work | Subtracts 15. |
The overview average satisfaction is the rounded mean of conversation satisfaction scores in the analyzed set.
Interpretation Guide
Use sentiment to prioritize review, not to grade individual operators in isolation.
| Signal | Interpretation | Recommended action |
|---|---|---|
| Positive label with high confidence | The user used clearly positive words. | Sample for successful answer patterns and reusable knowledge. |
| Neutral label | The user did not use enough positive or negative language for a directional label. | Interpret alongside response time, ratings, message count, and whether the issue was resolved. |
| Negative label with high confidence | The user used clearly negative, urgent, or frustrated language. | Review quickly, check whether a handoff occurred, and update escalation or knowledge-base coverage when needed. |
| Low satisfaction score | The heuristic found negative sentiment, long thread length, unresolved language, or a combination of those signals. | Use as a queue review trigger; read the transcript before making coaching or product decisions. |
| Sentiment improving over time | Later conversations or categories show fewer negative labels. | Confirm with concrete metrics such as ratings, source usage, and response time. |
| Sentiment worsening over time | Negative labels or complaint categories are increasing. | Inspect topic clusters, recent launches, outage periods, and operator handoff delays. |
For handoff operations, treat strong negative sentiment, payment disputes, cancellation intent, legal threats, safety concerns, privacy issues, and repeated failed answers as review triggers even when the numeric confidence is not high.
Topics And Categories
The sentiment service also adds rule-based topics and categories:
| Output | Rules |
|---|---|
| Topics | Keyword buckets for payment, technical, feature, account, integration, and performance; falls back to general. |
| Categories | Rules for compliments, technical support, billing questions, feature requests, complaints, and general info; falls back to general_info. |
Accuracy Notes
The current implementation does not use a fine-tuned classifier or a measured validation set, so there is no production accuracy percentage to report. Treat labels and satisfaction as directional indicators.
Accuracy is highest when users write explicit positive or negative language in English. It is lower for sarcasm, short messages, mixed-language threads, domain-specific wording, and conversations where sentiment changes during the thread.
For reporting, use sentiment trends alongside concrete operational metrics such as response time, ratings, source usage, and conversation volume.