Analyze sentiment and emotional content of Reddit search terms, contributors and subreddits using IBM Watson's Natural Language Processing.
Analyze the sentiment and emotional content of Reddit content using machine learning!
Use Emot/r on Heroku
Emot/r uses IBM Watson’s Natural Language Understanding to extract emotional content and overall sentiment from Reddit content. Users can use any combination of search terms, Reddit usernames, or subreddits to narrow their search.
Use Emot/r to:
Due to IBM Watson’s monthly usage limits, I have capped the search results at the last 50 comments posted to Reddit. If you would like to see increased max count or have feature requests, such as inclusion of Reddit submmissions or an option to search by date, please email me with your request. Please write “Emot/r feature request” in the subject line.
To get Emot/r up and running, please follow these steps.
Please ensure you are using Ruby version 2.7.4.
ruby -v
IBM Watson Natural Language Understanding (NLU) account: follow the link to set up your free account.
Emot/r uses the following additional gems (loads automatically from Gemfile)
git clone https://github.com/bfreed76/Reddit-Sentiment-Analyzer.git
npm install
bundle install
touch .env
# ./env
NATURAL_LANGUAGE_UNDERSTANDING_APIKEY=[ your IBM Watson API key ]
NATURAL_LANGUAGE_UNDERSTANDING_IAM_APIKEY=[ your IBM Watson API key ]
NATURAL_LANGUAGE_UNDERSTANDING_URL=[ your IBM Watson credentails URL ]
NATURAL_LANGUAGE_UNDERSTANDING_AUTH_TYPE=iam
# ./gitignore
*.env
sudo service postgresql start
rails db:create
rails db:seed
npm install --prefix client
npm run --prefix client
rails s
The idea for this app came from a conversation with a friend about natural language understanding. As a previous military crytolinguist, I’ve always had an interest in language, and how it frames our worldview and actions. Given all of the talk in the last few years about fake news and social media news, we thought pairing sentiment analysis with reddit posts would provide telling information about subreddits, Reddit users and Reddit content, as a whole.
I collaborated with a Career Foundary UX grad and his mentor, a seasoned UX designer. They helped me refine my user cases and user stories, and provided wireframes.
They also conducted a small (n=5) study with Reddit users and found that nearly all subjects would prefer to use the app on a mobile device. Thus, I developed the app according to responsive design principles.
I set up the postgres database with the following data structure.
Due to the potentially large datasets involved and the required use of credentials, I decided to access Reddit data (via pushshift api) and apply IBM Watson NLU analysis from Rails, instead of from the frontend.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag “enhancement.”
Don’t forget to give the project a star! Thanks again!
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License.
Project Link: Emot/r
See more apps on my profile page »
Use this space to list resources you find helpful and would like to give credit to. I’ve included a few of my favorites to kick things off!