named entity recognition (NER) Top advantages and disadvantages of AI

sentiment analysis

What is sentiment analysis?

Sentiment analysis, also referred to as opinion mining, is an approach to natural language processing (NLP) that identifies the emotional tone behind a body of text. This is a popular way for organizations to determine and categorize opinions about a product, service or idea. Sentiment analysis involves the use of data mining, machine learning (ML), artificial intelligence (AI) and computational linguistics to mine text for sentiment and subjective information, such as whether it's expressing positive, negative or neutral feelings.

Sentiment analysis systems help organizations gather insights into real-time customer sentiment, customer experience and brand reputation. Generally, these tools use text analytics to analyze online sources, such as emails, blog posts, online reviews, customer support tickets, news articles, survey responses, case studies, web chats, tweets, forums and comments. Algorithms are used to implement rule-based, automatic or hybrid methods of scoring whether the customer is expressing positive, negative words or neutral words.

Sentiment analysis can also extract the polarity or the amount of positivity and negativity, as well as the subject and opinion holder within the text. This approach is used to analyze various parts of text, such as a full document or a paragraph, sentence or subsentence.

How does sentiment analysis work?

Sentiment analysis uses ML models and NLP to perform text analysis of human language. The metrics used are designed to detect whether the overall sentiment of a piece of text is positive, negative or neutral.

Sentiment analysis generally follows these steps:

  1. Collect data. The text being analyzed is identified and collected. This involves using a web scraping bot or a scraping application programming interface.
  2. Data preprocessing. In this stage, the data is processed to identify keywords that highlight the core meaning of the text. Other preprocessing steps include the following:
    • Tokenization is used to break a sentence down into multiple elements, called tokens.
    • Stop-word removal is performed to remove parts of speech that don't have meaning relevant to the sentiment of the text. This includes contractions, such as I'm, and words that have little information such as is, articles such as the, punctuation, URLs, special characters and capital letters.
    • Lemmatization then converts keywords into their root form.
  1. Keyword analysis. ML and NLP algorithms automatically extract text features to identify negative or positive sentiment. ML approaches used include the bag-of-words technique that tracks the occurrence of words in text and the more nuanced word-embedding technique that uses neural networks to analyze words with similar meanings.
  2. Text scoring. A sentiment analysis tool scores the text using a rule-based, automatic or hybrid ML model. Rule-based systems perform sentiment analysis based on predefined, lexicon-based rules and are often used in domains such as law and medicine, where a high degree of precision and human control is needed. Automatic systems use ML and deep learning techniques to learn from data sets. A hybrid model combines both approaches and is generally considered the most accurate model. These models offer different approaches to assigning sentiment scores to pieces of text.
  3. Sentiment classification. Once a model is picked and used to analyze a piece of text, it assigns a sentiment score to the text, including positive, negative or neutral. Organizations can also decide to view the results of their analysis at different levels, including document level, which pertains mostly to professional reviews and coverage; sentence level for comments and customer reviews; and sub-sentence level, which identifies phrases or clauses within sentences.
A sample of sentiment analysis showing positive, negative and neutral text sentiments.
Companies learn a lot about their customers and what they like and don't like through analysis of the feelings behind individual words in a piece of text.

Types of sentiment analysis

Sentiment analysis systems fall into the following categories:

  • Fine-grained sentiment analysis breaks down sentiment indicators into more precise categories, such as very positive, positive, neutral, negative and very negative. This approach is like opinion ratings on a one-to-five scale. It's effective at grading customer satisfaction surveys. Other scaling methods include rating user sentiment from 0 to 100.
  • Emotion detection analysis identifies emotions rather than positivity and negativity. Examples include happiness, frustration, shock, anger and sadness. This type of sentiment analysis is a more complex method, as it's more in-depth than just sorting words into categories.
  • Intent-based analysis recognizes motivations behind a text in addition to opinion. For example, an online comment expressing frustration about changing a battery might carry the intent of getting the customer service team to reach out to resolve the issue. This type of sentiment analysis is typically useful for conducting market research.
  • Aspect-based sentiment analysis examines whether the specific component is positively or negatively mentioned. For example, a customer might review a product saying the battery life was too short. The sentiment analysis system will note that the negative sentiment isn't about the product but about the battery life.

Why is sentiment analysis important?

Sentiment analysis is an important way for organizations to understand how customers perceive and experience their products and brands. Increasingly, customer opinions and feedback are given online through a variety of unconnected platforms, such as Amazon product reviews and posts on social media platforms.

Organizations typically don't have the time or resources to scour the internet to read and analyze every piece of data relating to their products, services and brand. Instead, they use sentiment analysis algorithms to automate this process and provide real-time feedback.

Organizations use this feedback to improve their products, services and customer experience. A proactive approach to incorporating sentiment analysis into product development can lead to improved customer loyalty and retention.

Sentiment analysis can also be used internally by organizations to automatically analyze employee feedback that quantifies and describes how employees feel about their organization. This is typically called employee sentiment analysis.

What is sentiment analysis used for?

