Home

Awesome

Reddit Topic Analysis Tool

A Streamlit application that analyzes Reddit posts on any topic using AI-powered insights. This tool combines Reddit's API with local LLMs through Ollama to provide meaningful analysis of Reddit discussions. It weights the summarization by the Reddit Score value.

Features

Prerequisites

Installation

  1. Clone this repository:
git clone <repository-url>
cd reddit-topic-analysis
  1. Install the required dependencies:
pip install streamlit praw ollama
  1. Install Ollama and at least one language model:
# Install Ollama (instructions vary by OS)
curl https://ollama.ai/install.sh | sh

# Pull a model (e.g., Llama 2)
ollama pull llama2
  1. Set up your Reddit API credentials:

Configuration

The application uses the some test Reddit API credentials by default

For security reasons, it's recommended to use environment variables or a configuration file for these credentials in a production environment.

Usage

  1. Start the Ollama service:
ollama serve
  1. Run the Streamlit application:
streamlit run app.py
  1. In the web interface:

    • Select your preferred Ollama model from the sidebar
    • Adjust the number of posts to analyze using the slider
    • Enter a topic in the main area
    • Click "Analyze Topic" to generate insights
  2. The analysis will include:

    • Individual post details (title, subreddit, score)
    • AI-generated summary of insights and trends
    • Option to download the analysis as a markdown file

Output Format

The analysis is presented in a structured markdown format:

Error Handling

The application includes error handling for:

Security Notes

Contributing

Feel free to submit issues and enhancement requests!

License

MIT LICENSE