Twitter Sentiment Analyzer

Project Overview

Companies are often concerned with public perception regarding their products, especially following a product launch or marketing campaign. As such, we created a system that can retrieve recent tweets about a specific topic such as a company or product. The system then performs sentiment analysis on the tweets using PySentimiento's BERT-base model in conjunction with a Twitter-specific tokenizer. The tweets are then classified as positive or negative and the results are charted, so businesses/companies can quickly, easily, and cheaply evaluate public sentiment trends.

Moreover, this project was predacated on the results of our research, testing, and implementation of various combinations of features and classifiers to perform sentiment analysis. In short, we trained and tested combinations of [TF, TF-IDF, and BERT-emeddings] as features and [Naive Bayes, Linear SVM, and Logistic Regression] as classifiers. We found BERT models significantly outperformed others, so we used PySentimiento for our web app, as it was inexpensive and effecient. For further details please view the written report and poster.

Date: Winter 2022

Project Role

I worked in tandum with another group member to develop and implement the web app and all its core functionality. This included the Flask app routes, Twitter API functionality, PySentimiento functionality, and data plots. Furthermore, I added all CSS using bootstrap as the original app was barebones HTML. I also added an "About" page to provide a project summary as well as instructions to users. In addition, I worked alongside group members to contribute to the training of our models in a lesser capacity. Lastly, I was responsible for the plurality of the work for the poster and written report.

Relevant Technology

  • Python
  • Matplotlib
  • Scikit-learn
  • Naive Bayes
  • Linear SVM
  • Logistic Regression
  • PySentimiento
  • Flask
  • Twitter API
  • HTML
  • Bootstrap
  • CSS

Relevant Skills

  • Information Retrieval
  • Natural Language Processing
  • APIs
  • Dynamic server-side rendering
  • Project presentation
  • Formal writing
  • Git collaboration and version control