Giter VIP home page Giter VIP logo

twitterconsensusanalysis's Introduction

TwitterConsensusAnalysis

Used data mining tool to analyze the correlation between tweets public opinion and real event (the 89th Academy Awards), including related tweets collection (web crawler by Tweepy), tweets pre-processing (NLTK) and sentiment analysis using Naive Bayes (NLTK).

Twitter provides convenient access to its huge amount of data to its developers and researchers through several Twitter API. This project used Tweepy to access Twitter API in data collection.

According to Twitter Developer Policy, users who want to get access to Twitter API must firstly be an authorized user of Twitter. Meanwhile, the developer must register an application binding with his/her Twitter account. A token will be issued with the application to the developer so that she/he can get authority to Twitter API.

To increase the speed of data collection on Twitter, this project registered five applications. Meanwhile, Twitter also has rate limitat ion for API usage. Therefore, the project included sleep scheme in crawler program, and the process to collect all related data cost 16 days.

The file getFollowers.py is used to obtain all followers information of the Academy Awards official Twitter account. Authority is required before accessing the Twitter API.

The source code tweetsCollector.py is used to collect all tweets ever posted by these followers. Users’ tweets were stored in a local file. Each users's statuses_count and friends_count are recorded with tweets. There are several problems that need to pay attention here. First, Twitter requires that only authorized users' information can be collected, and an error will occur when crawler reach an unauthorized user. Meanwhile, rate limitation is also a problem. Finally, if the total number of connection to Twitter API exceed a pre-set number, API connection will be denied. All there problem should be considered seriously to avoid programming crash.

The source code consensusAnalysis.py implements a classifier based on Naive Bayer, including classifier training and tweets pre-processing. An example of moview Moonlight was given at the end of the program to show how the classifier works.

There is also a poster Twitter_Poster.pdf to demonstrate the overall structure and method of this project.

twitterconsensusanalysis's People

Contributors

jiangnan3 avatar

Stargazers

 avatar  avatar

Watchers

James Cloos 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.