Twitter-Mining

Acquisition and visualization of tweets.

View the Project on GitHub saverymax/Twitter-Mining

What’s going on with Trump and Twitter?

President Trump’s most commonly used words, in his 500 most recent tweets Trumps most commonly used words in his 500 most recent tweets

And his most common hashtags Trumps most commonly used hashtags in his 500 most recent tweets

Well that’s interesting but what words frequently coocur? trumps coocuring words

And a slightly trimmed network:

trumps coocuring words

And what is going on over time? Here’s an interactive time series documenting Trump’s tweets and tweet metrics, from December 2017 to March 2018 here

And a time series from March 2018 through May here

To get an idea of what trump topics about, here is the t-SNE plot of an LDA topic model. Each point is a tweet. Hover your mouse over each point to read the text of the tweet. The legend shows the words that best represent each topic cluster.

However, since this is a relatively small data set, the LDA algorithm does not do a super great job of clustering tweets, and there are definitely some tweets that do not really belong in the cluster they have been grouped in. I’ll include another plot that does not include any tweets with a low probability of being in any given cluser, sometime. See the plot here

Words most representative of each topic

topic words in trumps tweets

And word networks for a few of the topics

Russia topic:

topic_word_networks

great, today, whitehouse topic

topic_word_networks

fake news topic

topic_word_networks

trade and china topic:

topic_word_networks

Change of a few interesting words over time. Compare to plot below.

trumps word use over time

Time series of the topics trump is tweeting about

trumps topics over time