Coder Social home page Coder Social logo

prayags / covidtweet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yashrajkakkad/covidtweet

1.0 1.0 0.0 9.58 MB

Analyse and visualise tweets related to COVID-19 using LeafletJS and SQL

Python 23.47% Jupyter Notebook 33.65% HTML 19.93% JavaScript 0.68% TSQL 1.54% PLpgSQL 20.74%

covidtweet's Introduction

covidTweet

Tweet Analyzer for COVID-19


Table of Contents

Introduction

Twitter is an extremely powerful micro-blogging platform with over 300 million monthly active users and 145 million daily active users. At-least 500 million tweets are sent out per day (source). Such a powerful source of information can be tapped using its powerful API which allows us to access a lot of data from the website seamlessly.

Amidst the global pandemic of COVID-19, Twitter has witnessed hundreds of millions of tweets from millions of users. We can say without any doubt that this is a lot of information and several meaningful inferences can be derived from the same. With covidTweet,, we explore the possibility of harnessing this data and visualising it.

About covidTweet

covidTweet analyses some around 54000 tweets (a drop in the ocean) by fetching, storing and processing data on a relational model. A tweet contains a lot of information, often much more than what directly appears over the platform normally. We take what is useful in our context to prepare our schema.

Technology Stack

  • PostgreSQL v12
  • Flask
  • SQLAlchemy ORM
  • Bootstrap
  • HTML/CSS/JavaScript

Features / Screenshots

Heatmap based on number of tweets posted

Map indicating most active hour of day

Heatmap based on mean sentiment score

Tweet frequency by time with sentiment

Most popular hashtags

Most popular users

Most popular tweets

Most positive tweets

Most negative tweets

Wordclouds based on frequency of words

All tweets

Positive tweets

Negative tweets

Execution Flowchart

The following flowchart explains our system methodology:

The steps can be described as under:

  • Twitter Search API’s free edition misses out on a lot of tweets. Also, it is slow for our purposes. Therefore, we need a list of tweet ids which we can fetch using the Twitter Lookup API. Thankfully, IEEE Dataport has published a dataset of tweets related to COVID-19, which we use. We take ~50,000 tweets from April 8th 2020’s data which is large enough to show trends and small enough to not break things down.
  • We fetch the tweets and serialize them in a binary file. Tweets can be fetched by sending HTTP requests to their server with our API key and secret code. We use Tweepy to make things easier.
  • We create a relational model decomposed up to 3NF, with all the required relationships and constraints. We add the auxiliary tables required for several functionalities, eg., coordinates (fetched from external API), sentiment scores, lists of positive/negative/bad words etc.
  • We insert the data into our relational model in appropriate chronology, taking care of the integrity and referential constraints.
  • We create PL/SQL blocks to generate meaningful results and inferences.
  • We display the data to the front-end by calling these blocks and writing code to display them.

Entity Relationship Diagram

Contributors

Yashraj Kakkad Prayag Savsani
Yashraj Kakkad Prayag Savsani

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.