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.
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.