Git Product home page Git Product logo

twitter_coronavirus's Introduction

Coronavirus Twitter Analysis

Background

Data

Approximately 500 million tweets are sent everyday. Of those tweets, about 2% are geotagged. Only geotagged tweets are included in the dataset. In total, there are about 1.1 billion tweets in this dataset, all from 2020.

The tweets are stored in a zip file for each day, which hold 24 texts files, one for each hour of the day. Within those text files, tweets are stored in JSON format.

Objective

Use MapReduce to anaylze the dataset and produce graphs tracking the usage of pandemic related hashtags.

Code Overview

map.py processes the zip file for an indiviudal day. It tracks the usage of hashtags at the language and country level, creating a zip file for each day and level with all the tweets containing the desired hashtags.

reduce.py merges the outputs of map.py into a combined file. It produces one file for all tweets at the language and one at the country level.

visualize.py generates a bar chart with the country/language on the x-axis, and the number of hashtag uses on the y-axis.

For example, to generate a bar chart displaying #cornavirus across languages in 2020, you would run the following command:

$ ./src/visualize.py --input_path=reduced.lang --key='#coronavirus'

alternative_reduce.py generates a line chart displaying their usage over 2020. It can be run as follows:

$ ./src/alternative_reduce.py --hashtags="'#covid19', '#virus', '#corona', '#nurse'"

Results

Plots made with visualize.py

#coronavirus Usage by Language in 2020

#코로나바이러스 Usage by Language in 2020

#coronavirus Usage by Country in 2020

#코로나바이러스 Usage by Country in 2020

Plot made with alternative_reduce.py

Hashtag Usage Over 2020

twitter_coronavirus's People

Contributors

ben-smith23 avatar joeybodoia avatar mikeizbicki 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.