Overview

SentimentStream is a real-time social media sentiment analysis platform that monitors a simulated tweet stream, classifies sentiment using a keyword-based engine, clusters tweets into topics, and detects emerging trends.

No external APIs or machine learning models are required. All sentiment analysis is performed using curated word lists with modifier handling (intensifiers and negations).

20
Tweets Analyzed
5
Topics Detected
200+
Sentiment Keywords

Features

  • Live Tweet Stream — Simulated tweets with realistic hashtags, mentions, and varied sentiment
  • Keyword-Based Sentiment — Positive/negative/neutral classification with confidence scores
  • Topic Clustering — Groups tweets by keyword frequency and co-occurrence
  • Trend Detection — Volume spikes, sentiment shifts, and emerging topics
  • Custom Text Analysis — Analyze any text for sentiment and extract key topics
  • REST API — Full JSON API for programmatic access

Tech Stack

Backend Python 3.11+, FastAPI, SQLAlchemy
Frontend Jinja2 Templates, Vanilla JS, CSS3
Database SQLite
Testing pytest, httpx

API Endpoints

MethodEndpointDescription
GET/api/tweetsList recent tweets
GET/api/tweets/streamGet latest batch from stream
POST/api/tweets/generateGenerate new tweets
POST/api/analyzeAnalyze custom text
GET/api/sentiment/statsAggregate sentiment stats
GET/api/sentiment/historySentiment over time
GET/api/topicsList all topics
GET/api/topics/{id}Topic details
POST/api/topics/clusterRun topic clustering
GET/api/trendsCurrent trend data
GET/api/trends/alertsAlerts