Glypse

Sentiment Analysis

How sentiment analysis turns written reactions into scores, with worked examples showing how social sentiment relates to market prices.

Reading a few comments about an announcement can tell you what people are praising or criticizing. Gauging the overall reaction is harder, especially when the discussion spans thousands of posts and keeps changing. Sentiment analysis summarizes those reactions in counts and scores, helping you understand how people are responding across the wider discussion.

Those numbers let you compare the initial response with what people are saying a week later. If the discussion has become more positive, the counts can show whether praise has grown or criticism has faded. Reading the posts alongside the score helps explain what people are reacting to and why their responses have changed.

What is sentiment analysis?

Sentiment analysis identifies whether a piece of text expresses a positive, negative, or neutral tone. It is a task within natural language processing (NLP), the field concerned with computers processing human language, and can use rules or machine learning. Applied to many posts, reviews, or survey responses, it shows how often each kind of reaction appears and how that balance changes. You may also see it called opinion mining.

These sentiment analysis examples use comments about a football club's new signing:

CommentSentimentWhat the wording expresses
"Excellent signing. He'll make our midfield much stronger."PositiveApproval and optimism.
"Terrible signing. We already have three players in that position."NegativeDisapproval.
"The club announced the signing this morning."NeutralInformation without an explicit evaluation.

Counting those labels across a week's discussion could show whether the announcement attracted more praise or criticism. The comments give the reasons, such as the player's ability, the transfer fee, or the club's plans. An analyst following a company can use the same approach to find which parts of an earnings announcement drew criticism.

Among six hypothetical comments about a football club's new signing, three are labeled positive, one negative, and two neutral. Counting only the four positive and negative comments gives net sentiment of +50.

What are the types of sentiment analysis?

The main types are polarity analysis, aspect-based sentiment analysis, and fine-grained sentiment analysis. They differ in whether they assign an overall tone, separate opinions about features, or distinguish degrees of feeling.

Polarity means whether text is positive, negative, or neutral. A tool can assign sentiment polarity to a whole post or to each sentence within it:

ApproachWhat it measuresExample of the result
Polarity for a whole postOne overall positive, neutral, or negative label.A match review gets one label even if it praises the attack and criticizes the defense.
Polarity for each sentenceA separate label for each sentence."Our attack was excellent. The defending was awful." gets a positive label for the first sentence and a negative one for the second.
Aspect-based sentiment analysisThe evaluation of a particular feature or part of a subject.Praise for the team's attack and criticism of its defense are assigned to those parts of its performance.
Fine-grained sentiment analysisMore levels of positive and negative sentiment.A five-label scheme separates positive from very positive.

Aspect-based analysis keeps each judgment attached to the feature it concerns. In "Great attack, awful defending," both evaluations appear in one sentence. An aspect-based result separates the positive judgment about the attack from the negative judgment about the defense.

In this hypothetical comparison, polarity analysis labels "Great attack, awful defending" negative overall, while aspect-based analysis labels the attack positive and the defending negative. Fine-grained analysis chooses negative from five levels, separating it from very negative.

Some services also use a mixed label. Microsoft's sentiment service labels a document mixed when it contains both positive and negative sentences. Neutral can instead mark an absence of expressed evaluation. A three-label system assigns one positive, neutral, or negative label even when the text contains praise and criticism.

Emotion analysis is a related task that names feelings such as joy or anger. Anger and sadness can both accompany negative sentiment while describing different reactions. Emotion Classification explores that distinction.

How does sentiment analysis work?

Sentiment analysis works by interpreting words together with their context. A system needs to recognize that "bad signing" expresses criticism and that adding "not a" changes the judgment. It assigns positive, negative, or neutral labels through word lists and rules, patterns learned from labeled examples, or instructions given to a language model.

A rule-based method starts with a lexicon, which is a list of words with sentiment values. It combines those values and adjusts for features such as negation and emphasis. VADER sentiment analysis uses this approach for social text. Its examples show how "not bad at all" receives a positive result even though it contains the word "bad."

The word "bad" makes "Bad signing" negative in a rule-based analysis. Adding "not a" activates a negation rule that reverses the word's contribution, giving "Not a bad signing" a positive label.

A trained sentiment classifier learns from texts paired with sentiment labels. With a collection of labeled movie reviews, for example, it can learn which words and combinations appear more often in positive reviews. It then uses those patterns to classify a review it has not encountered before.

