Business Growth Strategy

Leveraging Sentiment Analysis to Enhance Business Performance

Objective

Sentiment Analysis has become a cornerstone for businesses looking to gauge customer opinions. Traditional sentiment analysis focuses on overall polarity (positive, negative or neutral). Aspect-Based Sentiment Analysis (ABSA), however; provides a more granular understanding by identifying sentiments associated with specific aspects or attributes within text. This blog dives into ABSA techniques, challenges, tools and practical examples, giving you everything you need to leverage it effectively.

What is Aspect based Sentiment Analysis

ABSA takes traditional sentiment analysis to the next level by evaluating sentiments at an attribute level. For example, in a review of a product, ABSA can separate opinions about the product’s quality, price and customer service, identifying individual sentiments for each.

Tools & Libraries for Sentiment Analysis
Overall Sentiment Analysis Tools
  • TextBlob: A simple library for rule-based sentiment scoring.
  • VADER: Ideal for short, informal text like social media posts.
  • Google NLP: Cloud-based API for sentiment scoring with robust support for large datasets.

Aspect Based Sentiment Analysis Tools
  • HuggingFace Models:  Pre-trained transformers for state-of-the-art sentiment
  • j-hartmann/sentiment-roberta-large-english-3-classes: Excellent for three-class sentiment analysis
  • facebook/bart-large-mnli: Multi-task model for classification and aspect detection
  • siebert/sentiment-roberta-large-english: Optimised for English language sentiment tasks
  • yangheng/deberta-v3-base-absa-v1.1: Tailored for ABSA with state-of-the-art accuracy
  • BertForSequenceClassification: Highly customisable for aspect sentiment fine-tuning

Text Summarisation for Long Reviews

Long texts often exceed token limits of many models 9typically 512 tokens). Using summarisation before performing, ABSA can help reduce input size while retaining key information. Tools include:

  • facebook/bart-large-cnn:  An encoder-decoder model optimised for summarisation tasks
  • T5ForConditionalGeneration: A flexible transformer model supporting various NLP tasks, including summarisation
  • FalconsAI/text_summarisation: A model generating context-aware summaries using advanced NLP techniques
Preprocessing Methods for ABSA

Preprocessinng is crucial to address noise, grammar issues and formatting inconsistencies. Tools include:

  • SentenceTransformer (all-MiniLM-L6-v2): Calculates semantic similarity between sentences for better aspect identification
  • DeepMultilingualPunctuation: Fixes grammar and punctuation issue in text
  • SpaCy/NLTK: For tokenisation, stemming, lemmatisation and cleaning
Challenges in ABSA
Handling Long Texts
  • Challenge: Many models limit input to 512 tokens, requiring chunking or summarisation
  • Solution: Summarise reviews using models like BART or split text into smaller chunks for analysis.
Poor Grammar and Punctuation
  • Challenge: Improper grammar or punctuation can confuse models and reduce accuracy
  • Solution: Use punctuation models (ex. DeepMultilingualPunctuation) and regular expressions to clean text
Special Characters
  • Solution: Clean and normalise text using regex and preprocessing libraries like NLTK
  • Challenge: Special characters and symbols disrupt model comprehension
Step-by-step ABSA Process
Preprocessing
  • Fix punctuation and grammar issues
  • Remove special characters
  • Tokenise, lemmatize and clean the text
Sentiment Analysis
  • Perform overall sentiment analysis using VADER or TextBlob to get a high-level view
  • Identify specific aspects using Hugging Face models (ex. Deberta-v3-base-absa-v1.1)
Summarisation (if required)
  • For long texts, summarise using facebook/bart-large-cnn or T5
Aggregation of Results
  • Combine aspect scores to provide a holistic sentiment overview
Example: ABSA in Action
Original Text (Before Preprocessing)

“3M is an amazingly innovative company. As a scientist, working at 3M is like being a kid in a toy store. Unfortunately, the management prioritises shareholders over employees, with major layoffs during the pandemic despite high dividends for investors”  Challenges identified are:

  • Grammar issues and lack of punctuation
  • Text exceeds token limit
After Preprocessing (Corrected and Summarised)

“3M is innovative but prioritises shareholders over employees. Layoffs during the pandemic despite high dividends highlight leadership issues. A flatter structure and better leadership could improve morale”

Addressing Challenges with Long Texts
Method1: Chunk-Based Sentiment Analysis
  • Split text into chunks and analyse sentiment for each
  • Aggregate chunk results for an overall sentiment score

Pros: Captures sentence level nuances

Cons: Time-intensive and less accurate for overall analysis

Method2: Summarisation First
  • Summarise long texts to within 500 words
  • Perform ABSA on the summarised content

Pros: Faster and more accurate for overall sentiment

Cons: Risk of losing subtle details

Conclusions
  • ABSA enables businesses to derive actionable insights by analysing specific attributes like leadership, innovation and employee treatment
  • Preprocessing is critical for handling noisy or unstructured text
  • Hugging Face models like deberta-v3-absa-v1.1 are ideal for achieving state-of-the-art accuracy in ABSA tasks
  • Addressing challenges like long texts and poor grammar improves the overall performance of sentiment models