Aspect Modelling in Sentiment Analysis
Prerequisite: Sentiment Analysis
Before getting into the specifics of Aspect Modelling, let us first briefly understand what Sentiment Analysis is with a real-life example.
Sentiment Analysis (SA):
It is a technique to distinguish a person’s feeling towards something or someone based on a piece of text they have written about it. It could be positive, negative or neutral. Let us consider a real-life example.
We see millions of tweets on Twitter on a daily basis. Here, we can build a sentiment analysis model to determine if their attitude towards a particular subject is happy, sad, angry or neutral. The current limitations of this technique are detecting sarcasm.
Aspect Modelling in Sentiment Analysis (ABSA):
Aspect modelling is an advanced text-analysis technique that refers to the process of breaking down the text input into aspect categories and its aspect terms and then identifying the sentiment behind each aspect in the whole text input. The two key terms in this model are:
- Sentiments: A positive or negative review about a particular aspect
- Aspects: the category, feature, or topic that is under observation.
In the business world, there is always a major need to identify to observe the sentiment of the people towards a particular product or service to ensure their continuous interest in their business product. ABSA fulfils this purpose by identifying the sentiment behind each aspect category like food, location, ambience etc.
This helps businesses keep track of the changing sentiment of the customer in each field of their business.
The ABSA model includes the following steps in order to obtain the desired output.
Step 1 - Consider the input text corpus and pre-process the dataset. Step 2 - Create Word Embeddings of the text input. (i.e. vectorize the text input and create tokens.) Step 3.a - Aspect Terms Extraction -> Aspect Categories Model Step 3.b - Sentiment Extraction -> Sentiment Model Step 4 - Combine 3.a and 3.b to create to get Aspect Based Sentiment.(OUTPUT)
Aspect: It is defined as a concept on which an opinion or a sentiment is based. Let us take an example for better understanding.
Suppose a company builds a web app that works slow but offers reliable results with high accuracy. Here, we break this text into two aspects. “Web app works slow” and “reliable results with high accuracy“. On observing the two aspect categories, you can easily conclude that they have different sentiment associated with them. (As shown in Fig 1)
The following code implementation performs the process of aspect extraction and associating it with a particular sentiment to make it model ready for training.