A Quick Guide To Sentiment Analysis | Sentiment Analysis In Python Using Textblob | Edureka

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello and welcome all to this YouTube session there's a doll from a Eureka and in today's session we'll be dealing with sentiment analysis using Python like you all know the success of a company or product directly depends on its customer right so the customer likes your product it's your success if not then you certainly need to improvise it by making some changes in it so how will you know whether your product is successful or not well for that you need to analyze your customers and one of the attributes of analyzing your customer is to analyze the sentiment of them and this is where the sentiment analysis comes into picture so starting with word is sentiment analysis well you can define sentiment analysis as a process of computationally identifying and categorizing opinions from a piece of text and determine whether the writers attitude towards a particular topic or the product is positive negative or neutral well it might be possible not as an individual every time you don't perform a sentiment analysis but you do look for a feedback right like before purchasing a product you can look for a feedback like what the other customers have to say about that particular product whether it isn't good or bad right and you analyze it manually by looking at their feedbacks now just consider at the company level so how will the company analyze what the customers is thinking about their product they don't have just one or two customers right they have more than millions of customers so what they will do so this is where the company needs to perform sentiment analysis to know whether the product is actually doing good in the market or not ok fine so now that you know what exactly sentiment analysis let's move on and see how does it actually work so let's take the statement as an example the movie was great so the very first step would be the step of tokenization so what exactly is tokenization tokenization is nothing but dividing your Pera into a different set of statements or dividing a statement into different set of words so the statement the movie was great would be further segregated into its different words so once the process of organization is done so the second step would be cleaning the data so by cleaning the data I mean to remove all these special characters or any other word which do not add any value to the analytics part so as in step two I'd be removing the special characters so I don't need this exclamation mark over here so I'm left with four words though movie was and great so next step would be removing the stop words like I said I do not need any word which do not add any value to the analytics result so the stop words like the was is he/she do not add much value to the analytics part so we can easily remove them so now we are just left with two words movie and great okay now step four is the classification step so now that you are left with just two words what your task will be your task will be to classify them as whether it is a positive word or a negative word or a neutral word for a positive word we give a sentiment score as plus one for a negative we have a minus one score and for a neutral wig of zero now this is the part where machine learning comes you can model your data with bag of words or you can use lexicons which are nothing but a dictionary of pre classified set of words and now once the model strain you can perform the test on the analysis statement and mode the accuracy score better will be the classification right if your model is too accurate then yes it will be a very good classification so well now what we have done we have classified our words as positive and negative the sentiment score of movie is zero as it's a neutral word and great is a plus one according to dictionary it's a positive word even you know that it's a positive word right so let's move on ahead and calculate the final sentiment score of the sentence now since we have just two words over here which adds some values to the analytics part so on combining the statement you can say that we have one plus zero that equals one so now you can say that since the polarity is greater than zero so the statement is positive well for a beginner level you can say that this was a step by step calculation for sentiment analysis don't worry when you are using Python it's more simple than you can think let me show you how simple is set to perform sentiment analysis in Python so for the quick start we'll be using text blob which is a Python library for processing textual data it will allow you to perform common NLP tasks such as parts of speech tagging down for his extraction sentiment analysis classification and many other things so let's start by importing text blob and calculate the polarity of each statement and determine whether the statement is positive negative or neutral all right well by the time it's executing let's define our parameters or define our feedback and let's suppose our first feedback was feedback 1 equals the food at Radisson was awesome ok and my next feedback is and the food and radisson was very good all right well as you can see a boat seemed to be almost a positive statement right but let's check how positive they're all a sentiment analysis is all about checking how positive or how negative a statement is okay so let's define our blob so my blob one will be blob of first feedback all right and my blob - will be text blob of feedback to call it so now all you need to do is print your sentiment Ripple alright so a sentiment report will consist of the measure of polarity as well as subjectivity well you can just keep it to polarity or subjectivity as well but for this video I'll be focusing on both the polarity measure as well as the subjectivity Messier so let's print a sentiment report blob dot sentiments so blob one dot sentiment and print on print block 2 dot sentiment let's see what's the result alik saw sentiment report is ready for a statement one the polarities 1.0 it's highly positive statement whereas the subjectivity it's also one point zero and four statement two you can see that the polarity is 0.9 and at subjectivities 0.7 this polarity measure will tell you how positive your statement is or how negative your statement is and this subjectivity it expresses about personal feelings views or beliefs so let's take an example like a subjective sentence so subjective expression comes in many forms example opinion allegation desires believes suspicions and speculation a subjective sentence may not express any sentiment all right for example I think that he went home and I want a camera that can take good photos these are all just subjective sentence they do not express any sentiment right so well this was very basic example so in my next video I'll show you how you can fetch data from Twitter and apply sentiment analysis on your tweet using text blob and creepy thank you all this was all for this session and don't forget to watch my next video on Twitter sentiment analysis in Python using creepy and explore thank you I hope you have enjoyed listening to this video please be kind enough to like it and you can comment any of your doubts and queries and we will reply them at the earliest do look out for more videos in our playlist and subscribe to Eddie Rica channel to learn more happy learning
Info
Channel: edureka!
Views: 154,621
Rating: 4.9303179 out of 5
Keywords: yt:cc=on, sentiment analysis, sentiment analysis tutorial, sentiment analysis in python, sentiment analysis machine learning, sentiment analysis using python, text classification, textblob sentiment analysis python, textblob tutorial, textblob python tutorial, machine learning tutorial, machine learning algorithm, textblob in python, machine learning python, python textblob sentiment, sentiment analysis training, classifier machine learning, machine learning edureka, edureka
Id: O_B7XLfx0ic
Channel Id: undefined
Length: 7min 39sec (459 seconds)
Published: Wed Aug 08 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.