Twoogle is a Twitter sentiment analysis search engine for retrieving and classifying real-time COVID-19 vaccination-related tweets. The application is powered by DistilBERT fine-tuned on Coronavirus Tweets Dataset.
Included in this repository is a large (> 250 MB) pre-trained model. This model was trained on a subset of the above dataset. First install the Git Large File Storage (Git LFS) extension to retrieve this model during cloning.
Once Git LFS is successfully installed, clone this repository and cd
into the root folder:
git clone https://github.com/hadiqa01/Twoogle.git && cd Twoogle/
Run the following commands (preferrably from a Python virtual environment):
pip3 install --upgrade pip
pip3 install -r requirements.txt
python3 main.py
Then go to the following address in your browser:
127.0.0.1:5000/
The webpage is a simple interface that allows you to search for real time tweets using a query of your choice.
For a query with multiple terms, we recommend that you explicitly concatenate the terms:
You can also try out the model using copied tweets or text of your choice. To do this, simply run analyze.py
with a text string argument from the root folder of the repository (ensure Git LFS is already installed):
python3 analyze.py "Not sure what to think but perhaps the Moderna shots work."
returns
The sentiment for the text 'Not sure what to think but perhaps the Moderna shots work.' is POSITIVE with a probaility of 0.98905.
python3 analyze.py "Does the J&J one-shot vaccine work at all? Asking for a friend."
returns
The sentiment for the text 'Does the J&J one-shot vaccine work at all? Asking for a friend.' is NEGATIVE with a probaility of 0.99597.
Note: The example texts do not necessarily reflect the sentiments (no pun intended) of the team.