Sentiment analysis tools are used in nearly every industry for a variety of applications, including the following:

  • Social media monitoring, a key strategy that tracks customer sentiments across social media platforms, such as Facebook, Instagram and X (formerly Twitter).
  • Monitoring brand awareness, reputation and popularity at a specific moment or over time.
  • Analyzing consumer reception of new products or features to identify possible product improvements.
  • Evaluating the success of a marketing campaign to ensure that the overall sentiment a campaign generates is positive. For example, a net promoter score could be gathered to determine if a customer would recommend a product or a service to a friend.
  • Pinpointing a target audience or demographic.
  • Conducting market research, such as emerging trends and competitive insights.
  • Categorizing customer service requests and automating customer service.
  • Customer support analysis to assess the effectiveness of customer support and monitor trending issues. Sentiment can be gathered as customer effort scores, for example.
  • Product and aspect analysis, which identifies how customers feel about a product or specific component.

There are many AI-powered sentiment analysis tools available with varying features and functionality. Some tools provide end-to-end customer service functionality that includes sentiment analysis whereas other tools offer specialized sentiment analysis and social listening capabilities. These tools can gauge how customers feel about a particular brand, product or service based on the emotion, tone and urgency exhibited in online conversations -- including social media, emails, chats and surveys.

Many tools enable an organization to easily build their own sentiment analysis model so they can more accurately gauge specific language pertinent to their specific business. Other tools let organizations monitor keywords related to their specific product, brand, competitors and overall industry. Most tools integrate with other tools, including customer support software. Businesses that use these tools to analyze sentiment can review customer feedback more regularly and proactively respond to changes of opinion within the market.

Benefits of sentiment analysis

The benefits of sentiment analysis include the following:

  • Collects large amounts of unstructured data from various sources.
  • Tracks real-time customer feedback and sentiment about an organization's brand, products and services.
  • Provides a way to gather feedback on ways to improve products, services and customer experience.
  • Gathers data and feedback that keeps customer support staff current on customer issues, improving their ability to respond.
  • Tracks the effectiveness of customer support through support tickets and other online feedback.
  • Automates customer service by identifying customers' sentiments and automatically sending them to relevant frequently asked questions responses for resolution.
  • Identifies emerging marketing trends and understands and improves what marketing strategies resonate with customers.
  • Provides insights by monitoring comments about competitors.
  • Establishes consistent criteria for evaluating sentiment instead of relying on subjective human analysis.
  • Identifies and reacts to emerging negative sentiments before they escalate.
  • Frees employee time and energy for other tasks.
  • Improves the empathy of organizations and customers.
  • Removes bias, as different workers might understand the same text differently based on perceived diction, tone and context.

Challenges with sentiment analysis

Challenges associated with sentiment analysis typically include the following:

  • Neutral sentiments. Comments with a neutral sentiment tend to pose a problem for systems and are often misidentified. For example, if a customer received the wrong color item and submitted a comment, "The product was blue," this could be identified as neutral when, in fact, it should be negative.
  • Unclear language. Sentiment is challenging to identify when systems don't understand the context or tone. Answers to polls or survey questions like nothing or everything are hard to categorize when the context isn't given; they could be labeled as positive or negative depending on the question. This is known as lexical ambiguity. Similarly, it's difficult to train systems to identify irony and sarcasm, and this can lead to incorrectly labeled sentiments. Algorithms have trouble with pronoun resolution, which refers to what the antecedent to a pronoun is in a sentence. For example, in analyzing the comment, "We went for a walk and then dinner. I didn't enjoy it," a system might not be able to identify what the writer didn't enjoy -- the walk or the dinner.
  • Unclassifiable language. Computer programs have difficulty understanding emojis and irrelevant information. Special attention must be given to training models with emojis and neutral data so they don't improperly flag texts.
  • Ambiguous sentiments. People can be contradictory in their statements. Most reviews have both positive and negative sentiments. This situation can be managed by analyzing sentences one at a time. However, sentences that contain two contradictory words, also known as contrastive conjunctions, can confuse sentiment analysis tools. For example, "The packaging was terrible, but the product was great."
  • Named-entity recognition. This is when an algorithm can't recognize the meaning of a word in its context. For instance, the use of the word Lincoln can refer to the former U.S. president, the film or a penny.
  • Small data sets. Sentiment analysis tools work best when analyzing large quantities of text data. Smaller data sets often won't provide the insight needed.
  • Language evolution. Language is constantly changing, especially on the internet, where users are continually creating new abbreviations, acronyms and using poor grammar and spelling. This level of variation and evolution can be difficult for algorithms.
  • Fake reviews. Algorithms can't always tell the difference between real and fake reviews of products, or other pieces of text created by bots.
  • Need for human intervention. Gartner finds that even the most advanced AI-driven sentiment analysis and social media monitoring tools require human intervention to maintain consistency and accuracy in analysis.
  • Negation. This is the use of negative words that convey a different meaning in a sentence. For example, "I wouldn't say the product performed poorly." The words "wouldn't" and "poorly" might be picked up as a negative sentiment by some models, where the sentiment of this sentence might have been intended to come across as more neutral.
  • Idioms. Idioms like "not my cup of tea" or "piece of cake" might confuse ML algorithms. Likewise, common sayings like "it's better than nothing" might also confuse an algorithm.
  • Context. ML algorithms machines can't learn about the context of a comment if it isn't mentioned explicitly. And opinion words can change their meaning depending on context.

Machine learning techniques and technology underpin sentiment analysis models. Learn about other uses for machine learning applications in business.

This was last updated in June 2024

Continue Reading About sentiment analysis

Dig Deeper on Business intelligence management

Data Management
Content Management