https://github.com/jftuga/nfl_sentiment_analysis
Sentiment Analysis of r/nfl live-streamed comments
https://github.com/jftuga/nfl_sentiment_analysis
Last synced: about 1 year ago
JSON representation
Sentiment Analysis of r/nfl live-streamed comments
- Host: GitHub
- URL: https://github.com/jftuga/nfl_sentiment_analysis
- Owner: jftuga
- License: mit
- Created: 2021-06-26T19:48:18.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-11-29T20:43:22.000Z (over 4 years ago)
- Last Synced: 2025-01-29T23:29:58.628Z (over 1 year ago)
- Language: CSS
- Homepage:
- Size: 441 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NFL Sentiment Analysis
Sentiment Analysis of [r/nfl](https://www.reddit.com/r/nfl/) live-streamed comments
## Intro
This program uses the Reddit API to receive r/nfl comments in real time. It then performs sentiment analysis on each user comment. Results are then emitted from the server back to the web browser via the socket.io JS / Python library. A [Reddit API account](https://www.reddit.com/dev/api/) is needed in order to fetch the user comments.
This is just an experiment to learn more about:
* [socket.io](https://socket.io/) - for both JS and Python versions
* The [Asynchronous Python Reddit API Wrapper](https://github.com/praw-dev/asyncpraw)
* The [TextBlob: Simplified Text Processing](https://textblob.readthedocs.io/) library to perform [Sentiment Analysis](https://en.wikipedia.org/wiki/Sentiment_analysis)
* The [Uvicorn](https://www.uvicorn.org/) ASGI server
* The Python 3 [async / await](https://docs.python.org/3/library/asyncio-task.html) library
## Output
* 
## Prerequisites
* Install a recent version of Python 3.
* Python 3.9.5 was used for development.
* Install git, if not already installed.
* A Reddit API account.
* * Edit `creds.py` with this information.
## Installation and Operation
```
# you may need to install the python3 developemnt libraries
# On Fedora Linux, you would run:
sudo dnf install python3-devel
# clone this repository to your system
git clone https://github.com/jftuga/nfl_sentiment_analysis
# create a Python virtual environment
python -m venv nfl_sentiment_analysis
cd nfl_sentiment_analysis
# Active the virtual environment
- windows:
.\Scripts\Activate
- linux or macOS:
source bin/activate
# install the necessary Python dependencies inside the Python virtual environment
pip install -r requirements.txt
python -m textblob.download_corpora
# rename creds--TEMPLATE.py to creds.py and edit accordingly
# start the app server
- windows:
.\start_server.ps1
- linux or macOS:
./start_server.sh
# open web browser to:
http://127.0.0.1:8000/
# you many need to wait a minute for comments to start appearing in the HTML table
```