This project analyzes the sentiment of tweets by the one and only Bill Gates. If you're not familiar with him, he's kind of a big deal in the tech world (and the world in general).
To run this code, you'll need to have some keys to authenticate with Twitter. Don't worry, it's not like they're asking for your firstborn child or anything. Once you have those, just run the code and let the magic happen.
We don't want to analyze any weird characters or mentions of Bill Gates' arch-nemesis (whoever that may be), so we clean the text using regular expressions. We also remove hashtags because let's be honest, nobody likes those.
We use the TextBlob library to get the subjectivity and polarity of each tweet. In other words, we're finding out how opinionated and how positive/negative each tweet is. Maybe one day we'll be able to use this to predict the stock market or something.
This is where things get fancy. We take all the cleaned text and generate a beautiful wordcloud. It's like a work of art, except instead of paint we're using words, and instead of a museum it's just your computer screen.
Finally, we use our advanced machine learning algorithms (aka a simple if/else statement) to determine whether each tweet is positive, negative, or neutral. It's like having your own personal robot butler to tell you how you should feel about each tweet.
So there you have it. Now you too can know how Bill Gates feels about the world (or at least how we feel he feels). Just don't blame us if you get sucked into a Twitter vortex and lose track of time. Happy analyzing!