Overview
SENTi-radar uses a combination of keyword-based emotion detection, statistical analysis, and AI-powered summarization to provide real-time sentiment insights. This guide explains the algorithms and formulas behind each metric.Emotion Detection System
How It Works
SENTi-radar analyzes text from all sources (X posts, Reddit comments, YouTube comments, news headlines) using a keyword lexicon scoring system. The implementation can be found inTopicDetail.tsx:146-167.
The Six Core Emotions
Based on Ekman’s universal emotions framework:Fear (35% avg in crisis topics)
Fear (35% avg in crisis topics)
Keywords: fear, scared, worried, panic, threat, risk, dangerous, crisis, collapse, shortage, anxiety, alarm, uncertainty, instability, warn, catastroph, turmoil, chaos, tension, war, nuclear, invasion, missile, attack, afraid, terrifying, dread, horrified, alarmingColor: Orange (
bg-fear)Common in: Geopolitical conflicts, health crises, economic uncertainty, supply chain disruptionsAnger (48% avg in crisis topics)
Anger (48% avg in crisis topics)
Keywords: anger, angry, outrage, furious, rage, frustrat, unacceptable, scandal, corrupt, condemn, protest, exploit, injustice, blame, backlash, fury, demand, ban, oppose, ridiculous, pathetic, disgusting, shameful, hate, upset, terrible, horrible, awful, liarColor: Red (
bg-anger)Common in: Policy debates, corporate scandals, social justice issues, price inflation topicsSadness (25% avg in negative topics)
Sadness (25% avg in negative topics)
Keywords: sad, disappoint, tragic, loss, suffer, grief, regret, devastat, despair, victim, casualt, death, pain, mourn, unfortunate, heartbreak, sorrow, crying, tears, sorry, depressing, hopelessColor: Blue (
bg-sadness)Common in: Climate discussions, humanitarian crises, personal finance struggles, loss eventsJoy (45% avg in positive topics)
Joy (45% avg in positive topics)
Keywords: happy, excited, great, amazing, love, excellent, fantastic, celebrate, breakthrough, success, innovation, optimis, hopeful, launch, growth, improve, wonderful, awesome, congratulations, proud, thrilled, wow, incredible, blessed, thank, gladColor: Green (
bg-joy)Common in: Product launches, tech breakthroughs, positive news, achievement announcementsSurprise (25% avg in mixed topics)
Surprise (25% avg in mixed topics)
Keywords: shocking, unexpected, unbelievable, stunning, incredible, reveal, bombshell, breaking, unprecedented, remarkable, wtf, omg, cant believe, seriously, really, whoa, wait whatColor: Yellow (
bg-surprise)Common in: Breaking news, unexpected announcements, viral moments, plot twistsDisgust (10% avg in scandal topics)
Disgust (10% avg in scandal topics)
Keywords: disgust, appalling, horrible, corrupt, toxic, vile, sickening, revolting, gross, nauseating, shameful, pathetic, ridiculuousColor: Purple (
bg-disgust)Common in: Corruption scandals, unethical behavior, food safety issues, abuse revelationsScoring Algorithm
- Case-insensitive matching
- Partial word matches (e.g., “frustrat” matches “frustrated”, “frustrating”)
- Multiple occurrences count multiple times
- Results always sum to exactly 100%
- Emotions sorted by dominance (highest percentage first)
Sentiment Classification
Three Sentiment States
SENTi-radar classifies overall sentiment into three categories:- Positive
- Negative
- Mixed
Criteria: Positive keyword count > negative keyword count × 1.3Positive Keywords (from
TopicDetail.tsx:264):- launch, success, growth, celebrate, innovation
- deal, partnership, breakthrough, improve
- great, amazing, wonderful, fantastic
- Joy: 40-50%
- Surprise: 20-30%
- Low anger/fear/sadness
Sentiment Calculation Code
The 1.3x multiplier prevents minor differences from triggering a sentiment classification. A clear dominance is required.
Crisis Level Detection
SENTi-radar automatically detects crisis situations based on negative keyword frequency.The Four Crisis Levels
| Level | Criteria | Negative Keyword Count | Visual Indicator | Typical Response |
|---|---|---|---|---|
| None | Low concern | 0-1 keywords | 🔵 Blue | Monitor normally |
| Medium | Elevated concern | 2-3 keywords | 🟡 Yellow | Watch closely |
| High | Crisis risk | 4+ keywords | 🔴 Red | Immediate attention |
Crisis Detection Code
Crisis Alerts
When crisis level is medium or high, SENTi-radar displays real-time alerts: High Crisis Alerts:- 🔴 Negative spike detected
- Pulsing red indicator
- Shows dominant negative emotion
- Timestamp: “Just now”
- 🟡 Sentiment Shift
- Amber indicator
- “Sudden increase in conversation volume”
- Timestamp: “30 min ago”
Volatility Score
What It Measures
Volatility indicates how rapidly conversation volume is changing. High volatility suggests:- Breaking news or viral moments
- Rapid sentiment shifts
- Potential crisis escalation
- High public attention
Score Range
- 0-40: Low volatility (stable conversation)
- 41-70: Moderate volatility (growing interest)
- 71-100: High volatility (rapid acceleration, potential crisis)
Visual Representation
The volatility widget shows:- 20-bar sparkline chart with random heights (simulating volume spikes)
- Risk label: “High” (volatility >70) or “Moderate” (≤70)
- Numerical score: “Volatility at X/100”
Volume & Change Metrics
Total Mentions Volume
Displayed in abbreviated format:284500→284.5K1200000→1.2M531000→531.0K
Hourly Change Percentage
Shows conversation growth/decline in the last hour:- Positive change (e.g.,
+42%): 🔼 Green, trending up arrow - Negative change (e.g.,
-15%): 🔽 Red, trending down arrow
Change percentage is calculated against the previous 1-hour window, not the absolute baseline.
Theme Detection
SENTi-radar automatically categorizes topics into 7 thematic areas:The Seven Themes
Geopolitical
Geopolitical
Keywords: war, tension, conflict, iran, israel, russia, ukraine, china, nato, missile, nuclear, sanction, military, attack, defense, border, invasion, ceasefire, diplomacy, treaty, army, troopsKey Takeaway Templates:
- Escalation fears are driving market volatility
- Diplomatic channels remain under pressure
- Defense and security discussions dominate
- Economic ripple effects are a major worry
- International community response is being closely watched
Energy
Energy
Keywords: oil, gas, fuel, energy, opec, crude, petroleum, shortage, reserve, pipeline, refinery, barrel, lng, solar, renewable, lpg, petrol, dieselKey Takeaway Templates:
- Fuel price hikes are the #1 concern
- Energy security is being questioned
- Calls for strategic reserve deployment are intensifying
- Industry impact is significant
- Government policy response is under heavy public scrutiny
Policy
Policy
Keywords: guideline, regulation, law, policy, government, ministry, ugc, nep, bill, act, reform, amendment, mandate, compliance, rule, directive, framework, education, university, collegeKey Takeaway Templates:
- Stakeholders are divided
- Implementation timeline and enforcement are major debate points
- Affected communities are mobilizing
- Legal challenges and constitutional questions are being raised
- Comparative analysis with international standards shows gaps and improvements
Tech
Tech
Keywords: phone, galaxy, iphone, laptop, app, software, ai, robot, chip, launch, release, samsung, apple, google, tesla, nvidia, startup, feature, update, device, processor, gpuKey Takeaway Templates:
- Early adopters are buzzing
- Comparisons with competitors are driving heated debates
- Innovation claims are being scrutinized
- Pricing strategy is polarizing
- Supply chain and availability concerns are building
Economic
Economic
Keywords: market, stock, inflation, recession, economy, gdp, trade, tariff, unemployment, interest, rate, bank, fiscal, budget, debt, investment, growth, crash, rupee, dollarKey Takeaway Templates:
- Market sentiment is fragile
- Inflation concerns are hitting household budgets
- Central bank policy decisions are being analyzed
- Employment outlook is uncertain
- Global trade dynamics are shifting
Health
Health
Keywords: health, covid, vaccine, hospital, disease, epidemic, pandemic, medical, drug, treatment, doctor, patient, mental, who, outbreak, virusKey Takeaway Templates:
- Public health preparedness is being questioned
- Healthcare accessibility is a key concern
- Trust in health institutions is being tested
- Preventive measures and personal health awareness are trending
- Policy response speed and transparency are under intense scrutiny
Social
Social
Theme Selection Algorithm
Data Source Attribution
SENTi-radar displays which sources contributed to the analysis:| Source Combination | Display Label |
|---|---|
| X + Reddit + YouTube + News | X · Reddit · YouTube · News |
| X + Reddit | X · Reddit |
| X + News | X · News |
| Reddit + News | Reddit · News |
| YouTube + News | YouTube · News |
| News only | News |
| None (fallback) | Keyword |
Confidence & Accuracy
Factors Affecting Accuracy
-
Sample Size: More texts = more accurate emotion distribution
- 10-30 texts: Low confidence
- 31-100 texts: Medium confidence
- 100+ texts: High confidence
-
Source Diversity: Multi-source data reduces platform bias
- Single source: Platform-specific echo chamber
- 2-3 sources: Balanced view
- 4 sources: Comprehensive sentiment picture
-
Keyword Coverage: More emotion keywords matched = higher confidence
- 0-5 keywords: Likely neutral/unclear
- 6-15 keywords: Clear sentiment pattern
- 16+ keywords: Very strong sentiment signal
When to Trust Metrics
✅ High Trust Scenarios:- 100+ texts analyzed from 3+ sources
- Clear emotion dominance (>40% for top emotion)
- Multiple crisis keywords detected
- Sentiment and emotion alignment (e.g., negative sentiment + anger/fear dominant)
- <30 texts analyzed
- Single source only (X or Reddit unavailable)
- Flat emotion distribution (all <20%)
- Sentiment/emotion mismatch (e.g., positive sentiment but anger dominant)
Related Resources
- Analyzing Topics - Step-by-step guide to running sentiment analysis
- Exporting Data - Export metrics data for external analysis
- Adding Data Sources - Configure API keys to improve accuracy