https://github.com/milesmcc/cs106s-sentiment
Sentiment analysis workshop
https://github.com/milesmcc/cs106s-sentiment
Last synced: 3 months ago
JSON representation
Sentiment analysis workshop
- Host: GitHub
- URL: https://github.com/milesmcc/cs106s-sentiment
- Owner: milesmcc
- Created: 2022-10-04T17:46:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-04T17:57:32.000Z (over 2 years ago)
- Last Synced: 2025-04-09T22:55:17.500Z (3 months ago)
- Language: JavaScript
- Size: 36.1 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sentiment Analysis - Classifying Anti-Refugee Tweets
## Intro
This workshop centers on how we can leverage social media platforms to do gradual education of people whose views we fundamentally disagree with. A fitting example of this is the virulent and hateful response to the Syrian refugee crisis from Twitter users in US and Europe. Many individuals took to Twitter to voice their Islamophobic, xenophobic, and racist opinions that refugees should not be allowed to seek sanctuary lest they bring terror, rape, and other unfounded accusations.## Your Task
The trainTweets.js file contains a huge dump of tweets we've pulled showcasing both pro-refugee and anti-refugee sentiment. Today, you'll be working on classifying these sentiments based on trends that you find, whether simple text matching or more elaborate patterns.This is a fairly open-ended task, and there are lots of ways to go about it! Feel free to partner up in groups, definitely ask for help in terms of getting documentation or guidance in proceeding with the analysis, and share your findings.
## Milestone 1
Take a look at the tweets we've included and their classifications. What are some trends you notice that might be helpful in classifying them?Come up with a list of 3 methods you can use to sort positive tweets from the negatives!
## Milestone 2
Let's get this running - we don't have a super schmancy JavaScript IDE for you all to download and use - instead, check out [repl.it](https://repl.it/languages/javascript) and do some nice copy-pasta into the console there.To run, simply type "semanticAnalysis()" in the console and hit enter. Until you start classifying, you'll get a fun and cute error message.
## Milestone 3
Let's start filling up those guesses! Take the list of semantic analysis methods and start working through it. Feel free to ask Priya, Vicki, or Lawrence for help with how to do certain tasks in Javascript or to debug.Make sure to test regularly and keep track of where the bugs and gaps are. This is real tweet data, so there's no expectation that your classification will be perfect (that's nearly impossible), so it's all about making tradeoffs and optimizing as much as possible.
## Milestone 4
Have fun, eat snacks, hang out with everybody's favorite social good section leaders & celebrate success right.## Extensions
Now that you can classify tweet sentiment, there are some awesome future applications! One that we thought of is building a tweetbot that responds to hateful tweets with helpful resources to constructively respond and hopefully start an educational conversation about why hating refugees is not the problem, why it's racism (why racism is bad), and the like.If you're interested in building a tweetbot, check out the [Twitter Docs](https://dev.twitter.com/rest/reference/post/statuses/update). This uses a REST API, which builds on some of the things Lawrence mentioned earlier in terms of GET and POST requests.
For more information on how to make those requests in Javascript, hit up this [Codecademy Tutorial](https://www.codecademy.com/courses/javascript-beginner-en-EID4t/0/1?curriculum_id=5122e6f8b2cb8a8e97000a01)
As always, feel free to hit us up with questions! If you build something dope, we'd love to feature it on the CS+Social Good GitHub :)