Giter Club home page Giter Club logo

tweets-modelling's Introduction

Tweets data

This tool processes zipped files in .jsonl format containing tweets' data (The tool is configured to process all data files with the suffix .jsonl.gz in the ./data directory).

Official documentation of the tweet json can be found here here.

The test data I've been using were 41 .jsonl.gz files of size 5.65 GB altogether. After unpacking, the data has 40 GB. The code now uses the streaming library, but materializes the chunks that are imported. The chunk size is hardcoded to 5000 tweets.

Disclaimer: The data has more fields than finally used for parsing (parsed fields can be seen in the models).

Running

The following is the usage:

tweets-import --import [Postgres,Elastic] --connection-file FILE

There are example connection files in the root of the repository:

  • elastic_connection.json
  • pg_connection.json

Elastic search import

This is importing the data from the .jsonl files right into the ElasticSearch. In time of coding this, the last available version of Elastic was used (i.e. 7.10). It is using the Elastic bulk API. I'm using the index bulk command. The Elastic nodes are defined in the docker-compose (I'm using 3 nodes).

The data is being imported into a single index called tweets using the mapping defined in the ./esTweetIndexMapping.json file. I'm using 3 shards and 1 replica setup for this index.

The imported data (mentioned in the beginning) has total of 9.1 GB inside the Elastic.

PosgreSQL import

All the logic for this import is inside the Postgres module. The data can be imported to a PostgreSQL database according to the following model:

Database model

tweets-modelling's People

Contributors

kristianbalaj avatar

Stargazers

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