1. Sentiment Analysis
Submitted By : Smriti Agarwal
(B-tech DA – 3rd year)
Section : G
University Roll: 171520025
Guided By : Mr. Rahul Pathak
(Technical Trainer)
INDUSTRIAL TRAINING ON MACHINE LEARNING
2. Content
What is Sentiment Analysis?
Tool Used
What is the process?
• Getting the Data
• Cleaning the Data
• Iterating through fetched Tweets
• Data Visualization
Detailed Report
What are my next steps regarding the project?
3. What is Sentiment Analysis?
• Sentiment Analysis is the subfield of NLP(Natural Language Processing).
• It is also called opinion mining as it determines the opinion from the
text.
• A popular task in sentiment analysis is the classification of documents
based on the expressed opinions or emotions of the author.
4. Tools Used
• Spyder
• M S Excel
• Twitter Developer Account
• Tweepy
• Textblob
• Csv
• Matplotlib.pyplot
• Re
5. 01
02
03
04
Getting the data
• Make a twitter
developer account
for authentication.
• Downloading data
from twitter.
Cleaning the data
• Taking input from
user(string to be
searched).
• Cleaning the tweets
by removing special
symbols and links
from tweet.
Data Visualization
• Whether, according to
people the word is
positive or negative.
Iterating fetched tweets
• The tweets being fetched
are analyzed using textblob
technique.
What was the process?
6. Getting the Data
There are various methods to retrieve data from twitter:
• Retrieve from the Twitter public API.
• Find an existing Twitter dataset.
• Purchase from Twitter.
• Access or purchase from a Twitter service provider.
Which I implemented among them is retrieving data using twitter public API.
It took a while for authentication of twitter account to get Keys and Tokens.
7.
8.
9. Cleaning the Data
• Pre-processing the data:
Defined a function to clean the data, using library Regular Expression(re).
A list of all stop words is created and thus, removed using sub().
• E.g.: special symbols etc. the words which don’t actually contribute in analysis.
10. Iterating fetched Tweets
• To iterate through tweets we use a loop.
• Analysis of tweets is done using textblob library.
• Here, the polarity comes into picture.
11. NLTK vs TextBlob
• NLP(Natural Language Processing) is a area of growing attention due
to increasing number of applications like: medical chat-bots,
machine translations. Eg: Siri, Google Assistant.
• NLP’s NLTK being tedious and heavy was not used rather TextBlob,
which is built on the shoulders of NLTK and Pattern. A big advantage
of this is, it is easy to learn and offers a lot of features like
sentiment analysis, pos-tagging, noun phrase extraction, etc.
12. TextBlob
1. Create a textblob object and pass a string with it.
2. Call function TextBlob in order to divide text or sentence into
sequence of tokens or words.
20. What are my next steps regarding this
project?
Increasing the spectrum of different sentiments: positivity, negativity,
love, hate, fear, desire and violence. Which would provide more
understanding of texts and comments.
Notes to presenter:
Description of what you learned in your own words on one side.
Include information about the topic
Details about the topic will also be helpful here.
Tell the story of your learning experience. Just like a story there should always be a beginning, middle and an end.
On the other side, you can add a graphic that provides evidence of what you learned.
Feel free to use more than one slide to reflect upon your process. It also helps to add some video of your process.
Notes to presenter:
What did you think at first?
What obstacles did you encounter along the way?
How did you overcome those obstacles?
What images can you add to support your process?
This SmartArt allows you add images and text to help outline your process. If a picture is worth a thousand words, then pictures and words should help you communicate this reflection on learning perfectly! You can always click on Insert>SmartArt to change this graphic or select the graphic and click on the Design contextual menu to change the colors.
Feel free to use more than one slide to reflect upon your process. It also helps to add some video of your process.
Notes to presenter:
What steps will you be taking as a result of this learning experience?
Did you learn from any failed experiences? How will you do things differently?
What advice will you give to others so they can learn from your experiences?
How can you share what you learned with a real-world audience?
Some examples of next steps might be:
After delivering my first persuasive presentation, I am thinking about joining the debate team.
After making my first film, I’m considering entering it in our school film festival or local film festival.
After connecting with this career expert, I’d like to do some research on that career field because it sounds interesting to me.
This SmartArt allows you add images and text to help outline your process. If a picture is worth a thousand words, then pictures and words should help you communicate this reflection on learning perfectly! You can always click on Insert>SmartArt to change this graphic or select the graphic and click on the Design contextual menu to change the colors.
Feel free to use more than one slide to share your next steps. It also helps to add some video content to explain your message.