Can ChatGPT or Claude do sentiment analysis?

ChatGPT or Claude can classify supplied text from written instructions. In this form of AI sentiment analysis, a large language model (LLM) receives definitions of the labels and examples of how to apply them. An instruction might ask for the tone of a whole message or the opinion it expresses about a named subject. Those are different questions even when the input text is identical.

LLM sentiment analysis has also been tested against specialized classifiers. In Wang and colleagues' study of ChatGPT, it performed comparably to BERT, a model trained on labeled examples for the task, even without examples in its prompt. The strongest models trained for the particular subject area performed better.

How is a sentiment score calculated?

For a collection of posts, a net sentiment score measures the balance of positive and negative labels. One version subtracts the negative post count from the positive count, divides by their sum, and multiplies by 100. That gives a score from -100 to +100, with neutral posts excluded.

The formula is:

Net sentiment=Positive posts−Negative postsPositive posts+Negative posts×100\text{Net sentiment} = \frac{\text{Positive posts} - \text{Negative posts}}{\text{Positive posts} + \text{Negative posts}} \times 100

Suppose a query matches 1,000 posts about a company, with these hypothetical labels:

LabelNumber of postsShare of all posts
Positive707%
Negative303%
Neutral90090%

Subtracting 30 from 70 gives 40. Dividing that by the 100 positive or negative posts, then multiplying by 100, produces a score of +40.

Here, +40 means positive posts make up 70% of the posts included in the calculation, while negative posts make up 30%. Positive posts account for only 7% of the full collection.

A score for one piece of text measures something different. VADER's compound score combines word values with its rules on a -1 to +1 scale. It describes that text rather than counting positive and negative posts across a collection.

Microsoft's confidence scores run from zero to one and express the system's confidence in a label. A high confidence value for "I enjoyed the match" concerns how clearly the text fits a category. The strength of the author's enthusiasm is a separate question.

Why do sentiment analysis tools give different results?

Sentiment analysis tools can collect different posts, assign different labels to the same text, or summarize the labels with different calculations. Comparing results starts with identifying which of those changed.

A platform's users, the query wording, and the time period determine which posts enter the analysis. One tool might include discussion before a match while another captures reactions afterward. A difference between those results can come from what happened between the two periods.

Classifiers can assign different labels to slang or quoted criticism because their word lists, training examples, and treatment of context differ. People also disagree when assigning labels. In a Meltwater exercise using 200 tweets across 20 topics, colleagues agreed on positive, neutral, or negative labels in 69% of cases.

Even tools that agree on the labels can use a different net sentiment formula. Thematic's explanation divides positive minus negative mentions by all mentions, including neutral ones. With 70 positive, 30 negative, and 900 neutral posts, that formula produces +4, compared with +40 when neutral posts are excluded.

Excluding neutral posts measures the balance within the positive and negative group. Including them measures the excess of positive over negative posts as a share of the entire collection. If more neutral posts were added to this example, +40 would stay unchanged while +4 would move closer to zero.

A hypothetical collection of 70 positive, 30 negative, and 900 neutral posts has net sentiment of +40 when neutral posts are excluded, or +4 when the calculation divides by all 1,000 posts. On the Social Intelligence dashboard's score scale, +40 falls in the Mostly Positive range, while +4 would fall in the Neutral range.

What does zero net sentiment mean?

When neutral posts are excluded, a net sentiment score of zero means equal positive and negative counts. A discussion with 500 positive posts and 500 negative posts scores zero even though every post expresses a reaction. An entirely neutral collection has no positive or negative posts to put into this formula.

At the ends of the scale, +100 means at least one positive post and no negative posts, while -100 means the reverse. One positive post among hundreds of neutral posts can therefore produce +100. The endpoints tell you about the balance of labels, while the counts tell you how much text supports it.

What is a good sentiment score?

On a net sentiment scale that excludes neutral posts, a score above zero means positive posts outnumber negative posts. To judge whether a result is unusually favorable, compare it with the same subject over a comparable period, using the same source, query, and calculation. A rise from -30 to +20 means the balance turned positive. A fall from +70 to +20 means positive posts still lead, but by a smaller margin.

For a company announcement, a useful comparison might be the week after its previous announcement of the same kind. For a sports team, it might be reactions after similar matches. Comparing a product launch with an unrelated company's legal dispute would mix differences in subject with differences in sentiment.

