Sentiment Analysis: Justin Trudeau’s Tweets

I’ve seen sentiment analysis of Trump’s tweets done all over the internet. It makes sense- no president, political figure, or anyone for that matter, really, has used Twitter the way Trump does. Reading these analyses of Trump’s tweets, his sentiment is just all over the place. But you don’t need a text processing tool to use that, you can see this by just listening to his speeches or reading the news. It made me think, though, what do the tweets of my Prime Minster, Justin Trudeau, look like? Are his tweets more balanced in their sentiment? Is there a difference between his tweets in English versus his tweets in French? Let’s take a look!

For this analysis I’ll look at some basic tweet features: source, “retweet” and “favourite” count, and overall sentiment, for both English and French tweets. While the source and sentiment of a tweet gives us insight into Trudeau, the retweet and favourite count speaks on behalf of Canadians. Through this analysis we’ll get to learn a bit more about our Prime Minister, and a bit more about ourselves.

Canada is Different

Let’s first start by taking a look at how Canadians reacted to Trudeau’s tweets from Decemember 2016 to October 2017. This of course takes into account all Twitter users who interact with @JustinTrudeau in the form of a retweet or favourite, but I’m going to assume for now that the majority of these users are Canadians.

This is a very interesting result. The English tweet with by far the most retweets and favourites was:

There is no doubt that this tweet gained massive attention. There could be many reasons for this. First, it could be that Canada is different. We’re welcoming, and Canadians like it when our Prime Minister advertises this. Second, the response could have been from non-Canadian citizens (which would invalidate my assumption above), perhaps from refugees themselves. Third, this response could have been largely made up of Americans. With the (at the time) recent inauguration of Donald Trump as the new @POTUS, Americans could have retweeted and favourited this tweet as a way to say “look how different Canada is.”

The same tweet, in French, received the most retweets, but a different tweet came out with the most favourites.

The most favourite tweet was:

In fact, this tweet garnered many more retweets than the English version, as well. It seems that French Canadians, or French speakers in general, are keen on supporting the LGBTQ community, and like hearing this from the Prime Minister. The disparity between the number of favourites and number of retweets on this post is curious- maybe French Canadians don’t like to retweet this sort of thing?

Source and Length

Next, let’s look at the source of Trudeau’s tweets, and their length.


 

So, it seems like Trudeau uses an iPhone, but prefers to make tweets from a computer. This is drastically different from Trump, who seems to prefer tweeting from his phone.

Now, for the length of Trudeau’s tweets.

Sentiment Analysis

With the basic exploration done, let’s go onto the sentiment analysis. For this analysis I use VADER and TextBlob, the reason being that VADER is optimized for social media, but TextBlob has been optimized for French. I want to not only compare the sentiment in English and French, but also compare these two packages.

Let’s first look at the results of using VADER and TextBlob.

 

A main difference here is that TextBlob perceives the tweets to be much more neutral in both languages, where VADER interprets Trudeau’s English tweets as more positive. Let’s separate the analysis into English and French, and compare VADER and TextBlob again for a bit of clarity.

 

In English, it looks like TextBlob assigns positive tweets more often, but when tweets are positive with VADER, they are very positive. In French, the two packages yield more similar results.

Finally let’s look at the sentiment of Trudeau’s tweets, month by month.

It’s interesting that the English sentiment comes across as more positive, using both VADER and TextBlob, compared to the French tweets. French is a beautiful language, but is English just more enthusiastic? Or is that just how Trudeau tends to tweet, or can this be attributed to his command of each language and what he’s more used to? It’s good to see that the sentiment generally follows a similar pattern, in both languages, with both text processing tools. It’s also interesting to see the drop off in sentiment in October- it makes sense given the awful events that have happened in the past two days both in Edmonton and Las Vegas. We’ll have to wait to see if this downward trend continues. But if it does, it could say two things: it could be a reflection of world event, or it could mean Trudeau is feeling worn down as Prime Minister.

Thanks for reading!

The code for this analysis can be found in a Jupyter notebook on my github.


Also published on Medium.

Leave a Reply

Your email address will not be published. Required fields are marked *