Codementor Events

Aspect Based Sentiment Analysis

Published Nov 06, 2017
Aspect Based Sentiment Analysis

ABSA is the analysis of a given statement, paragraph, or a huge document for getting insight about what the text or document is talking about.

By seeing the list of all nouns in a sentence or a paragraph, we can get an idea about the document or particular paragraph. If we can get the adjective that describes each noun, we will understand that paragraph more.

If we can run a sentimental analysis on each short sentence in that paragraph, we will get more information. Please don't think we are talking about a text-summarizer. It's more than that.

Suppose we are launching a new laptop. After the product launch, we are monitoring customer feedback. Because we have lots of customers across the globe, we will get lots of feedback.

If we want to analyze all of that feedback, it may take a year or several months. In short, it is impossible now, because the industry is very competitive and growing too fast.

ABSA will be very helpful in this situation. It will extract all of the nouns and adjectives and do a sentimental analysis on each sentence that has a noun.

For example, if the sentence is "Monitor of the lap is good but the battery backup is worse," it contains two nouns, monitor and battery, and each noun also has an adjective.

For monitor, its good and for battery, its worse. Monitor has a positive sentiment and battery has a negative sentiment. If we run our program on a set of feedback, we will be able to find out what features users don't like and the features they do like. We can use that information to redesign the next version of our product.

It is that simple. You can find a sample code for doing ABSA on my GitHub repository.

Thank you.. 😊

Discover and read more posts from Vishnu Ks
get started
post commentsBe the first to share your opinion
islam seaf
4 years ago

I have a file that collects comments from Facebook in Arabic, and a dictionary of negative and positive Arabic words
I would like to work on the analysis of views based on the side
How aspects are extracted
And how the polarity is analyzed for each side

Vishnu Ks
4 years ago

Hi Islam seaf,
You should have a set of positive and Arabic comments and then train a custom classifier. Check this https://textblob.readthedocs.io/en/dev/classifiers.html

Tatsiana Puchyla
5 years ago

I don`t understand how but this simple sample of code really works! Great!

Specificly it works great if there are very emotional words in sentence such as “awesome” or “awful” and doesn`t work so good with other words. But it is just extra thing that we need to thinking about. In general yout work is laconical and simple to understand. Thank you!

Vishnu Ks
5 years ago

Thanks for the comment!! This is basic classification problem in NLP. In the example code I have used textblob package in python. The sentiment classifier in textblob is trained with movie reviews dataset. If we have dataset specifically for another usecases like smart phone reviews or gadget reviews, we can train a classifier with that data and it will work well as you expected for your use case. Hope you understood. :-)

Show more replies