This project analyzes the impact of Elon Musk's endorsement of Donald Trump on public sentiment and engagement across various Reddit communities during the 2024 Presidential Election. By using sentiment analysis and engagement metrics, we track how different political, social, and demographic groups reacted to this endorsement, highlighting shifts in discourse before and after the endorsement.
- Clone or download this repository to your local machine.
- Open the project in a Python-supported IDE such as PyCharm or Visual Studio Code.
- Install the required dependencies by running:
pip install praw pandas nltk
- Use the
400project.pyscript to collect Reddit data through the PRAW API. - Use the
DataProcessing.pyscript to clean and process the collected data using NLTK for sentiment analysis. - Visualize the results and trends through engagement metrics and sentiment graphs generated from the analysis.
- Data Collection: Scrapes data from Reddit using the PRAW API based on selected subreddits and keywords.
- Data Processing: Cleans and analyzes the collected data using natural language processing (NLP) techniques like NLTK's VADER for sentiment scoring.
- Engagement Metrics: Evaluates the engagement trends (e.g., number of posts, upvotes, comments) before and after the endorsement.
- Graphs and Visualizations: Generates sentiment distribution, trend analysis, and engagement metric visualizations.
- JSON Reddit Analysis: Parses the raw Reddit data into structured formats (JSON) for further analysis and reproducibility.
- Reddit Data Collection: Using the PRAW API to gather posts and comments from targeted subreddits.
- Sentiment Analysis: Utilizing the NLTK VADER tool to classify sentiment into positive, negative, and neutral categories.
- Engagement Metrics: Measures upvotes, comments, and post frequency over time to observe shifts in user engagement.
- Topic Modeling (Optional): Using jsLDA to identify key discussion topics before and after the endorsement.
- Python 3.x
- PRAW (Python Reddit API Wrapper)
- Pandas
- NLTK (Natural Language Toolkit)