Skip to content

A geographic visualization of Twitter data across the USA, analyzing the sentiments of the tweets based on certain key words.

Notifications You must be signed in to change notification settings

kevincfz/trends

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trends

This project is a geographic visualization of Twitter data across the USA, analyzing the sentiments of the tweets based on certain key words. It is a project of the CS61A course at UC Berkeley.
Data Source:
This repository includes a sample tweets data in 2011 as a txt file, located under the /data direcotry. There is also a compressed file with more data.
If you want to use your own data, please place it under /data and modify data.py accordingly.
Please use:
python3 trends.py -m <keyword>
e.g.
python3 trends.py -m texas
python3 trends.py -m sandwich
python3 trends.py -m obama
python3 trends.py -m "my life"
The CS61A instructional page explains how this program works:
  1. Collecting public Twitter posts (tweets) that have been tagged with geographic locations and filtering for those that contain the "texas" query term,
  1. Assigning a sentiment (positive or negative) to each tweet, based on all of the words it contains,
  2. Aggregating tweets by the state with the closest geographic center, and finally
  3. Coloring each state according to the aggregate sentiment of its tweets. Red means positive sentiment; blue means negative.

About

A geographic visualization of Twitter data across the USA, analyzing the sentiments of the tweets based on certain key words.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages