The anonymity of people over the Internet and Social media platforms can make them spread fake news and use toxic comments that they wouldn't normally use in daily life. We found that a chrome extension would be both easy to use and effective in solving this problem. Our project draws from these observations to build a chrome extension that can flag such content on Twitter.

What it does

Once the chrome extension is installed in the browser, it automatically flags fake and toxic content from your feed. The extension sends each tweet to the Backend built using Flask and Tensorflow where each tweet is classified into fake or not fake and toxic or non-toxic. Both these tweets are flagged in different colours so users can ignore them whilst going through their feed. In addition to flagging the tweets, users can also view a summary or report of their twitter feed through visually appealing pie-charts and can also blur out all the tweets classified as toxic so that they won't be viewing them at all.

How we built it

The application has been built using Javascript(for the Frontend - chrome extension) and Python(for the Backend). Initially the Javascript code reads each tweet from your twitter feed and sends it to the Backend which is a Flask API. Here, BeautifulSoup is used to parse the content, author and every detail of the tweet(Although the current model only uses the tweet content, the number of likes and retweets can also be included as features quite easily). Two deep learning models, one for classifying if the tweet is fake and the other for classifying if the tweet is toxic have been built using Tensorflow. Finally the results of these models are passed back to the Frontend where fake and toxic tweets are flagged. The visualization of the twitter feed is done using google charts.

Datasets and models used

  • The fake news dataset used : link. A deep learning model with two layers was built using Tensorflow and trained for 6 epochs yielding an accuracy of 0.9925 in the test dataset.

  • The toxic comments dataset used : link. A bidirectional LSTM model was built using tensorflow and trained for 2 epochs yielding an accuracy of 0.9934 in the validation dataset.

Challenges we ran into

Connecting the Javascript code in the Frontend to the Flask API was a major challenge we faced. Also this was the first time we had built a chrome extension and it was a fantastic learning curve. We have learnt a lot and gained confidence to build more chrome extensions in the future.

Accomplishments that we're proud of

We are proud of having built a chrome extension. The application works in real-time, without much lag which was heartwarming. Using deep learning to solve day-to-day problems was the major inspiration behind our project and we hope that with a few other changes, this application can be useful for twitter users.

What's next for Twitteristic

Twitter is just the starting point for the application. The same logic can be used to make it work on news articles or basically any content on the Internet. Our goal is to stop the spread of hatred and toxicity among people and make the world a better place, in a small way.


Team #45

Share this project: