Twitter Sentiment Analysis
Python, Flask
Fetch tweets using twitter api: https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-tweets
Using Azure's cognitive services to calculate sentiment scores https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/quickstarts/client-libraries-rest-api?pivots=programming-language-python&tabs=version-3-1#language-detection
Using Wordcloud to generate a wordcloud: https://amueller.github.io/word_cloud/index.html
Get a twitter developer account (https://developer.twitter.com/en/apply-for-access) and an azure account (https://azure.microsoft.com/en-us/services/cognitive-services/) and add your own tokens in the config.yaml in twitter-SA-backend/services/web/project
.
From twitter-SA-backend/services/web/
, run docker build -t twitter-sa-backend .
and then docker run -p 5000:5000 twitter-sa-backend
. This should run the backend on localhost:5000
.
Using React: https://reactjs.org/
Using CanvasJS for Donut chart: https://canvasjs.com/
Using Tailwind for styling: https://tailwindcss.com/
From twitter-sentiment-analysis-frontend
, run npm craco start
. This will run the frontend on localhost:3000
Example when running analysis on @certikorg:
Video of running an analysis on @certikorg (There are a lot of tweets so the service from Azure takes time, hence the slow load time shown here):
React.App.-.Brave.2021-05-27.02-30-17.mp4
Mobile views:
References: https://developer.twitter.com/en/docs/tutorials/how-to-analyze-the-sentiment-of-your-own-tweets