Coder Social home page Coder Social logo

jeffistyping / elections-sentiment Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mathemakitten/elections-sentiment

0.0 0.0 0.0 136.97 MB

dashboard for 2019 Canadian Federal Elections, including natural language processing for entity recognition

Python 99.88% Jupyter Notebook 0.12%

elections-sentiment's Introduction

2019 Canadian Federal Elections Sentiment

This is an analysis of the 2019 Canadian election, as told by the ongoing Twitter conversation.

Election date: October 21

Twitter queries

Tweets are counted in this dataset if they use an official election hashtag, or are tweeted by an official party leader.

QUERY = '#cdnpoli OR #elxn43 OR #polcan OR #ItsOurVote OR #CestNotreVote OR from:justintrudeau OR from:AndrewScheer OR from:ElizabethMay OR from:theJagmeetSingh OR from:MaximeBernier OR from:yfblanchet'

Dataset

  • 180 days (6 months) of data from Twitter from March 29 - September 25 2019 (11am), one month leading up to the election
  • No other constraints (i.e. min_faves, retweets, geo, etc.)
  • Tweets can be in English or French (or any other language)
  • Twitter has stated that there has not been any wide-scale disinformation campaigns on the election as of September 24 2019
  • It takes ~7 minutes to scrape a day's worth of tweets (25k tweets), 7 * 180 minutes = 21 hours (+30 seconds for sleep, lol)
  • As of end of September, ~900k (Oct 3: 983588) tweets with 15 columns: 'username', 'to', 'text', 'retweets', 'favorites', 'replies', 'id', 'permalink', 'author_id', 'date', 'formatted_date', 'mentions', 'hashtags', 'geo', 'urls'

Methodology

  • The dashboard is built with Plotly + Dash, and (will be) hosted on Google App Engine
  • Tweets are encoded with Universal Sentence Encoder after tokenization with the NLTK TweetTokenizer

Limitations

  • Twitter data needs to be re-scraped every few days because favorites & retweets are monotonically increasing over time. It currently takes 24-36 hours to scrape March 29 - today.

elections-sentiment's People

Contributors

mathemakitten 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.