The table translates scores from the formula that divides positive minus negative posts by their combined count. The percentages refer only to those posts:

Net score, excluding neutral postsPositive share of positive and negative postsNegative share
-5025%75%
050%50%
+2060%40%
+5075%25%
+8090%10%

For this formula, adding 100 to the score and dividing by two gives the positive share, provided there are positive or negative posts to count.

Every positive post has the same weight in this calculation, whether its wording is mildly pleased or ecstatic. A high score can come from many mildly positive posts if few posts are negative.

The number of contributing posts matters too. Consider two hypothetical collections, each containing 1,000 posts:

CollectionPositiveNegativeNeutralScore
A7030900+40
B560240200+40

Both have the same balance between positive and negative posts. The score summarizes 100 posts in A and 800 in B. Collection A is mostly neutral text, while B contains much more praise and criticism. Their matching scores conceal that difference.

Each bar contains 1,000 hypothetical posts, with brackets marking the positive and negative posts used to calculate net sentiment. Both collections score +40 because those posts split 70% positive and 30% negative, although the score uses 100 posts in A and 800 in B.

Small counts also make scores easy to move. Nine positive posts and one negative post produce +80. One additional negative post lowers the score to about +64. With 900 positive and 100 negative posts, adding one negative post leaves the score near +80. The first change can look dramatic on a chart even though only one post arrived.

What does social media sentiment analysis tell you?

Social media sentiment analysis shows how discussion of a subject leans and when that tone changes. Its scores and label counts let you compare reactions to two subjects or follow the response to an announcement. The matching posts give the reasons behind those reactions, such as enthusiasm for a new signing or disappointment about the transfer fee.

Twelve overlapping social-post cards, six grey, three green, and three red, flow along blue curves into a summary card. Its ring has a grey right half representing 50%, a green upper-left quarter representing 25%, and a red lower-left quarter representing 25%, with a color key below.

Among twelve hypothetical posts, six are neutral, three are positive, and three are negative. Neutral grey fills half the ring, while positive green and negative red each fill a quarter.

Which posts enter the analysis?

The source, query, and time window define the conversation being measured. For example, the Social Intelligence dashboard's sentiment analysis uses public Bluesky posts. Within that source, query wording can select different discussions:

Query choiceEffect on the collection
A company namePosts can concern its products, share price, employees, or chief executive.
A company name together with "earnings"The collection narrows to posts that also mention earnings.
A name together with "scandal"The query selects a discussion with a negative association already built in.
An ambiguous name or a single spellingUnrelated uses can enter, while abbreviations or alternative spellings can be missed.

Which subject gets the praise or criticism?

A whole-post label follows the tone of the entire message. In "Bitcoin looks strong again. Ethereum is a mess," the writer evaluates the two coins differently. A query for either coin can retrieve the post, taking the same overall label into both results.

Similar scores for two subjects can therefore partly come from shared posts. In this example, a positive whole-post label would count toward Ethereum's result even though the praise concerns Bitcoin. The text identifies which coin the writer approved of.

The post's positive label applies to the whole message and counts in both the Bitcoin and Ethereum query results. In this hypothetical example, the Ethereum result includes a positive post even though the author praises Bitcoin and calls Ethereum "a mess."

Does Twitter reflect public opinion?

Twitter reactions can differ sharply from public opinion measured in surveys. In a 2013 comparison of Twitter reactions with national polls, Pew Research Center found positive reactions to the 2012 State of the Union address in 21% of tweets, compared with 42% of surveyed adults.

Twitter sentiment analysis measures the discussion among people who choose to post, with frequent authors contributing more text. In its 2019 study of U.S. adult Twitter users, Pew estimated that the most active 10% produced 80% of tweets.

In Pew Research Center's 2019 study, 80% of tweets came from the most active 10% of U.S. adult Twitter users. The remaining 90% wrote 20%, so counting tweets gives most of the weight to a small group of frequent authors.

One person posting twenty times contributes twenty posts, and each positive or negative post has equal weight in the score. A survey recording one response per person counts participation differently.

Election sentiment analysis has been tested against polls too. In a 2010 study, O'Connor and colleagues found that sentiment about a presidential candidate did not track that candidate's support in 2008 U.S. election polls. The comparison of prediction markets vs polls develops the difference between reactions, voting intentions, and expectations about an outcome.

How do you track a sentiment trend over time?

