Giter VIP home page Giter VIP logo

twittersentimentanalysis's Introduction

Twitter Sentiment Analysis

Created by @sruthipsuresh Practice of Twitter Data Scraping using Twint and NLP Analysis. Inspired by this article, generated individual wordclouds for AOC, Pete Pete Buttigieg, Ted Cruz and Ben Shapiro in images folder. Also made subjectivity/polarity analysis and plotted in seaborn scatterplot.

Examples of Images Generated

overall See the wordcloud generated for AOC from her Tweets so far in 2021!

overall See the wordcloud generated for Pete Buttigieg from his Tweets so far in 2021!

overall See the polarity vs. subjectivity scatterplot of all the users listed above!

Documentation:

Data Collection:

  • Install dependencies in script.sh.
  • Generate .csv files with tweets from usernames, TODO: configure userlist in modules
  • Concatenate all .csv files in one (first strip header with sed 1d, then run cat command)

Data Cleaning

  • Used Google Colab and referenced various articles to clean data.
  • Subsetted to username, tweet text.
  • Removed all Twitter characters/links from Tweet.
  • Data cleaning for NLP analysis.
  • Store cleaned data in clean.csv

Wordcloud Generation

  • Followed tutorial on datacamp.
  • Generated countplot.
  • Generated test wordcloud using only one tweet.
  • Combined all tweets in merged dataset for overall wordcloud.
  • Combine all tweets by username and generate separate wordclouds.
  • Save in images folder.

Working with Textblob

  • Use dataset which is only processed to remove Twitter tags.
  • Add polarity and subjectivity columns with Textblob, saved .csv
  • Simple plot with username used as hue.

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.