Skip to content

Scraping Twitter Data and Visualising the Trends, Topics and Sentiments

Notifications You must be signed in to change notification settings

datablogger-ml/twitter-analytics

Repository files navigation

Twitter Analytics

Project Intro/Objective

The purpose of this project is to Scrape Twitter Data and Visualise the trend, topics and the sentiment, which is helpful in predicting the perception of the general public on some event/commodity.

Methods Used

  • Twitter Scraping
  • Data Visualisation - WordCloud, Topic Modelling
  • Sentiment Analysis
  • Natural Language Processing

Technologies

  • Python
  • Python-Twitter API
  • sklearn
  • Pandas, jupyter
  • matplotlib
  • nltk

Project Description

The cause and effect relationship between impactful news and martket movements can be directly observed during the release of big news/event.eg Even a single Tweet from Trump on oil can cause massive price variations. News information can give the true nature of the market for any topic.

Methods

1. Twitter Scraping

Python-twitter API helps us to scrape the tweets. Tweets can be collected through a search keyword or from specific accounts. With the actual text, we can also get information on number of likes and re-tweet count.

Sample Tweets Format:

2. Data Visualisation

  • WordCloud - It is a visual representation of text data. It displays a list of words, the importance of each beeing shown with different font sizes or colors. It is useful for quickly perceiving the most prominent terms in the corpus.

  • Topic Modelling - It is a method of Unsupervised Classification of documents, similar to clustering on numerical data, which finds natural groups of items (topics).

  • Sentiment Analysis - Sentiment analysis is the automated process of analyzing text data and sorting it into sentiments : positive, negative, or neutral. Using sentiment analysis tools to analyze opinions in Twitter data can help understand how people are talking about certain topics. With more than 321 million active users, sending a daily average of 500 million Tweets, Monitoring Twitter can allow one to understand their audience, keep on top of what’s being said, and discover new trends in the industry.

Sample Sentiment Analysis:

Getting Started

Step 1: Go to Twitter Developers and sign in with your account

Step 2: Select Create an app and specify the app name and description

Create An App App name and description

Step 3: Once the app is created, go to the Keys and Tokens sections, copy your API keys and generate Tokens

Access Token and keys

Step 4: Download requirements.txt and install on terminal:

pip install -r requirements.txt

Step 5: Follow along the jupyter notebook 😀

-- Project Status: Active

Featured Notebooks/Analysis/Deliverables

About

Scraping Twitter Data and Visualising the Trends, Topics and Sentiments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published