RedditPulse
A reddit post and comment sentiment analysis using reddit api with gradio UI
Real-Time Reddit Sentiment Analysis
Overview
This project is a Real-Time Reddit Sentiment Analysis Tool that allows users to fetch the latest posts from any subreddit and analyze their sentiment dynamically. The project uses the VADER Sentiment Analyzer to classify the sentiment of Reddit posts into Positive, Negative, or Neutral categories and displays results in real-time via a user-friendly Gradio interface.
Features
- Real-Time Sentiment Analysis:
- Fetches the latest posts from a specified subreddit using the Reddit API.
- Analyzes the sentiment of the posts' titles using the VADER sentiment analyzer.
- Interactive UI:
- Built with Gradio for an intuitive and responsive user experience.
- Users can input a subreddit name and choose the number of posts to analyze.
- Dynamic Sentiment Visualization (Optional):
- Real-time sentiment scores are visualized using Plotly.
- Average Sentiment Score:
- Calculates the average sentiment score of the fetched posts.
- Top Posts Sentiment:
- Displays the sentiment of individual posts (title, sentiment category, and sentiment score).
Technologies Used
- Python: Core programming language for the project.
- PRAW (Python Reddit API Wrapper): To fetch real-time data from Reddit.
- VADER Sentiment Analyzer: For natural language processing and sentiment classification.
- Gradio: For building the interactive user interface.
- Plotly (Optional): For live data visualization.
Requirements
- Python 3.8+
- Dependencies:
pip install praw gradio vaderSentiment plotly
How It Works
- Fetching Reddit Data:
- Uses the Reddit API (via PRAW) to fetch the latest posts from a user-specified subreddit.
- Posts are fetched dynamically based on user input.
- Sentiment Analysis:
- The VADER Sentiment Analyzer calculates sentiment scores for each post title.
- Sentiments are categorized as:
- Positive: Compound score > 0
- Negative: Compound score < 0
- Neutral: Compound score = 0
- Display Results:
- The results include:
- Average sentiment score of all posts.
- Sentiment details (title, score, and category) for individual posts.
- The results include:
- Interactive Interface:
- A Gradio UI allows users to enter the subreddit name and number of posts to analyze.
- Real-time updates ensure the latest data is fetched and analyzed.
Usage
- Clone the repository:
git clone https://github.com/yashwantpatilyup/RedditPulse.git cd RedditPulse - Install required dependencies:
pip install -r requirements.txt - Run the application:
python app.py - Open the Gradio interface in your browser to interact with the app.
Example
- Enter a subreddit name (e.g.,
python). - Choose the number of posts to fetch (e.g., 10).
- View the following outputs:
- Average Sentiment Score: An overall sentiment score for the subreddit.
- Top Posts Sentiment: The sentiment details for the top 10 posts.
- (Optional) Visualization: A live bar chart showing sentiment scores for all posts.
Deployment
- The application can be deployed on platforms like:
- Hugging Face Spaces: Free hosting for Gradio apps.
- Streamlit Sharing or Google Cloud Run.
- AWS, Azure, or Heroku for scalable deployment.
Future Enhancements
- Comment Sentiment Analysis:
- Extend the functionality to analyze sentiment from comments.
- Historical Sentiment Trends:
- Compare sentiment over time by fetching older posts.
- Alert System:
- Notify users when sentiment exceeds a threshold.
- Advanced NLP Models:
- Integrate models like BERT or GPT for more nuanced sentiment analysis.
- Live Sentiment Dashboard:
- Add real-time data visualization with live graphs.
Credits
- PRAW: For seamless Reddit API integration.
- VADER Sentiment Analyzer: For accurate sentiment classification.
- Gradio: For the interactive and user-friendly interface.
- Plotly: For optional visualization features.
Feel free to contribute to this project by submitting issues or pull requests!
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support