A project analyzing public sentiment around Kamala Harris and Donald Trump during the 2024 US Presidential Election using Reddit data.
- 🤖 Advanced NLP: Utilizes RoBERTa-based model for accurate sentiment classification
- 📱 Social Media Mining: Extracts and analyzes Reddit comments using PRAW
- 📊 Rich Visualizations: Includes temporal trends, word clouds, and sentiment distributions
- 🔍 Comprehensive Analysis: Covers both candidate-specific and comparative insights
- 📈 Time Series Analysis: Tracks sentiment evolution throughout the election period
- Clone the repository:
git clone https://github.com/marsidmali/us-2024-elections-sentiment-analysis.git
cd us-elections-sentiment-analysis
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
- Copy
.env.example
to.env
- Add your Reddit API credentials
- Copy
- Launch Jupyter Notebook:
jupyter notebook
- Open
us_2024_elections_reddit_sentiment_analysis.ipynb
- Run all cells to perform the analysis
Create a .env
file with your Reddit API credentials:
REDDIT_CLIENT_ID=your_client_id_here
REDDIT_CLIENT_SECRET=your_client_secret_here
REDDIT_USER_AGENT=your_user_agent_here
This project is licensed under the MIT License - see the LICENSE file for details.