Text Sentiment Detector / Tone Analyzer
Analyze the emotional tone of your writing with this privacy-focused Sentiment Detector. Uses the AFINN-165 lexicon to score text positivity without external APIs.
About
This Text Sentiment Detector is a client-side analytical tool designed to evaluate the emotional tone of written content. Unlike cloud-based AI solutions that transmit your data to third-party servers, this tool processes everything locally within your browser using a weighted lexical database. It is particularly useful for copywriters, editors, and customer support managers who need to ensure their communication strikes the right balance between professional neutrality, enthusiastic positivity, or empathetic concern.
The tool operates by parsing input text against a predefined lexicon of over 3,000 words, each assigned a valence rating ranging from -5 (extremely negative) to +5 (extremely positive). This granular approach allows for the detection of subtle tonal shifts that binary 'happy/sad' classifiers often miss. It provides a raw cumulative score, a comparative density score, and a visual heatmap of the text to highlight specific emotional triggers.
Formulas
The sentiment calculation relies on a summation of valence integers normalized against the text length to determine density.
Where:
- Stotal = Total Sentiment Score
- w = Occurrences of the word
- v = Valence rating (-5 to +5)
- N = Total word count (excluding whitespace)
- Scomp = Comparative Score (Intensity)
A Comparative Score usually ranges between -1.0 and 1.0. A score above 0.05 is generally considered positive, while a score below -0.05 is considered negative. Scores between those bounds represent neutral sentiment.
Reference Data
| Word | Valence Score | Contextual Meaning |
|---|---|---|
| Breathless | +5 | Extreme excitement or anticipation |
| Outstanding | +5 | Superior quality or performance |
| Win | +4 | Success, achievement |
| Glad | +3 | Moderate happiness |
| Chance | +2 | Opportunity, possibility |
| Fake | -3 | Deception, lack of authenticity |
| Disaster | -4 | Catastrophic failure |
| Catastrophic | -5 | Extreme negative impact |