For sentiment analysis over time, keep the source, query, calculation, and interval length consistent. Compare the score with the positive, negative, and neutral counts for each period. A falling score can come from more criticism, less praise, or both, and the counts show which change occurred.

Suppose discussion of a crypto project contains these daily totals:

DayPositive postsNegative postsScore
Monday700300+40
Tuesday70300About -62

The score has fallen sharply, yet the negative count is unchanged. Positive posting has dropped by 630. Reading Tuesday's result as a surge of criticism would miss the change in the discussion.

In this hypothetical discussion of a crypto project, positive posts fall from 700 on Monday to 70 on Tuesday, while negative posts stay at 300. The drop of 630 positive posts lowers net sentiment from +40 to about -62.

Percentages help compare the mix of labels across busy and quiet periods. Counts show how much discussion occurred. Together they separate a day when criticism grew from one when the same amount of criticism occupied a larger share of a smaller conversation.

A positive average change between days or weeks means increases outweighed declines over the period. Scores can still fall on individual days.

An overall score also differs from a simple average of daily scores. Imagine one day has 900 positive and 100 negative posts, scoring +80. Another has one positive and nine negative posts, scoring -80. Averaging the two scores gives zero, treating the days equally despite their different volumes.

Pooling the posts instead gives 901 positive and 109 negative posts, for a score of about +78. That calculation weights each positive or negative post equally, so an overall score can stay high despite a very negative day with little activity.

Day 1 contributes 1,000 posts and scores +80 in this hypothetical example, while Day 2 contributes ten posts and scores -80. Their scores average to zero, but combining the posts gives 901 positive and 109 negative, keeping net sentiment close to the busier day's result at about +78.

The time window changes the question too. A two-week view might combine anticipation before an announcement with reactions afterward. Daily totals separate those stages but contain fewer posts in each interval.

How accurate is sentiment analysis?

Brandwatch Listen estimates 60% to 75% sentiment accuracy for most queries in its supported languages. Its documentation also cites research putting agreement between two human readers at about 80%. Accuracy measures agreement with the expected labels in a test, so the language, subjects, and labeling rules behind a published result matter when applying it to another collection.

Some common problems with sentiment analysis appear in everyday posts:

TextWhat the classifier needs to understand
"Great, another outage during the final."The praise is sarcastic.
"Calling Bitcoin 'dead' ignores how much people still trade it."The writer is challenging the quoted criticism.
"That striker is sick."The word may be praise in this context.
"Exactly what we needed."The meaning may depend on the post being answered.

Errors also occur in simpler language. The CheckList study tested commercial and research systems in 2020 and found failures on negation and other basic language tests despite strong benchmark results.

Can sentiment analysis detect sarcasm?

Models trained for sarcasm detection can identify sarcastic posts. Ghosh, Fabbri, and Muresan found that their research models performed better when they could use surrounding conversation.

In "Great, another outage during the final," the clash between praise and an unwelcome event supplies a clue. An isolated "Great" could be sincere or sarcastic, with the deciding clue in an earlier message.

How do classification errors change the result?

Errors that favor one label can shift the overall score even when most posts are classified correctly. Suppose 1,000 posts should split evenly between positive and negative. If 100 negative posts are mislabeled positive, the counts become 600 positive and 400 negative. Net sentiment becomes +20 instead of zero, although the system still gets 90% of individual labels right.

Of 1,000 hypothetical posts split evenly between positive and negative, a model mislabels 100 negative posts as positive. Its counts become 600 positive and 400 negative, shifting net sentiment from zero to +20 even though 90% of its labels are correct.

A practical check is to read posts from each label across the period you are comparing. Repeated criticism under positive, or opinions under neutral, reveals a pattern that could affect the counts.

Which sentiment analysis tools can you use?

Social media sentiment analysis tools such as Brandwatch Listen collect posts and summarize the discussion. Santiment organizes social metrics around crypto assets, while services such as Microsoft's Sentiment Analysis classify text you supply. The useful distinction is whether you need the tool to collect a conversation or already have messages to analyze.

