Determine tweet sentiment using machine learning.
Front end allows user to input a tweet. Twitter API used to get that tweet's replies. Sentiment analysis applied to replies to gauge sentiment toward original tweet.
- the interactive front-end of our project
- code that trains the model for the back-end of the demo (bertweet_train_final_model.ipynb)
- exploration and other code not part of the demo
conda install nodejs (version 17.9.0)
change current directory to demo directory
npm install express (version 4.18.1)
npm install python-shell (version 3.0.1)
*note: conda has npm by default
conda install lxml (version 4.9.0)
conda install tweepy (version 4.10.0)
conda install pandas (version 1.4.2)
conda install tensorflow (version 2.8.1)
conda install transformers (version 4.19.2)
conda install matplotlib (version 3.5.2)
conda install dataframe_image (version 0.1.1)
- model weights (bertweet_FullTrained.h5) must be downloaded and placed into the demo folder
- on command prompt/terminal, run: node index.js
- in browser, open: http://localhost:3000/
- tweets must be in form: https://twitter.com/userName/status/tweetID
- tweets must be less than 7 days old