Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🎙️ SpeakEasy

Reddit Topic → Subtopic → Credibility Analysis (AI Hackathon Project)

SpeakEasy is a web-based analytics platform that explores large-scale Reddit discussions (r/Canada) to uncover:

  • What people are talking about
  • How conversations break into meaningful subtopics
  • Public sentiment trends
  • Credibility & fake-news risk using Gemini (with minimal API usage)

Built for the AI Hackathon in the North (2026).


🚀 What SpeakEasy Does

1️⃣ Topic Exploration

Users input:

  • A main topic (e.g. immigration, housing, healthcare)
  • A date range

The system then:

  1. Filters millions of Reddit comments by date
  2. Filters again using the main keyword
  3. Uses Gemini to generate ~20 realistic sub-keywords
  4. Keeps comments matching at least 2 sub-keywords
  5. Extracts the Top 5 subtopics

📊 Results are shown as an interactive bar chart.


2️⃣ Subtopic Deep-Dive (Click a Bar)

When a user clicks a subtopic (e.g. international students):

  • A new dashboard page opens
  • All analysis is now strictly scoped to that subtopic

3️⃣ Dashboard Analytics (Subtopic-Specific)

📈 Trend Over Time

  • Mentions per day
  • Displayed as a clean line chart

💬 Sentiment Analysis (Offline)

  • Uses VADER (no API calls)
  • Pie chart: Positive / Neutral / Negative

🏆 Top Contributors

  • Bar chart showing most active authors

🛡️ Credibility & Fake News Analysis (Gemini)

  • Uses ONE Gemini API call
  • Classifies sampled comments into:
    • Opinion
    • Needs verification
    • Likely rumor / misleading
    • Unclear
  • Displays:
    • Overall credibility score (%)
    • Interactive filled percentage bars

Designed to stay well under the 1,000 API call limit.

🧾 Top 10 Reddit Comments

  • Most recent comments matching the subtopic
  • Shows:
    • Author
    • Timestamp
    • Content snippet

🧠 Why This Approach Works

  • ✅ Handles millions of rows efficiently
  • ✅ Uses Gemini only where it adds real value
  • ✅ No per-comment LLM calls
  • ✅ Transparent, explainable outputs
  • ✅ Easily extendable to other subreddits or regions

🛠️ Tech Stack

Backend

  • Python
  • FastAPI
  • Pandas
  • VADER Sentiment
  • Gemini API (hackathon endpoint)

Frontend

  • HTML + CSS (custom dark UI)
  • Vanilla JavaScript
  • Chart.js

Data

  • Reddit r/Canada dataset (3.1M+ rows)
  • Columns used:
    • author
    • body
    • created_utc

🔑 Gemini API Usage

  • Used only for:

    1. Sub-keyword generation
    2. Credibility / misinformation labeling (batched)
  • Max calls per analysis: 2

  • Typical dashboard load: 1 call

API key is stored securely in .env and never committed.

GEMINI_API_KEY=your_api_key_here

⸻

📂 Project Structure

Hackathon_26/
│
├── main.py              # FastAPI server
├── utils_funcs.py       # Data processing + Gemini logic
├── Data/
│   └── sample_data.csv  # Trimmed Reddit dataset
│
├── static/
│   └── assets/          # Images, logos
│
├── templates/
│   ├── index.html       # Topic → subtopic explorer
│   └── dashboard.html   # Deep-dive analytics page
│
├── .env                 # API key (not committed)
└── README.md

▶️ How to Run Locally

1️⃣ Create virtual environment

python -m venv .venv source .venv/bin/activate # macOS / Linux

or .venv\Scripts\activate # Windows

2️⃣ Install dependencies

pip install fastapi uvicorn pandas requests python-dotenv vaderSentiment

3️⃣ Add API key

Create a .env file:

GEMINI_API_KEY=your_key_here

4️⃣ Start server

uvicorn main:app --reload

5️⃣ Open browser

http://127.0.0.1:8000

🧪 Example Workflow 1. Enter topic: immigration 2. Select date range 3. Click Analyze 4. Click a subtopic (e.g. international students) 5. Explore: • Trend over time • Sentiment distribution • Top contributors • Credibility score • Recent Reddit posts

⚠️ Limitations • Credibility labeling is assistive, not absolute fact-checking • Reddit data is inherently opinion-heavy • Gemini outputs depend on prompt quality • Dataset is trimmed for performance

🌟 Future Improvements • User-controlled credibility thresholds • Cross-subtopic comparison views • Multi-subreddit expansion • Gemini response caching • Exportable reports (PDF / CSV)

🏁 Hackathon Context

Built for AI Hackathon in the North – 2026 Goal: Demonstrate how AI + large public datasets can help users understand what’s being said, what matters, and what needs verification.

About

SpeakEasy is an AI-powered Reddit analytics dashboard that analyzes millions of r/Canada comments to extract trending subtopics, sentiment patterns, and credibility signals.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages