Select Page

Python: Project #MeToo with Twitter and Sentiment Analysis

6 . 01 . 2018

Following up my previous post on updating your tweets from your terminal, I wanted to determine how the public feels about the #MeToo movement on Twitter that was recently rekindled by actress Alyssa Milano. To do that, I needed to use some kind of text analyzer for social media. Thanks to Siraj’s video tutorial, I was able to use TextBlob to effectively mine Twitter data for various opinions.

Read about #MeToo here and here.

A few questions I was interested in:

  1. What is the common tone projected through these tweets?
  2. How subjective are they?

At the end of this project, I managed to export the information I’ve extracted with my code to a csv file.

(My journey to exporting codes to a csv file here.)

I also wanted to organize my csv file to increase its readability. Here, I’ve organized them into four columns: Tweets, Polarity, Subjectivity, and URL. My last touch on the tweets will be to clean up the URLs nested within the original tweets since I’ve allocated a column at the end for viewing convenience. (Will be updated soon!)

What I’ve noticed from this project is that there are a ton of tweets being posted every. single. minute. However, most of them have shown to be repeated retweets, as you can see from my first screenshot. These tweets extracted in real time were all arranged in random orders.

Here’s another one to prove my point.

And who would ever forget,

What happens when you search for ‘Trump’. Try to match the tweets!

Here’s my code:

Back to my questions above:

  1. What is the common tone projected through these tweets?
    After multiple tests, I’ve found them to be leaning more towards the positive side. That’s odd; how did “sexually harassed” receive a 0.43, whereas “slow tear” received a score of -0.30? (both from the first screenshot)
  2. How subjective are they?
    Most of them lean towards the subjective side (>0.5). This is based on the tweets I’ve screened — many of them seemed to be coming from expressing personal issues or judging celebrities’, rather than discussing the #MeToo movement from a wider perspective.
Comments
1 Comment
  1. lamming

    Ꮋello there, just became alert to your blog through
    Google, and found that it is really infߋrmative. I’m ɡoing tо
    watch out for brussels. I will be gratefսl if you continue this in futᥙre.
    Numerous people will be benefitеd from your ѡriting.
    Cheers!

    Reply

Submit a Comment

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