The 3-minute version of the video demo can be found here: https://youtu.be/Im9kq61Mhb4

Inspiration

With the power to share anything at anytime, with conversations branching into threads upon threads, and all with only 280 characters to speak, the Twitterverse is an emotional and spontaneous place. We tried to pin down the idea of #HealthyConversations on Twitter, and at the core of that, we want to help people engage in conversations about how they're feeling while remaining clear-headed and in control. That definitely isn't to say strong emotion is a bad thing, far from it! Our goal is to help people identify how they're feeling so that they can more openly accept, share, and manage those feelings.

What it does

The first step is to visit empatweet.tech! There, you can log in to EmpaTweet through your Twitter account. You will be greeted with a collection of your latest tweets, now with a emotive emoji next each one based on what our sentiment analysis model determines. If you would like, EmpaTweet can then send you a DM the next time you Tweet based on if the model detects a strong emotion in the message and which emotion (anger, sadness, fear, joy) it is.

For instance, let's say you Tweet: "I hate this hackathon! I can't get my stupid project to work!!!" Our model should identify this Tweet as a very heated one and DM you the following message if you've signed up: "Hello, friend! We noticed a bit of 😡 in your recent tweet. Here's a GIF to help cheer you up: https://tenor.com/view/dogs-watermelon-hungry-nomnomnom-gif-3426752. Please try and take a deep breathe, and don't be afraid to share how you're feeling with people who can help so we can all keep promoting #HealthyConversations!"

How we built it

To train our sentiment analysis model, we used the AutoML platform on Google Cloud. We also developed a more advanced model that used Twitter-specific feature extraction from a Weka package called AffectiveTweets and then passed those vectors into a neural network regression pipeline on Microsoft Azure's Machine Learning Designer. Unfortunately, we weren't able to fully connect this model to our project in time.

We used React.js to create the website, Express.js to manage our API, the Google Cloud Node.js library to connect with the model, and the Twit Node.js library to communicate with the Twitter API. We then hosted our own API on Heroku and deployed the website on Netlify.

Challenges we ran into

We had a lot of difficulty connecting the model we trained on Azure due to the AffectiveTweets Weka package, which was created specifically for the sentiment analysis of Tweets. We would have had to create and deploy a separate REST API in Java in order to add Weka, an open-source machine learning tool, to our workflow.

What we learned

We learned many new technologies and are extremely happy that we were able to connect all the pieces of the puzzle into a working project! Through reading some of the existing literature (1, 2, 3) related to our project, we were also fascinated by the complicated, living microcosm of society that Twitter encompasses within the 500 million tweets that are sent each day from every corner of the world.

What's next for EmpaTweet

Here is a list of potential ideas that could expand EmpaTweet to further help with mental health and healthy conversations:

  • Analyze a user's overall Tweet sentiment and based on that, offer suggestions in tone and mood to help produce a more sensitive and open-minded conversations
  • For users who have a history of Tweets with heavy negative and unhappy sentiments, EmpaTweet could suggest some resources where emotional support is available
  • Display a trend of the overall sentiment for a conversation thread, so users can be more aware and clear-headed if a thread begins to get out of hand
  • Use overall Tweet sentiment and optional survey questions to produce a prediction for overall mental state so users can be more understanding of their own emotions and be encouraged to seek help if they believe they need it
Share this project:

Updates