-
Notifications
You must be signed in to change notification settings - Fork 8
Modelling: Sentiment Analysis
On this page, we discuss an overview of sentiment analysis, case studies illustrating real world-applications of sentiment analysis in the banking industry, literature review conducted, and our implementation in the project.
Sentiment analysis, also known as opinion mining, is a natural language processing (NLP) technique that identifies and categorises opinions expressed in text as positive, neutral, or negative. It is widely used across various industries, such as e-commerce and banking, to gain insights into customer opinions and improve services.
Sentiment analysis involves assessing text to determine its emotional tone and assign it a sentiment score. This process helps categorise content as positive, neutral, or negative based on an Artifical Intelligence (AI) model trained on large amounts of text data.
The basic process for sentiment analysis of text documents consists of the following steps:
- Text Breakdown: Each text document is broken down into individual components such as sentences, phrases, tokens, and parts of speech.
- Sentiment Identification: For each phrase and component, the AI model identifies the presence of sentiment or emotional tone.
- Sentiment Scoring: Each phrase and component is then assigned a sentiment score on a scale from -1 (very negative) to +1 (very positive), indicating the emotional tone of the text.
By following these steps, sentiment analysis provides a structured approach to analysing and classifying the emotional tone of text, enabling better understanding and insights into large volumes of written communication.
Sentiment analysis is becoming an essential tool for monitoring and understanding sentiment across different forms of data. With people expressing their opinions and emotions more freely than ever, sentiment analysis allows brands to automatically assess consumer feedback such as survey responses, reviews, and social media comments. This information helps them tailor products and services to better meet their customers' needs, enabling more informed decision-making (Kalita, 2022).
Some key advantages of sentiment analysis include:
- Processing Data at Scale: Sorting through thousands of tweets, customer service interactions, and survey responses manually would be a daunting task. Sentiment analysis provides a way to efficiently process large volumes of unstructured data, saving time and resources.
- Real-Time Monitoring: Sentiment analysis can quickly identify emerging issues in real-time, such as escalating public relations crises on social media. It can also detect when a customer is on the verge of leaving, allowing for proactive interventions.
- Consistent Standards: Human interpretation of sentiment can be subjective, with individuals estimated to agree only 60-65% of the time. By centralising sentiment analysis with a standardised system, companies can apply uniform criteria to all their data, improving accuracy and producing more reliable insights.
Sentiment analysis has a wide range of applications across various industries, helping organisations gain valuable insights from textual data. Some common use cases include:
- Customer Feedback Analysis: By assessing customer reviews and survey responses, companies can identify areas where their products or services excel and areas that need improvement. This feedback helps businesses make informed decisions with regards to innovation and customer service.
- Brand Monitoring: Companies use sentiment analysis to track mentions of their brand across social media and other platforms. This allows them to gauge public perception and quickly respond to potential PR crises.
- Market Research: Sentiment analysis can provide insights into market trends and consumer preferences by analysing opinions and discussions online. This helps businesses stay ahead of competitors and tailor their offerings to current market demands.
- Product Development: Sentiment analysis can identify customer pain points and desires, informing product development and innovation. By understanding what customers value, businesses can create products that better meet their needs.
- Financial Services: In finance, sentiment analysis tracks customer feedback and market news to identify trends and guide investment strategies.
These use cases demonstrate how sentiment analysis can provide valuable insights for businesses and organisations across a variety of sectors (MonkeyLearn, 2020). By leveraging sentiment analysis, companies can make data-driven decisions to improve customer experiences and stay competitive.
Sentiment analysis has various practical applications within the banking industry, offering banks valuable insights into different aspects of their operations and market performance.
Gaining insights into customer attitudes is a key application of sentiment analysis in banking. Banks can use AI software to process large volumes of customer feedback from surveys, open-ended forms, and social media posts. By understanding customers' overall sentiments, banks can make informed adjustments to their customer service and acquisition strategies. For instance, the Bank of Italy conducted an AI project that analysed tweets about several European banks to understand customer perceptions and forecast preferences (Bharadwaj, 2019).
Sentiment analysis is increasingly being used in equity investing to automate research tasks and provide more comprehensive insights. Banks input AI software with data from news media, social media, and press releases to identify trends and opportunities. J.P. Morgan, for example, utilised NLP in collaboration with APG Asset Management to analyse analyst reports and central bank statements. The AI algorithm helped generate equity insights, such as spotting companies launching disruptive products (Bharadwaj, 2019).
Customer churn is the rate at which customers stop using a company's products or services over a specific period. In banking, high churn rates can indicate dissatisfaction or strong competition. Addressing customer churn is vital for maintaining a loyal customer base and ensuring long-term success. For example, A Johannesburg-based bank used Repustate's AI-powered sentiment analysis API to assess 2 million texts from a three-month social media campaign. The AI identified customer dissatisfaction related to inadequate service during lunchtime at specific branches (Bianchi, 2021).
Using these insights, the bank increased teller availability during peak times. As a result, the bank reduced customer attrition and gained new customers, demonstrating how sentiment analysis can help banks pinpoint and address factors contributing to customer churn.
The literature review of sentiment analysis techniques explores the various methods available for evaluating text sentiment and their effectiveness in capturing nuanced opinions from large datasets. These insights help identify best practices and guide the selection of the most appropriate models for our use case.
Three techniques were evaluated for sentiment analysis, each offering different advantages depending on the use case.
- TextBlob: A Python library that uses the Natural Language Toolkit (NLTK) for NLP tasks, including sentiment analysis. TextBlob stands out for its multilingual support, simplicity, and user-friendly interface. However, it relies on pre-trained models, which can limit its performance on domain-specific data or complex texts. Despite these constraints, its ease of use makes it a popular choice for straightforward sentiment analysis tasks (TextBlob, n.d.).
- VADER: Valence Aware Dictionary and Sentiment Reasoner (VADER) is a lexicon and rule-based approach that specialises in assessing short, informal texts, such as social media content. VADER offers speed and simplicity, making it well-suited for real-time applications and handling large datasets. It excels in interpreting slang, emoticons, and casual language, but may struggle with longer, more complex texts and may lack adaptability to changing linguistic trends due to its fixed lexicon (Bajaj, 2023).
-
Transformer-based Models: Advanced deep learning models such as Bidirectional Encoder Representations from Transformers (BERT) have become the state-of-the-art in sentiment analysis. These models excel in understanding complex and nuanced texts due to their deep learning architectures, providing high accuracy and context-aware predictions. They are well-suited for handling large datasets and lengthy texts but may require significant memory and processing power. Additionally, specialised knowledge is often necessary for implementation and fine-tuning (Lokare, 2023).
- Models selected: The transformer models include Aift, which is optimised for reviews with multiple labels, as well as roBERTa and BERTweet, two of the most popular sentiment analysis models, reflecting their high level of reliability.
In our evaluation of the various models using a curated testing dataset, BERTweet emerged as the top performer across all assessed metrics, as evidenced by the generated plots. In particular, BERTweet performed the best in terms of recall, where it demonstrated a strong ability to detect negative sentiment accurately, thereby reducing the chance of missing critical negative feedback. This strength is especially valuable for applications where capturing all nuances of sentiment, particularly negative ones, is crucial for actionable insights and decision-making.
By utilising the transformers
library, specifically the pipeline
module (details here), we conveniently make use of finiteautomata/bertweet-base-sentiment-analysis
model for our sentiment analysis:
self.pipe = pipeline("text-classification", model="finiteautomata/bertweet-base-sentiment-analysis", top_k=None, truncation=True)
The pipeline is then called with the review to analyse:
categories = self.pipe(review)
The results are then compiled and used within our data pipeline.
Bajaj, A. (2023, April 19). Can Python understand human feelings through words? – A brief intro to NLP and VADER Sentiment Analysis. Analytics Vidhya.
Bianchi, N. (2021, February 1). 8 Business Examples of Sentiment Analysis in Action. Repustate.
Bharadwaj, R. (2019, July 2). Sentiment Analysis in Banking – 4 Current Use-Cases. Emerj Artificial Intelligence Research.
Kalita, D. (2022, May 6). A comprehensive overview of sentiment analysis. Analytics Vidhya.
Lokare, G. (2023, February 4). Effortless Sentiment Analysis with Hugging Face Transformers: A Beginner's Guide. Medium.
MonkeyLearn. (2020, April 9). 8 Applications of sentiment analysis.
TextBlob. (n.d.). TextBlob: Simplified Text Processing.