Sentiment analysis of customer reviews into positive, neutral and negative scores
Web Scraping

What Is Sentiment Analysis? Methods, Types and Examples

Table of Content

Last updated: 10 November 2026

Quick answer

Sentiment analysis is the process of using natural language processing (NLP) and machine learning to identify the opinion or emotion in text and label it as positive, negative or neutral. Businesses use sentiment analysis on reviews, social posts, surveys and support tickets to measure customer opinion at scale. The main sentiment analysis methods are rule-based (lexicon) approaches, machine learning models and large language models.

Key takeaways
  1. Sentiment analysis turns opinion in text into measurable labels and scores.
  2. Positive, negative and neutral are the standard labels; some tools add mixed.
  3. Methods range from word lists to machine learning and LLMs.
  4. Accuracy depends on clean, relevant data such as reviews collected at scale.
  5. Common uses are brand monitoring, product feedback and competitor analysis.

Customers tell you what they think every day, in reviews, comments and support chats. Reading it all by hand is impossible. Sentiment analysis does it automatically, turning thousands of opinions into clear numbers your team can track.

This guide explains what sentiment analysis is, how it works, the positive, negative and neutral definitions, the main types and methods, real applications, its limits and where to get the data. For background on text data, see our guide to structured vs unstructured data.

3 labelsPositive, negative, neutral
3 methodsRules, ML and LLMs
-1 to +1Typical sentiment score
ReviewsMost common data source
Need reviews and comments for sentiment analysis?We collect public reviews and ratings from marketplaces and review sites, ready for analysis.
Get a Free Data Sample →

What Is Sentiment Analysis?

Sentiment analysis, also called opinion mining or sentiment analytics, is a natural language processing technique that detects the attitude expressed in text and classifies it as positive, negative or neutral, often with a score showing how strong that feeling is.

A sentiment model reads a sentence such as “Delivery was fast and the quality is great” and returns a label (positive) and usually a score, such as 0.9 on a scale from -1 to +1. Run across thousands of reviews, these labels show how customers feel about a product, brand or feature over time.

What is sentiment analysis used for?

Sentiment analysis is used to understand customer opinion at scale. Teams use it to spot product problems early, track brand reputation, compare competitors and prioritise support tickets, without reading every comment.

What Do Positive, Negative and Neutral Mean in Sentiment Analysis?

In sentiment analysis, positive means the text expresses approval or satisfaction, negative means disapproval or dissatisfaction, and neutral means the text is factual or carries no clear opinion. Some tools add a fourth label, mixed, for text with both.

LabelDefinitionExample
PositiveApproval, praise, satisfaction or thanks“Thank you, the support team was brilliant.”
NegativeComplaint, criticism, frustration or disappointment“The box arrived damaged and nobody replied.”
NeutralObjective statements, facts, questions or requests with no opinion“Please send the invoice for order 4512.”
MixedBoth positive and negative opinions in one text“Great camera, but the battery dies quickly.”

Why is a polite request usually neutral?

A polite request such as “Could you share the delivery date?” is usually labelled neutral because it asks for information without judging anything. Politeness words alone do not make text positive. By contrast, “thank you” combined with praise, such as “Thank you, this was so helpful”, is usually positive.

Did you know?

Cloud services score sentiment differently. Google Cloud Natural Language returns a score from -1.0 to 1.0 plus a magnitude for overall emotional strength, while Amazon Comprehend returns positive, negative, neutral or mixed with a confidence for each.

How Does Sentiment Analysis Work?

Sentiment analysis works by cleaning text, breaking it into words or tokens, scoring those tokens with rules or a trained model, and combining the results into a label and score for each sentence or document.

  1. Collect text: gather reviews, comments, surveys or tickets.
  2. Clean and prepare: remove noise such as HTML, duplicates and spam, and normalise spelling.
  3. Tokenise: split text into words, phrases or sub-word tokens.
  4. Score sentiment: apply a lexicon, a machine learning model or an LLM.
  5. Aggregate: combine scores by sentence, review, product, brand or time period.
  6. Visualise and act: chart trends and set alerts for sudden drops.

Text from websites first needs to be extracted and structured; our guide to data parsing explains that step.

What Are the Main Sentiment Analysis Methods?

The three main sentiment analysis methods are rule-based (lexicon) analysis, machine learning classification and large language model (LLM) analysis. Many production systems combine them.

MethodHow it worksStrengthsWeaknesses
Rule-based (lexicon)Uses word lists with positive and negative scores, plus rules for negation and intensityFast, transparent, no training neededMisses context, sarcasm and domain terms
Machine learningTrains a classifier on labelled examplesLearns domain language; accurate with good dataNeeds labelled training data
Deep learning and transformersUses neural models such as BERT fine-tuned for sentimentStrong on context and nuanceMore compute; needs tuning
Large language modelsPrompts an LLM to label or explain sentimentFlexible, handles aspects and explanationsCost at scale; outputs need checking

Which sentiment analysis algorithm is best?

No single algorithm is best. Lexicon tools suit quick, low-cost analysis of short text. Fine-tuned transformer models give the best accuracy for a specific domain, such as product reviews. LLMs are useful when you need explanations or aspect detail, as long as results are validated.

How is sentiment analysis used in machine learning?

In machine learning, sentiment analysis is a text classification task. A model learns from examples labelled positive, negative or neutral, such as reviews with star ratings, then predicts labels for new text. Model quality depends heavily on training data that matches your domain, which is why product teams often train on reviews from their own category.

What Is the Difference Between Text Analytics and Sentiment Analysis?

Text analytics is the wider process of extracting meaning from text, including topics, keywords, entities and trends. Sentiment analysis is one part of text analytics that focuses only on opinion and emotion.

