Learn AI /Computer Vision and Language Technology /Sentiment analysis
Sentiment analysis
- Starter
- Computer Vision and Language Technology
- Programme & data teams
- Communications teams
Also called: opinion mining.
Back to the milestone you came from
In five seconds
What it is
A method that sorts text, speech transcripts or sometimes images into attitudes such as positive, negative or neutral.
In plain words
It is a way for a computer system to sort written comments by attitude, such as positive, negative, neutral or mixed.
An everyday example
Two colleagues are reading feedback cards after an international youth event. One card says, “The venue was beautiful, but registration took far too long.” Another says, “Check-in was slow, yet the staff stayed calm and helpful.” They place each card into trays labelled mostly positive, mostly negative or mixed, based on the overall tone rather than one word. When they disagree, they reread the full sentence because the same idea can be expressed in different words.
People can use broad world knowledge and notice subtle humour, irony and cultural signals that many systems miss. Also, human readers can explain why they judged a card as mixed, while some models only output a score or label without a clear reason. The analogy also suggests careful reading of each item one by one, but real systems often process thousands of texts automatically.
Remember thisSentiment analysis sorts content by apparent attitude. It is useful for finding broad patterns, but mixed language, sarcasm, negation and context can make its labels unreliable.
Understand it
Understand it
Why it matters
Sentiment analysis can help people handle more feedback than they could read manually. It can show patterns, compare reactions over time and flag messages for review. For programme and communications teams, that can support decisions about where to look first, which messages may be causing confusion, and whether a campaign is being received as intended. But the output is only an estimate based on patterns. It can miss sarcasm, local idioms, mixed feelings and differences between languages or communities. A high-level chart may look neat while hiding important minority views. Non-specialists should care because the tool can save time, but using it without human checks can lead to unfair or misleading conclusions.
How sentiment analysis turns comments into labels
Show how a system takes text, looks for sentiment cues in context and produces a sentiment label or score.
01
1. Input text
A comment, review, transcript or post enters the system.
Draw a rounded rectangle on the left containing two short sample comments: “Service was slow, but staff were kind.” and “Beautiful venue, confusing signs.” Add small source icons for survey, message and review above it.
02
2. Prepare the text
The system breaks the text into useful pieces and standardises it enough to analyse.
Draw an arrow to a box showing the sample sentence split into tokens such as “service | was | slow | but | staff | were | kind”. Include a small note: “cleaning and tokenising”.
03
3. Look for sentiment cues in context
Words and phrases are weighed together, including contrast words like “but”, negation like “not”, and domain-specific expressions.
Draw an arrow to a larger box. Highlight “slow” in red, “kind” in green, and “but” in orange. Show a balance scale icon to suggest the system combines cues rather than counting one word only.
04
4. Output label or score
The system returns a category, a score, or both, such as mixed or negative-leaning.
Draw an arrow to a final box with three pill buttons: Positive, Negative, Neutral/Mixed. Highlight “Mixed” and show a score beneath, such as “negative 0.58, positive 0.42”.
A left-to-right flow diagram with one example comment entering a processing pipeline and emerging as a sentiment result. Read from input to output. Each stage adds one idea: source text, text preparation, pattern detection in context, and final label or score.
On hover or tap, each highlighted word in step 3 reveals a short note explaining its role, such as “contrast word changes the overall reading”.
Describe this without the diagram
This diagram explains sentiment analysis as a four-step flow. First, a text comment enters the system, for example “Service was slow, but staff were kind.” Second, the text is prepared by splitting it into parts so it can be analysed. Third, the system examines sentiment cues in context, not just isolated words. In the example, “slow” points towards negative sentiment, “kind” points towards positive sentiment, and “but” signals a contrast that changes how the whole sentence should be read. Fourth, the system outputs a label or score, such as mixed, positive or negative. The main lesson is that sentiment analysis combines multiple clues from the full text to estimate overall attitude.
With reduced motion: A static left-to-right diagram with four labelled boxes and arrows: input text, text preparation, context cues and output label or score. Highlighted words are shown with fixed colour coding and short notes always visible.
Sentiment analysis looks for the attitude expressed in language. The input is usually text, such as survey comments, social media posts, emails, reviews or call-centre transcripts. Some systems also analyse images or video captions, but most common uses focus on words.
The system takes the input and applies a classification step. Classification means putting something into a category. The categories might be simple, such as positive, negative and neutral, or more detailed, such as very positive, mildly negative, neutral or mixed.
To do this, a model or rule set looks for patterns linked to attitude. These patterns can include words, phrases, punctuation, word order and context. For example, “cheap” can be praise in one sentence and criticism in another. Because of this, sentiment analysis is not just counting happy or unhappy words.
The output is usually a label, a score or both. For example, a comment might be marked negative with a score of 0.82. That can help people summarise large volumes of feedback, but it does not prove what a person truly felt. Results can be less reliable with sarcasm, mixed opinions, domain-specific language and low-resource languages, where less training data may exist.
How “Sorting letters by mood” maps onto the real thing
| In the story | In the AI system |
|---|---|
| Feedback cards from participants | Input text such as reviews, comments or survey responses |
| Trays labelled mostly positive, mostly negative and mixed | Sentiment categories or labels |
| Readers looking at the whole sentence before sorting | A model using context, not just single words |
| Two cards expressing similar views in different wording | Different phrasing can carry similar sentiment |
A worked example
A programme officer is reviewing four anonymised comments on an online workshop before finalising the progress report.
Starting from: 1. “The examples were practical and clear.” 2. “Useful session, but the platform kept freezing.” 3. “I did not find the guidance unhelpful.” 4. “Wonderful, another two-hour presentation.”
- The system tokenises each comment and represents the words and their context as features or embeddings.
- It identifies patterns associated with praise, criticism, negation and contrast. Depending on the system, these patterns come from hand-built rules or labelled training examples.
- It classifies comment 1 as positive and comment 2 as mixed. Comment 3 may be misread because of double negation, while comment 4 may be labelled positive if the system misses the sarcasm.
- The officer reviews the original comments, corrects obvious errors and records the operational issues separately from the sentiment labels.
Result: The classification gives the officer a quick overview, but human review prevents misleading labels from becoming findings in the progress report. The comments themselves provide the useful detail, including the platform problem and the limits of the presentation format.
In a United Nations workplace
A training officer in an evaluation office is revising terms of reference that must clear before Friday. To decide which issues the evaluation should examine, she uses an approved tool to sort anonymised end-of-course comments into positive, negative, neutral and mixed reactions, then reads the comments behind each category.
Sentiment analysis can reveal broad patterns across a large set of comments and help the officer locate recurring dissatisfaction or mixed reactions. It does not explain the reasons for those reactions, so the underlying text still matters when drafting the evaluation questions.
Before you try thisRemove names and other identifying details before analysis, and do not upload personal or confidential feedback to a tool that has not been approved for it. Check results across languages and review comments involving irony, negation or mixed views, which classifiers often misread.
Where you may hear it
- During a vendor demo for a feedback-analysis tool
- In an evaluation office reviewing survey comments
- At a communications planning meeting on public feedback
- In an inter-agency working group discussing multilingual text analysis
Avoid confusion
Avoid confusion
Often confused with
Intent detection
A system that assigns a user message or action to a goal category, such as asking for help, making a booking or reporting a problem.
Topic modelling
A method that scans many documents and groups frequently co-occurring words into recurring themes, helping people see what a collection is mostly about.
Summarisation
Summarisation produces a shorter version of text or speech that keeps the main points and drops less important detail.
Common misconceptions
Common misconception: It simply counts positive and negative words.
Correction: Some early systems worked a bit like that, but useful systems try to read context as well. Words can change meaning depending on nearby words, negation and contrast. For example, “not bad” is often positive, and “cheap” can be praise or criticism depending on the topic.
Common misconception: A sentiment score tells you exactly what people truly feel.
Correction: The score is a model output, not direct access to a person’s inner state. People may be joking, hiding frustration, speaking indirectly or expressing mixed views. The system is estimating likely attitude from observable patterns in language.
Common misconception: If it works in one language, it will work equally well in all languages.
Correction: Performance often varies a lot by language, dialect and domain. A system may have strong training data for one language and weak coverage for another. Idioms, politeness forms and code-switching can also change how sentiment appears in text.
Common misconception: It is the same as finding the topic of a document.
Correction: Topic and sentiment are different questions. Topic asks what the text is about, such as transport, health or schools. Sentiment asks what attitude the text expresses towards that topic, such as praise, complaint or neutrality.
Quick check
Which output best matches sentiment analysis?
Sentiment analysis classifies attitude expressed in the text, often as positive, negative, neutral or mixed. It is different from named entity recognition, machine translation and intent detection. It can suggest likely tone, but it does not reliably reveal a person’s exact intentions.
Go deeper
Go deeper
The simple version
It is a way for a computer system to sort written comments by attitude, such as positive, negative, neutral or mixed.
The technical version
Sentiment analysis is a classification task in natural language processing that maps text, speech transcripts or related content to polarity labels, sentiment scores or finer-grained affect categories. Systems may be rule-based, using sentiment lexicons and hand-built rules for negation and intensifiers, or model-based, learning patterns from labelled examples. Inputs are often tokenised into smaller units, then represented as features or embeddings that help the model detect patterns associated with sentiment. Depending on the design, the model may predict document-level sentiment for a whole review, sentence-level sentiment for each sentence, or aspect-level sentiment for a specific target such as “battery life” in a product review. The task is often confused with intent detection and topic modelling, but those ask different questions: what action the user seeks, or what themes appear in a collection. Performance depends heavily on domain fit, annotation quality, language coverage and the handling of sarcasm, negation, mixed sentiment and class imbalance.
Reviewed external resources
EncyclopaediaSentiment analysis (opens in a new tab)Wikipedia
This link gives a broad overview of the term, useful for readers who want a quick general introduction and related concepts.
Intermediatelink checked 2026-07-31
ArticleMachine Learning Glossary (opens in a new tab)Google
This glossary provides short definitions of machine learning terms, useful for readers who want plain-language refreshers while reading further.
Intermediatelink checked 2026-07-31
CourseMachine Learning Crash Course (opens in a new tab)Google
This course offers beginner-friendly machine learning foundations that help readers understand how systems learn classification tasks such as this one.
Intermediatelink checked 2026-07-31
VideoVideo explanations: Sentiment analysis (opens in a new tab)YouTube search
This is a YouTube search results page, so readers can browse multiple video explanations and choose a format that suits visual or auditory learning.
search results, not one pagelink checked 2026-07-31
DiscussionCommunity discussion: Sentiment analysis (opens in a new tab)Reddit search
This is a Reddit search results page, so readers can sample community questions and discussions to see where people commonly get confused about the term.
search results, not one pagelink checked 2026-07-31
Where this came from
Drafted with a language model through an offline pipeline, checked against this site's schema, and every external link above fetched to see whether it answers. Treat it as a starting point and check anything that matters against the primary sources. How this site is built and what that means.
The one thing to remember
Sentiment analysis sorts content by apparent attitude. It is useful for finding broad patterns, but mixed language, sarcasm, negation and context can make its labels unreliable.