Giter Site home page Giter Site logo

twitter-sentiment-analysis-got's Introduction

twitter-sentiment-analysis-got

Data Streaming Pipeline on GoT tweets for Series Finale

This small project was meant to run sentiment analysis on Tweets just a week after the season finale of Game of Thrones. There was a lot of negative feedback and so I wanted to stream a small percentage of tweets for just 15 minutes. Then I took that dataset, cleaned it, and ran some very basic sentiment analysis.

Setup

Pre-requisites

  • Postgres installed and running in your env
  • Python3
  • Twitter Api Keys (available on Twitter's developer portal)

Create a virtual environment

python -m venv venv
pip install -r requirements.txt

Export Twitter keys and Postgres password as environment variables

export CONSUMER_KEY=<consumer_key>
export CONSUMER_SECRET=<secret_key>
export ACCESS_TOKEN=<access_token>
export ACCESS_TOKEN_SECRET=<access_token_secret>
export password=<postgres_password>

Run scripts

The clean data is already available in the data/ directory from when I streamed the tweets just a week after the season finale. If you were to run this now, the results would be substantially different since the series ended on May 19, 2019.

However, you can change the trace keywords to whatever you desire.

Once that has been decided, run the streaming script that ingests each tweet into your local Postgres database.

python StreamSQL.py

To see the results of the sentiment analysis run

python exploration.py

Then feel free to add any Data Visualizations you desire with the transformed data.

twitter-sentiment-analysis-got's People

Contributors

dependabot[bot] avatar kayne10 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.