FactorText analyticsSentiment analysis
Question answeredWhat are people talking about?How do people feel about it?
OutputsTopics, keywords, entities, categoriesPositive, negative, neutral labels and scores
Example“Delivery” is the top topic in reviewsDelivery mentions are 70% negative

Used together, text and sentiment analysis show both the subject and the feeling, which is far more useful than either alone.

What Are the Types of Sentiment Analysis?

The main types of sentiment analysis are fine-grained, aspect-based, emotion detection and intent analysis. Each answers a different business question.

  • Fine-grained sentiment: uses a scale, such as very negative to very positive, often mapped to star ratings.
  • Aspect-based sentiment: scores specific features, such as price, delivery or battery life, within one review.
  • Emotion detection: identifies emotions such as anger, joy or frustration.
  • Intent analysis: detects what the writer wants, such as to buy, cancel or complain.
  • Multilingual sentiment: analyses text in several languages for global brands.
Aspect-based example (fictional review)
Review textAspectSentiment
“Great sound and fair price, but delivery took two weeks.”Sound qualityPositive
PricePositive
DeliveryNegative

What Are the Benefits of Sentiment Analysis?

The main benefits of sentiment analysis are speed, scale and consistency. It turns large volumes of opinion into trends that teams can act on quickly.

  • Early warnings: catch rising complaints about a product before returns climb.
  • Better products: learn which features customers love or dislike.
  • Brand protection: track reputation across reviews and social mentions. See our guide to brand protection.
  • Competitor insight: compare how customers feel about rival products.
  • Faster support: route angry tickets to the right team first.

Where Is Sentiment Analysis Used?

Sentiment analysis is used wherever customers express opinions in text. These are the most common applications.

ApplicationText analysedBusiness outcome
Product reviewsMarketplace and retailer reviewsProduct improvements and better listings
Brand monitoringReviews, forums, news and public postsReputation tracking and crisis alerts
Competitor analysisReviews of rival productsGaps to win customers
Customer supportTickets, chats and emailsFaster handling of unhappy customers
Hospitality and travelHotel and restaurant reviewsService improvements by location
FinanceNews and analyst commentaryMarket sentiment signals
Want competitor reviews for sentiment analysis?We collect reviews from Amazon, Trustpilot, G2, Yelp and more, cleaned and ready to analyse.
Talk to Our Data Experts →

What Are the Challenges of Sentiment Analysis?

The biggest challenges of sentiment analysis are sarcasm, context, domain language, mixed opinions and poor-quality data. Each can make results misleading if not handled.

  • Sarcasm and irony: “Great, it broke on day one” is negative despite the word great.
  • Context and domain: “unpredictable” is bad for a car but good for a film plot.
  • Negation: “not bad at all” is positive, which simple rules can miss.
  • Mixed reviews: one review can praise and criticise different aspects.
  • Data quality: duplicates, fake reviews and missing text distort results. See our guide to data validation vs verification.

Where Do You Get Data for Sentiment Analysis?

The best data for sentiment analysis is public text where customers express opinions, such as product reviews, review sites, forums and public social posts, plus your own surveys and support tickets.

SourceExamplesXwiz coverage
Marketplace reviewsAmazon, Walmart, FlipkartAmazon scraper
Review platformsTrustpilot, G2, YelpTrustpilot, G2, Yelp
Travel and hospitalityBooking.com, Airbnb, ExpediaHotel data scraping
Food deliveryUber Eats, SwiggyRestaurant data scraping
Internal dataSurveys, tickets, chatsCombine with external reviews

Collect only public content and avoid personal details. Review text, ratings, dates and product IDs are usually all you need.

How Does Xwiz Support Sentiment Analysis?

Xwiz Analytics collects the public review and rating data that sentiment analysis needs, and can deliver analysed results through our analytics team.

  • Review collection: text, rating, date, product and location from many sites.
  • Clean data: duplicates removed, languages tagged and fields normalised.
  • Ongoing feeds: new reviews delivered daily or weekly.
  • Analysis option: sentiment scores and dashboards through our data analytics services.
  • Public data only: no personal profiles or private messages.

Frequently Asked Questions

What is sentiment analysis?
Sentiment analysis is a natural language processing technique that identifies the opinion in text and labels it as positive, negative or neutral, often with a score for strength.
What are the main sentiment analysis methods?
The main methods are rule-based (lexicon) analysis, machine learning classifiers, deep learning models such as transformers, and large language models.
What is neutral sentiment?
Neutral sentiment describes text that is factual or carries no clear opinion, such as objective statements, questions or polite requests for information.
What are the types of sentiment analysis?
Common types are fine-grained sentiment, aspect-based sentiment, emotion detection, intent analysis and multilingual sentiment analysis.
Why is sentiment analysis important?
Sentiment analysis is important because it shows how customers feel at scale, helping businesses fix problems early, improve products and protect their brand.
How do you perform sentiment analysis?
Collect text, clean it, apply a lexicon, machine learning model or LLM to score it, then aggregate and chart the results by product, brand or time.

Conclusion

Sentiment analysis turns customer opinion into data. By labelling text as positive, negative or neutral and tracking it over time, businesses can see problems and opportunities long before they show up in sales.

The method matters, but the data matters more. Clean, relevant reviews collected at scale are the foundation of reliable sentiment insight. Start with one product line, validate the labels against a sample you read yourself, then expand.

SourcesIBM: What is sentiment analysis? · Google Cloud Natural Language basics · Amazon Comprehend: Sentiment

Ready to measure customer sentiment?

Tell us the products, brands and review sites you track. We will collect the reviews and deliver clean data or insights.

This insight could benefit your network, feel free to share it.
Gaurav Vishwakarma
Gaurav Vishwakarma