ToolWhat you getWhat you bring or check
Brandwatch ListenPositive, negative, and neutral labels for mentions, plus sentiment and emotion summaries.Source coverage, query relevance, and the time period.
SantimentPositive, negative, and balance metrics for social discussion of crypto assets.The asset, social sources, and the calculation behind each metric.
Social Intelligence dashboardBluesky post counts, sentiment, emotions, and matching text.A query and time range.
Microsoft Sentiment Analysis and Opinion MiningSentence and document labels with confidence scores, plus evaluations of specific aspects.Your text collection and a way to organize its results.
VADERScores for supplied text using word values and language rules.Collected text and code to run the analysis.
ChatGPTClassifications based on written instructions and examples.The text, label definitions, and checks of the returned labels.

For classifiers that accept supplied text, comparing the same collection isolates differences in labels and scoring. Dashboards collect their own posts, so comparing sentiment tracking tools also means comparing platform coverage, query matching, and time periods. The reasons tools give different results help separate a change in the conversation from a change in the measurement.

What is sentiment analysis in trading?

Stock sentiment analysis follows the tone of news and social posts about a company, often around earnings or a product launch. Traders compare those reactions with prices to investigate what news accompanied a move. In prediction market research, the same analysis can draw attention to announcements or disputes relevant to a contract's outcome.

A blue probability line on an unlabeled scale from zero to one hundred percent turns upward to a highlighted point. A dashed guide aligns the point with overlapping green, grey, and red reaction cards. A two-part bar above the chart represents complementary outcomes.

A hypothetical prediction-market probability rises on a 0% to 100% scale beside a mix of positive, neutral, and negative posts. The dashed line connects the highlighted point with reactions a trader could read alongside the market's movement.

Crypto sentiment data can come as separate positive and negative measures. Santiment, for example, sums the per-post sentiment scores that meet its threshold, then subtracts the negative total from the positive total to produce its balance metric. That calculation differs from net sentiment based on post counts.

Market sentiment is the broader finance term for investors' attitudes and expectations. Analysts assess it through surveys asking whether investors expect prices to rise or fall, through market positioning, and through trading activity. A bullish or bearish judgment about future prices asks a more specific question than whether the language of a post sounds positive or negative.

For example, "Love the company. I think the shares will drop after earnings" expresses affection and a negative price expectation. An analyst interested in next week's share price needs the expectation. A general sentiment classifier judges the tone of the text it receives.

Support for an outcome is another distinct measurement, called stance. Someone saying "Canceling the final would be disgraceful" uses negative language while supporting the final going ahead. Research on stance and sentiment in tweets found that sentiment helps identify stance but is insufficient to determine it. The distinction matters when a contract asks whether that final will take place.

In these hypothetical readings, the company post receives a positive sentiment label even though its author expects the shares to fall. The post opposing cancellation of the final is labeled negative while supporting the final going ahead.

How does sentiment relate to prediction-market prices?

Sentiment shows how people are reacting to an event, while a prediction-market price reflects trading in a contract on a defined outcome. Comparing when the discussion and price changed helps trace which announcement people are reacting to and whether it concerns the outcome being traded.

For an event contract that pays one dollar if an event happens and zero otherwise, a price of 65 cents is commonly read as roughly a 65% implied probability. The contract fixes which outcome that price concerns.

Suppose a market asks whether a central bank will cut rates at its next meeting. Positive posts about rate cuts rise sharply after a speech, while the contract's price barely changes. The posts celebrate cheaper borrowing and link to remarks by the governor. In the full speech, those remarks concern conditions for a possible cut later in the year.

Those posts concern a later decision than the one in the market's question and deadline. The contract's resolution rules tie settlement to the next meeting.

A hypothetical contract on a rate cut at the next central bank meeting moves from 65¢ to 66¢ after a speech, while net sentiment about rate cuts rises from +10 to +60. The price is read as the cut's implied probability, and sentiment measures the balance of positive and negative posts.

Can stock sentiment analysis predict prices?

Positive-negative sentiment did not improve forecasts in Bollen, Mao, and Zeng's study of Twitter mood and the Dow. Their reported improvement came from a measure called Calm, which captured a different dimension of mood. A later investigation by Lachanski and Pav could not reproduce the original statistical pattern and found no improvement from its mood measures on separate test data.

When testing sentiment analysis for stock price prediction, timing is part of the test. Posts celebrating a price rise may appear after the rise, so two charts moving together can record a reaction. A forecast needs sentiment data available before the price change it is meant to predict.

A trading test also needs periods that were not used to choose the rule, and returns calculated after trading costs. Otherwise a promising historical pattern may come from selecting the dates, assets, or score threshold that happened to work.