Inspiration

There’s been a lot of controversy regarding the Covid vaccines since they came out early this year. Most of what we’ve seen on social media has only aligned with our views since the groups people place themselves in tend to have similar ideas We decided to set out and try to see how the general public on Twitter really felt about the vaccine. This is why we created our program, Twaccine (Twitter Vaccine) bot.

What it does

Grabs 100 tweets with keyword “vaccine” Tells how many tweets have positive, negative, or neutral stances on the vaccines We then can graph the data on a chart to see the trend in public opinion on the vaccine over a period of time (for PennApps, we only had time to see the trend over 2 hours)

How we built it

Our program uses Twython to access Twitter’s API to pull tweets off of twitter that have the key word “vaccine”, analyzes them using twinword’s sentiment analysis and provides us with one of 4 ratings: positive, negative, neutral, or “not in English”.

Challenges we ran into

Re-learning python We realized soon that some of the tweets being labeled as “neutral” were just tweets in different languages We combatted this by including a filter that would keep count of how many tweets were in a different language and label them accordingly (so they wouldn’t be labeled as positive, negative, or neutral) Sentiment analysis looks at tone Being against opposing something sometimes sounds negative Some neutral and positive tweets will be labeled negative by the api We have hid our consumer_key, access_token, and headers because of security reasons

Accomplishments that we're proud of

We’re extremely proud that we were able to pivot to a new idea and still complete the project on time as first-time hackers.

What we learned

How to use twython to access the twitter api Technology has flaws in judging human language

What's next for Our Twaccine Bot

We hope that we can try this on a larger scale by analyzing more than 100 tweets at a time, and taking samples across a longer time period. We think that this program is relevant to the situation we are in now and will continue to be relevant as long as there is controversy regarding the Covid Vaccine

Built With

  • python
  • twinword-sentiment-api
  • twitter-tweets-api
  • twython
Share this project:

Updates