Was Captain Marvel Bad? A Sentiment Analysis of Twitter Data
Key Takeaways
The video demonstrates a sentiment analysis of Twitter data using Python, Twitter Scraper, and Vader Sentiment tool to determine the general feeling about the movie Captain Marvel, comparing it to Avengers: Infinity War.
Full Transcript
hello everyone can hear back with a new data science video today I wanted to do something special I saw that there was a lot of really negative reviews of Captain Marvel on YouTube and some other resources and I wanted to see what the crowd thought what the Twitterverse thought so I am doing a sentiment analysis on Captain Marvel I'm also comparing it to Avengers infinity war horse in context if this interests you if you liked the video please hit that like button and if you'd like to see more like it please subscribe I do this analysis in Python and a couple of the modules are very helpful and actually getting this doc so the first module that I'd like to give a shout out to is Twitter scraper so it's more simple than Twitter trust API you don't need any login or credentials or anything like that and it also gets through some of the limitations of that API where you can go back in time as far as you want which is really cool I also use the Bader sentiment tool which it takes a lexicon approach to sentiment analysis so it has a big dictionary of words and it attaches sentiments to each one of those and also based on the context that the word is used it gives it a sentiment score there are a couple different levels of score so they mark how many negative features used how many neutral features you use and how many positive features you use and that's all combined into one composite score bitter is one of the best practices in the industry it's not perfect some things do slip through the cracks but at a large scale it works very well and I'm excited to actually build this into my analysis I haven't had a ton of exposure to sentiment that's why one of the reasons why I'm actually doing this because it lets me fool around with some new tools and to explore a very interesting topic you can find three interesting links in the description below the first is a medium article that highlights well that was actually the inspiration for this video that talks about using sentiment analysis to analyze the anthem game lock the second is another medium article about the details of how they that works and the last is a link to my github where you can find the entire code base for this analysis so let's just jump into how I set up this analysis I'm not gonna go through all of the code but again if you want to see that that is in my personal github the first thing we do is import all of the relevant modules pandas were going to be using because we're converting a lot of this into a data frame to analyze it date time we're gonna be using to filter by the specific time of day and I talked about Twitter scraper and Vader sentiment analysis we're also using lang detects because we only want to evaluate english-language tweets Vader does not work as well in other languages from my experience and so that is something that we really need to do to get the most useful analysis possible we're also including some visualization tools mouth portlet and Seabourn to make it look pretty I created this detector function because for the language detection we need to make sure that it is a texturing that it's this big fit in if you feed in a number or something that is non text you will get an exception thrown so this is just saying that if there is an exception we put none in instead then we build this analyzer object and create some of the parameters for us to query the tweets I'm looking at you know three or four days before the premiere and until now basically after the premiere so we will right here actually end up queering the tweets this takes 10 or so minutes it takes a while we then put them into dictionaries so that we can put them into a data frame finally down here is where we actually sort for the English language now I would recommend saving these to CSV files your data frames now because it'll save you some rework in the future if you you know mess up Python crashes you will have that saved so you don't have to run the Twitter query again which is fairly time-consuming now let's jump into the actual sentiment analysis so right here this is pretty much all we have to do we apply our analyzer clarity scores to each of the text segments in the tweet and we get those four features that I've mentioned before the amount of negativity the amount of neutral nests the amount of positivity and the composite of those things which is your actual sentiment score we then append that to our data source and I looked at a lot of these tweets and it looks like there were a ton of duplicates so those were advertisements or things along those lines and I wanted to get rid of those so we get a true or feeling of what the people really thought so I dropped the duplicates here finally I was having some trouble filtering by date time so I switched our timestamp into day time and made sure we were only getting after premiere tweets that were actually after the premiere of midnight the day after the movie came out after looking at a histogram I saw the majority of the tweets had a sentiment score of zero which means that they weren't necessarily negative or positive for our analysis sake I removed all of those tweets because I wanted to understand the actual parity between before the movie and after the premiere had launched needless to say I was pretty surprised by the results the even before leading up to the movie it had a fairly positive sentiment score of 0.3 for and after the movie premiere the sentiment score actually went up to 0.42 that's almost a 20 percent increase which is fairly impressive it suggests to me that a lot of the Twitter community at least enjoyed the movie even in spite of what has been said on YouTube and some other mediums are in this same analysis on Avengers infinity war from last summer and I also got very interesting results Avengers before the premiere had a sentiment that was positive but lower than Captain Marvel of right around point one for after the movie had premiered the sentiment dropped to point one that doesn't surprise me a ton because of how controversial the ending of that movie was but it still surprises me that in general all of the sentiment was lower now I'm not qualified to make any claims about the quality of Captain Marvel but this analysis suggests to me that the general Twitter community didn't feel too badly about it that it was fairly well received in spite of what a lot of people were saying about it and the ratings that it got thank you so much for watching and please let me know what you thought of the movie in the comment section below if you have any questions about my analysis please leave them there as well until next time
Original Description
I have seen many mixed reviews about Captain Marvel. I wanted to determine what the general feeling about the movie was on twitter. Here I use sentiment analysis to determine what people thought of the movie leading up to it and after the premier. I also compare the sentiment of Captain Marvel to Avengers: Infinity war, the previous summer's blockbuster.
I get some very interesting results!
#DataScience #DataScienceProject #CaptainMarvel #SentimmentAnalysis
More from Ken Jee:
https://twitter.com/KenJee_DS
https://www.linkedin.com/in/kenjee/
https://medium.com/@kenneth.b.jee
https://kennethjee.com/
https://github.com/PlayingNumbers
https://kennethjee.com/
Resources:
- My Github (https://github.com/PlayingNumbers/Captain_Marvel_Sentiment)
- Inspiration for this video (https://towardsdatascience.com/sentiment-analysis-of-anthem-game-launch-in-python-16be9e5083d2)
- twitterscraper module (https://github.com/taspinar/twitterscraper)
- Vader Sentiment Analysis (https://github.com/cjhutto/vaderSentiment)
- Vader How to (https://medium.com/analytics-vidhya/simplifying-social-media-sentiment-analysis-using-vader-in-python-f9e6ec6fc52f)
#KenJee
⭕ Subscribe: https://www.youtube.com/c/kenjee1?sub_confirmation=1
🎙 Listen to My Podcast: https://www.youtube.com/c/KensNearestNeighborsPodcast
🕸 Check out My Website - https://kennethjee.com/
✍️Sign up for My Newsletter - https://www.kennethjee.com/newsletter
📚 Books and Products I use - https://www.amazon.com/shop/kenjee (affiliate link)
Partners & Affiliates
🌟 365 Data Science - Courses ( 57% Annual Discount): https://365datascience.pxf.io/P0jbBY
🌟 Interview Query - https://www.interviewquery.com/?ref=kenjee
MORE DATA SCIENCE CONTENT HERE:
🐤My Twitter - https://twitter.com/KenJee_DS
👔 LinkedIn - https://www.linkedin.com/in/kenjee/
📈 Kaggle - https://www.kaggle.com/kenjee
📑 Medium Articles - https://medium.com/@kenneth.b.jee
💻 Github - https://github.com/PlayingNumbers
🏀 My Sports Blog -https://www.playin
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Ken Jee · Ken Jee · 14 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
▶
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Predicting Crypto-Currency Price Using RNN lSTM & GRU
Ken Jee
Predicting Season Long NBA Wins Using Multiple Linear Regression
Ken Jee
How I Became A Data Scientist From a Business Background
Ken Jee
Should You Get A Masters in Data Science?
Ken Jee
How to Simulate NBA Games in Python
Ken Jee
Demystifying Data Science Roles
Ken Jee
The Best Way to Predict NBA Minutes Played
Ken Jee
IT'S NOT TOO LATE TO LEARN CODE!
Ken Jee
My Top 5 Data Science Resources for 2019
Ken Jee
Watch This Before Applying to Data Science Jobs
Ken Jee
Where YOU Should Start With Data Science Projects
Ken Jee
Welcome To My Channel | Ken Jee | Data Science
Ken Jee
Why You DON'T Want to be a WFH Data Scientist
Ken Jee
Was Captain Marvel Bad? A Sentiment Analysis of Twitter Data
Ken Jee
Data Science, Machine Learning, and AI: What's the Difference?
Ken Jee
Data Science: Startup vs. Large Corporation
Ken Jee
Where to Look for Data Science Jobs
Ken Jee
Work From Home Data Scientist: Day in the Life
Ken Jee
Scrape Twitter Data in Python with Twitterscraper Module
Ken Jee
Should You Learn R for Data Science?
Ken Jee
NASA Physicist Turned Data Scientist (Tim Bowling) - KNN EP. 02
Ken Jee
I Wish I Had Known THIS Before Starting in Data Science
Ken Jee
What I Learned From My Three Degrees
Ken Jee
Most Data Science Hopefuls Overlook This Important Skill
Ken Jee
Golf STATS: Strokes Gained Explained
Ken Jee
My Top 5 Data Science Internship Tips
Ken Jee
How I Got My First Data Science Internship (And How You Can Land One)
Ken Jee
Data Science: Pros and Cons
Ken Jee
Data Science Fundamentals: Data Exploration in Python (Pandas)
Ken Jee
Data Science Fundamentals: Data Manipulation in Python (Pandas)
Ken Jee
What Does a Data Scientist Actually Do?
Ken Jee
The Projects You Should Do To Get A Data Science Job
Ken Jee
Take Your Data Science Projects From Good to Great
Ken Jee
How To Get Data Science Experience (Without a Job)
Ken Jee
Data Science Fundamentals: Data Cleaning in Python
Ken Jee
Is Data Science Right For You?
Ken Jee
Thank You For The Support | What's Next | Ken Jee | Data Science
Ken Jee
How To Build A Word Cloud From Scraped Data (Python)
Ken Jee
6 Habits of Successful Data Scientists
Ken Jee
How Far Should the NBA 3-Point Line Actually Be?
Ken Jee
How to Stay Productive & Motivated When Learning Data Science
Ken Jee
Why is Balance Important in Data Science?
Ken Jee
By The Numbers: Where Should The NBA Put a 4 Point Line?
Ken Jee
Why Selling Is An Important Data Science Skill
Ken Jee
Applying Data Science To My YouTube Data: My Surprising Findings
Ken Jee
9 Ways You Can Make Extra Income as a Data Scientist
Ken Jee
Sports Analytics 101: The Pythagorean Theorem of Sports
Ken Jee
Golf: Would You Rather Be the LONGEST or STRAIGHTEST Driver on the PGA Tour?
Ken Jee
Data Science Fundamentals: Linear Regression
Ken Jee
How YOU Can Land a Sports Analytics Job
Ken Jee
The 5 Stages of Data Science Adoption
Ken Jee
Math Needed for Mastering Data Science
Ken Jee
5 Sports Analytics Books to Get You Started
Ken Jee
3 Reasons You Should NOT Become a Data Scientist
Ken Jee
Collision Course: Sports Betting + Data Science
Ken Jee
How to Scrape NBA Data Using the nba_api Python Module
Ken Jee
5 Data Science Resolutions for 2020
Ken Jee
The Data Science Interview: What to Expect
Ken Jee
The 9 Books That Changed My Perspective in 2019
Ken Jee
Questions You Should Ask Your Data Science Interviewers
Ken Jee
More on: Python for Data
View skill →Related AI Lessons
🎓
Tutor Explanation
DeepCamp AI