Figuring out what Democratic candidates care about
In the wide field of Democratic presidential candidates, who cares about what topics and how do these topics change over time?
natural language processing text analysis topic modeling
Readings and links
While sentiment analysis is probably the most popular approach to analyzing tweets, sometimes you care more about what's being said as opposed to how it's being said. In this piece from Bloomberg, tweets are semi-automatically categorized and topics are shown to wax and wane over the course of a Democratic candidate's path.
We'll use this to illustrate how to obtain large numbers of tweets, as well as how to use topic modeling and keyword matching to automatically categorize tweets. In the spirit of completeness we'll finish by strong-arming matplotlib into displaying our results as a streamgraph!
Bloomberg piece by Allison McCartney, with assistance from Mira Rojanasakul, Cedric Sam, and edited by Alex Tribou.
Notebooks, Assignments, and Walkthroughs
While you can't use the API to get this many tweets, there is a way around it!
Let's find out if topic modeling will help us uncover patterns inside presidential candidate tweets
Using a list of keywords, we'll assign categories to tweets for later analysis
We'll use pandas and matplotlib to create (somewhat ugly) streamgraphs from categorized Democratic presidential candidate tweets