A sophisticated machine learning project that performs real-time sentiment analysis on NFL-related social media content using the RoBERTa pre-trained model. The analysis provides valuable insights into public sentiment towards NFL teams during the active season.
📊 View Dataset on Kaggle 📝 Read the Article on Medium
- Real-time social media data collection for NFL teams
- Context-aware sentiment analysis using RoBERTa
- Intelligent parsing of NFL-specific scenarios:
- Draft pick implications
- Injury impact assessment
- Team performance metrics
- Automated data export and visualization
- Season-specific context optimization
The model has been specifically trained to understand NFL-specific contexts:
- Negative sentiment for season-ending injuries
- Draft position implications during active season
- Team performance trends and playoff implications
- Python 3.8+
- pip package manager
- Git
- Clone the repository:
git clone https://github.com/cam-cc/NFL-sentiment-analysis.git
cd NFL-sentiment-analysis- Install dependencies:
pip install -r requirements.txt- Configure your settings:
# create a .env
TWITTER_USERNAME=Username
TWITTER_PASSWORD=Password- Run the analysis: FROM ROOT DIR
python ./src/main.py- Test custom inputs:
python ./tests/test-roberta.pyData will be exported to data/TEAM_TIMESTAMP.csv
To test the sentiment analysis on custom text:
- Open
test-roberta.py - Modify the sample text
- Run the script
- View the comprehensive sentiment analysis output
We welcome contributions! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- RoBERTa model developers
- Twitter I guess
This model is optimized for in-season analysis. Performance may vary during the off-season due to different contextual indicators.
