The success of Any company directly depends on its customers. If the customer likes the product then is your success. if they don’t then you need to improve the quality of your product. So how will you know that your product is a success or not, well for that sentiment analysis comes into the picture.
What is sentiment analysis?
Sentiment analysis is a study analyzing sentiment on the basis of the piece of text or opinions and then categorizing that sentiment into the positive, negative, or neutral.Every customer before purchasing the product does look for feedback about the product of a particular company hence here also sentiment analysis plays an important role
History of sentiment analysis
Sentiment analysis study started in the 1950s when sentiment analysis was mainly used to happen on the written paper documents.
Though, there are many websites, news reviews, social media platforms are there which are filled with tons of public opinionated data. There are also various methods including NLP, statistics, and machine learning methods. However, Many big companies use information and feedback or reviews to retain customers and to build a better strategy for their product.
Examples of positive and negative sentiments
- Positive: If the complete review has a happy/positive /joyful/excited attitude or if something is mentioned with a positive view. Also, if more than one sentiment is expressed in the Review but the positive sentiment is more dominant. E.g.: – I love the product. It’s amazing.
- Neutral: If the review expresses no personal sentiment/opinion in the review and also merely transmits information. Expressions less or without any cheering such as neutral review. E.G.: -product is ok.
- Negative: If the entire review has a negative/sad/displeased attitude or if something is mentioned with negative connotations. Also, if more than one sentiment is expressed in the review but the negative sentiment is more dominant. E.G.: -product is not up to the mark, disappointed by the product.
How does it work?
1. Tokenization
It is the process in which we break a long sentence or lines of text into words and meaningful elements which here represent “tokens”. Which we will be able to fetch the meaning of sentence and way.
Let us consider a sentence
This food was delicious!
- The
- food
- was
- delicious
- !
2. Cleaning the data
To remove all character special which do not add value to the analytics part.
This food was delicious !
- The
- food`
- was
- delicious
In the above example we removed the exclamation mark
3. Removing the stop words
In steps we will remove the words which do not add any value to the sentence example of the words a , the , when etc.
This food was delicious!
- food
- Delicious
Here we are left with two words and we removed this and was.
4. Classification
In this classification technique we will classify the word into positive and negative and neutral
Positive +1
Negative -1
Neutral 0
Now we are left with only 2 words
- food`+/-
- Delicious +/-
Hence for food will give +1 and for food which Neutral we will give as 0
5. Classification On basis Machine Learning Model
Apply supervised algorithms for the classification
Train your model with a bag of words or lexicous and test it on the analyzing statement
The more the accuracy score better will the classification
Food —-> 0
Delicious —–>1
0+1=1
Since the polarity is greater than 0 so that given statement is positive
6. Machine learning algorithms for sentiment analysis
Mostly the supervised learning algorithms are used in sentiments analysis
1. Naïve Bayes
2.Support vector machine algorithm
3.Dicision tree algorithm
4. Random forest algorithm
Application:-
- The Twitter analysis is one of the applications of sentiment analysis
- Feedback Analysis
- Product Analysis
- It mostly used in social media platforms
written by: Triveni Kohale
Reviewed By: Vikas Bhardwaj
If you are Interested In Machine Learning You Can Check Machine Learning Internship Program
Also Check Other Technical And Non Technical Internship Programs