Dashboard for US Political Discourse Analysis
Overview
For my final project in CS6242 (Data Visualization and Analytics) at Georgia Tech, our team built a React dashboard that lets you search a political topic and compare how different subreddits discuss it side by side. Instead of reading one feed at a time, you can search a keyword and see each subreddit's weighted sentiment, vote differentials, top comments, related keywords, and linked news articles.
How It Works
We pulled Reddit posts and comments from opposing political subreddits through the Pushshift API and stored them in PostgreSQL. By April 15, 2021, the test database held roughly 1.5 million posts and 20.7 million comments (111 columns each), with a scheduled fetcher pulling in new data daily.
Our Python pipeline normalized the text with spaCy, extracted searchable noun topics via Named Entity Recognition (NER), and scored comment sentiment with a pretrained BERT model to compute a weighted average sentiment per subreddit for each keyword. Every backend service ran in Docker, including PostgreSQL, the fetcher, the scheduler, the cleaner, the NLP pipeline, and a webhook. Together, they served a React frontend with both summary and detail views (Figure 1).
Experiments and Evaluation
We planned six sets of sanity checks and evaluations. Getting the NLP pipeline right took most of our schedule, so we completed the core technical checks and informal user testing but ran out of time for a public release on Reddit.
1. Backend & NLP pipeline
- Daily ingestion: Spot-checking live threads against PostgreSQL showed no data loss, though we had to patch the fetcher to skip
[removed]records. We also found that up to ~30% of captured comment permalinks expired quickly, leaving dead"Go to comment"links in the UI. - NER & sentiment accuracy: Our first pipeline failed badly, missing named entities and outputting all zeros for sentiment. That happened because of bugs in our text parser and a pretraining dataset built on restaurant reviews that did not transfer to political discussion. After rewriting the scripts and switching to a more general pretrained model, manual checks across ~100 comments put accuracy around 85% (beating our 80% target).
2. Frontend & latency
- UI rendering: Comparing 20+ frontend renders directly against backend JSON payloads matched 100%, with a few minor quirks left over (such as the Enter key not submitting topic searches).
- Query speed: Our goal of under
1sfor search latency was not realistic for unindexed queries across more than 20 million comments, and first-time searches could take over 60 seconds. Caching repeated searches from the same day in the database helped. Real responsiveness would require precomputing results for all extracted entities right after each daily fetch, along with support for multi-term or exclusionary queries like"Waters -Chauvin".
3. User feedback
- We demonstrated the dashboard to 58 friends and family to gather informal feedback. About 70% said that they would use it again, though that figure reflects obvious bias from friends and family. Their main complaints were accurate: slow first-time queries, awkward access, occasional counterintuitive sentiment scores (such as
r/Republicanappearing to "disapprove" of a border wall), and news links that needed more prominent placement. - We looked into public hosting and posting to the target subreddits for tougher, less-biased feedback, but processing costs for the data pipeline and semester deadlines prevented both.
4. Sanity checks (controversy, divergence, relevance)
- Controversy check (
Trump,Biden,COVID): Subreddit scores matched our manual checks: strongly negative communities scored-0.7or lower, strongly positive communities scored+0.7or higher, and neutral communities landed between-0.3and+0.3. - Divergence check (
president,China,Biden): The results showed the expected partisan splits (Bidenpositive inr/Democrats, negative inr/Republican), whiler/Libertarianshowed the widest internal spread and averaged closer to neutral (-0.5to+0.5). - Relevance check: Restricting extracted topics to nouns eliminated stopword junk (
"and","the"), though compound terms ("border wall") and ambiguous names ("Georgia","pipeline") still caused occasional conflation.
What I'd Do Differently
Getting 20M+ comments from Pushshift through BERT and into a working React UI was a fun end-to-end build. The biggest bottlenecks were all practical engineering issues: precomputing entity aggregates offline so that searches feel instant, validating comment links before rendering them, and handling multi-word entities so that "border wall" is not split into "border" and "wall".