Aspect Based Sentiment Analysis
Jamie Hudson
A look at the murky waters of sentiment analysis
Imagine you’re analysing a post on social media discussing the latest Microsoft Copilot release
A traditional sentiment analysis would try to determine if this review is overall positive, negative, or neutral by looking at the text as a whole.
This is done at the document or post level. Each post will have a single sentiment assigned to it.
Here, it would be quite clear that the sentiment for this post should be positive- terms like “brilliant” clearly inform the model.
There is one opinion, one product, one sentiment
But in reality, social media rarely fits this mould…
Let’s look at a post taken directly from social Note this is a Reddit post, so typos and style of writing are authentic
How would a sentiment classification model classify this text?
Even advanced AI models disagree on the overall sentiment.
This makes sense…
…assigning a single sentiment label to this post is difficult, and often oversimplifies the true content of the post.
In traditional analysis, we would identify that Microsoft (directly and through the mentions of Bing), Google, and OpenAI (through the mention of ChatGPT) appear in this post, and would all be considered the same document-level sentiment (negative if we follow GPT-4).
However, looking at each of these mentions, we can see that the sentiment associated to each brand (or product) is nuanced.
Bing, for example, appears not only in a positive situation
but also negative
and neutral way
So how can we take this nuanced approach into consideration?
I am addicted to it, it can very realistically
pretend to be anyone you want and the replies
would make you feel like you seriously are talking
to that person but seriously, the amount of
restrictions Microsoft has given to bing is truly
annoying, is there any other version of bing vailable
on google that has no restrictions or at least is
there a way to jailbreak it like chatGPT?
Please share link, if there’s any”
GPT-4: Negative
Sprinklr: Negative
GPT-3.5: Positive
RoBERTa: Positive
I am addicted to it, it can very realistically
pretend to be anyone you want and the replies
would make you feel like you seriously are talking
to that person but seriously, the amount of
restrictions Microsoft has given to bing is truly
annoying, is there any other version of bing vailable
on google that has no restrictions or at least is
there a way to jailbreak it like chatGPT?
Please share link, if there’s any”
GPT-4: Negative
Sprinklr: Negative
GPT-3.5: Positive
RoBERTa: Positive
I am addicted to it, it can very realistically
pretend to be anyone you want and the replies
would make you feel like you seriously are talking
to that person but seriously, the amount of
restrictions Microsoft has given to bing is truly
annoying, is there any other version of bing vailable
on google that has no restrictions or at least is
there a way to jailbreak it like chatGPT?
Please share link, if there’s any”
GPT-4: Negative
Sprinklr: Negative
GPT-3.5: Positive
RoBERTa: Positive
I am addicted to it, it can very realistically
pretend to be anyone you want and the replies
would make you feel like you seriously are talking
to that person but seriously, the amount of
restrictions Microsoft has given to bing is truly
annoying, is there any other version of bing vailable
on google that has no restrictions or at least is
there a way to jailbreak it like chatGPT?
Please share link, if there’s any”
GPT-4: Negative
Sprinklr: Negative
GPT-3.5: Positive
RoBERTa: Positive
I am addicted to it, it can very realistically
pretend to be anyone you want and the replies
would make you feel like you seriously are talking
to that person but seriously, the amount of
restrictions Microsoft has given to bing is truly
annoying, is there any other version of bing vailable
on google that has no restrictions or at least is
there a way to jailbreak it like chatGPT?
Please share link, if there’s any”
GPT-4: Negative
Sprinklr: Negative
GPT-3.5: Positive
RoBERTa: Positive
I am addicted to it, it can very realistically
pretend to be anyone you want and the replies
would make you feel like you seriously are talking
to that person but seriously, the amount of
restrictions Microsoft has given to bing is truly
annoying, is there any other version of bing vailable
on google that has no restrictions or at least is
there a way to jailbreak it like chatGPT?
Please share link, if there’s any”
GPT-4: Negative
Sprinklr: Negative
GPT-3.5: Positive
RoBERTa: Positive
This is where ABSA (Aspect-Based Sentiment Analysis) comes into play!
Aspect-Based Sentiment Analysis (ABSA) is a facet of sentiment analysis that dissects textual data into different aspects, or components, and determines the sentiment associated with each aspect individually. Rather than categorizing sentiment on a document-level, it does so based on these determined aspects.
ABSA offers a much deeper and more granular understanding of sentiment by breaking it down into specific aspects, such as features, products, and brands, rather than treating the entire text as a whole.
ABSA does not and should not replace traditional sentiment analysis; rather, it complements it by addressing specific business questions that require a more granular perspective on sentiment in online conversations.
How does it work?
Let’s assume we have 100 social media posts, each one labelled as either Positive, Negative, or Neutral
We could visualise these posts in a waffle chart, where each square represents a post and the colour represents document level sentiment
Or…
We could use ABSA to look at the specific sentiment associated to entities (i.e. brands or products) of interest.
To do this, let’s change the colour for entity sentiment, so it is clear when we are looking at document-level sentiment vs entity-level sentiment.
Now we have Positive, Negative, or Neutral
By looking at this more nuanced sentiment, we can see that actually each of these posts could possibly contain different sentiment for different entities
What does this mean?
Let’s look at our document-level posts again
And more specifically this example post
Where the traditional sentiment
matches the ABSA sentiment (remember, in this document we have document-level positive and entity-level positive
meaning that we would have inferred the same result if we did document-level or entity level sentiment analysis
However, there are other cases where we would get different results based on whether we look at document-level or entity level sentiment.
For example, these two posts are negative at a document-level
but the specific entities are positive (i.e., “I’ve had it with technology today. My computer crashed again, but credit to Microsoft’s customer service - they were helpful!”).
The true power of ABSA lies in its ability to pinpoint specific entities relevant to the research project at hand
For instance, by tallying the frequency of each entity mentioned in both positive and negative contexts, we can discern how these are referenced at a much finer level of granularity.
In this sample of 100 posts, Microsoft is mentioned positively 34 times…
… and negatively 8 times
While the higher frequency of Microsoft mentions is expected due to the nature of the data (the original data is from a very MSFT specific project), what provides value is the realisation that Microsoft is mentioned in a positive sense over x4 more frequently than a negative one, in contrast to brands like OpenAI which are mentioned positively only x2 as often as negatively.
Finally we can compare this result to what we would have assumed if we had just looked at document level sentiment for mentions of Microsoft
So whereas at a document-level we might assume Microsoft is mentioned ~2x as much in a positive light than a negative light, in reality when Microsoft is mentioned, 71% of the time it is mentioned positively
Finally, we can expand this to other entities too.
For example, this shows us the number of positive and negative mentions at a document-level for some potentially important entities.
We could infer from this (albeit with minimal data), that there are more positive mentions of ChatGPT than negative
Whereas when we look at this from the view of specific entity aspects, we can see that in reality the specific mentions of ChatGPT skew negative
| Brand or Product | # of Positive Mentions |
|---|---|
| Microsoft | 34 |
| OpenAI | 8 |
| ChatGPT | 6 |
| Bing | 5 |
| Azure | 3 |
| Brand or Product | # of Positive Negative |
|---|---|
| Microsoft | 8 |
| 4 | |
| OpenAI | 4 |
| GPT | 3 |
| ChatGPT | 2 |
| Brand or Product | # of Positive Mentions |
|---|---|
| Microsoft | 34 |
| OpenAI | 8 |
| ChatGPT | 6 |
| Bing | 5 |
| Azure | 3 |
| Brand or Product | # of Positive Negative |
|---|---|
| Microsoft | 8 |
| 4 | |
| OpenAI | 4 |
| GPT | 3 |
| ChatGPT | 2 |