Sentiment Analysis using Machine Learning.pdf

OmSatpathy 156 views 28 slides Aug 28, 2023
Slide 1
Slide 1 of 28
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28

About This Presentation

Text based sentiment analysis techniques using Machine learning, advantages and challenges to overcome.


Slide Content

Sentiment Analysis
Presented By-Rebecca Williams

Overview:
1.Abstract
2.Introduction
3.What is Sentiment
Analysis ?
1.Applications & uses
2.Advantages
3.Step by Step process of SA
4.Simple Example using TextBlob

Abstract
●Tripletalaqisalsoknownastalaq-e-biddatinstantdivorce.ItisakindofIslamicdivorceusedby
MuslimsinIndia.ItallowsMuslimsmantodivorcetheirwifelegallybysimplystatingtheword
‘Talaq'threetimesinanyformwhichcanbeinanyway(verbal,written,orinelectronicform).
●Nowaday,thehugeamountofdataispostedondailybasisonthesocialmediaplatform.Twitter
isawellknownsocialnetworkingplatformwheretheusercanposttheirviews,opinions,and
thoughtsfreely.
●Thesentimentalanalysisisaprocessofunderstandingopinions,thoughtsandfeelingsofpeople
aboutagivensubject.ThispaperanalysestweetspostedonTwitteronthesubjectTriplefromthe
year2002totheyear2019.
●Wehavetransformedunstructureddataintowell-informeddataforgettingtheinsightsofpeople.
●Themainfocusoftheworkistoanalyzethefeelingsofpeopleusingtwowell-knownAPIlike
TextBlob,andSpaCy.TheseAPIsarebasedonLexiconapproach.
●Thispaperpredictssentimentintothreeclassespositive,negativeandneutral.

Introduction
●Inthispaper,weareapplyingstatistics,naturallanguageprocessing(NLP),andmachinelearning
toidentify,analyzeandextractsomeimportantinformationfromtweets.
●Themainobjectiveistoobservethereviewer’sfeelings,expressions,thoughtsorjudgmentsabout
TripleTalak.
●SentimentAnalysiscanbedonebyeithermachinelearningorlexicon-basedapproach.Inthis
paper,wehaveappliedaLexiconbasedapproach.
●Thisisafeasibleandpracticalapproachwhichcananalyzetweettextwithouttrainingorusing
machinelearning.
●Lexiconisacollectionofwordsoronecansayitislikeadictionaryinwhichwordsarearranged
alphabetically.Thisapproachissubdividedintoadictionary-basedapproachandcorpus-based
approach.
●Hereweareusingacorpus-basedapproach.Corpusisalargebodyofwordsortextwhich
formulateasetofconceptualrulesthatgovernanaturallanguagefromtextsinthatlanguageand
examinehowthatlanguagerelatestootherlanguages.

What does Sentiment Analysis mean?
The process of computationally identifying and categorizing opinions
expressed in a piece of text, especially in order to determine whether the
writer's attitude towards a particular topic, product, etc. is positive,
negative, or neutral.

Why Sentiment Analysis?

Sentimental Analysis can used as follows:
●Social media monitoring
●Brand monitoring
●Voice of customer (VoC)
●Customer service
●Workforce analytics and voice of employee
●Product analytics
●Market research and analysis

Advantages
●Scalability:
Sentiment analysis allows to
process data at scale in a efficient
and cost-effective way.
●Real-time analysis:
A sentiment analysis system can
help you immediately identify
these kinds of situations and take
action.
●Consistent criteria:
By using a centralized sentiment
analysis system, companies can
apply the same criteria to all of
their data. This helps to reduce
errors and improve data
consistency.

What is the use of NLP in Sentiment analysis?
●Sentiment Analysis also known as Opinion Mining is a field within Natural Language
Processing (NLP) that builds systems that try to identify and extract opinions within text.
●A sentiment analysis system for text analysis combines natural language processing (NLP)
and machine learning techniques to assign weighted sentiment scores to the entities,
topics, themes and categories within a sentence or phrase.
●Natural Language Processing (NLP) is a branch of AI that helps computers to understand,
interpret and manipulate human language.

Sentimental Analysis : Step by
Step Process

Step 1: Tokenization
Tokenization is the process by which big
quantity of text is divided into smaller parts
called tokens.

Step 2: Cleaning the data
●Remove numbers
●Stemming/lemmatization
●Part of speech tagging
●Remove punctuation
●Lowercase

Step 3 : Removing the stop words
One of the major forms of pre-
processing is to filter out useless data. In
natural language processing, useless
words (data), are referred to as stop
words.

Step 4: Classification
●Rule-based systems that perform sentiment
analysis based on a set of manually crafted
rules.
●Automatic systems that rely on machine
learning techniques to learn from data.
●Hybrid systems that combine both rule
based and automatic approaches.

Step 5: Apply Supervised Algorithm for
Classification

Step 6: Calculation

How to classify Sentiment?

Machine Learning/Automatic
This approach, employes a machine-learning technique and diverse features to construct a classifier that
can identify text that expresses sentiment. Nowadays, deep-learning methods are popular because they
fit on data learning representations.
Lexicon-Based/Rule-based
This method uses a variety of words annotated by polarity score, to decide the general assessment score
of a given content. The strongest asset of this technique is that it does not require any training data,
while its weakest point is that a large number of words and expressions are not included in sentiment
lexicons.
Hybrid
The combination of machine learning and lexicon-based approaches to address Sentiment Analysis is
called Hybrid. Though not commonly used, this method usually produces more promising results than the
approaches mentioned above.

Algorithms used :
There are three machine learning classification algorithms that are predominantly used for sentiment analysis:
●Support Vector Machines (SVMs)
●Naive-bayes
●Decision Trees
Each has its own advantages and drawbacks; however, a few different studies have concluded that the Naive-Bayes
classifier is the more accurate of the three.
There are also two main algorithms used within a lexicon based approach:
●Corpus
●Dictionary
The most accurate and best approach is a combination of both. However, today we’ll go into one of the more widely
used machine learning algorithms which is the Naive-Bayes algorithm.

Let’s see a simple example :

What is TextBlob?
TextBlob is a python library and offers a simple API to access its methods and perform basic
NLP tasks.
The sentiment function of textblob returns two properties, polarity, and subjectivity.
Polarity is float which lies in the range of [-1,1] where 1 means positive statement and -1 means
a negative statement. Subjective sentences generally refer to personal opinion, emotion or
judgment whereas objective refers to factual information. Subjectivity is also a float which lies
in the range of [0,1].

Code example:-
from textblob import TextBlob
Feedback1 ="unbelievably disappointing"
Feedback2 ="Terrible pitching and awful
hitting led to another crushing loss."
Feedback3 ="this is the greatest screwball
comedy ever filmed"
Feedback4 ="It was pathetic.The worst
part about it was the boxing scenes."
blob1= TextBlob(Feedback1)
print(blob1.sentiment)
blob2= TextBlob(Feedback2)
print(blob2.sentiment)
blob3= TextBlob(Feedback3)
print(blob3.sentiment)
blob4= TextBlob(Feedback4)
print(blob4.sentiment)

Output
Sentiment(polarity=-0.6, subjectivity=0.7)
Sentiment(polarity=-0.5333333333333333, subjectivity=0.9666666666666667)
Sentiment(polarity=1.0, subjectivity=1.0)
Sentiment(polarity=-1.0, subjectivity=1.0)

“Just as knowledge makes human
intelligent, data makes software
intelligent.”
-Amarpreet Kalkat, Frrole

Any Questions???

Thank you
Tags