News Rationalizer: Measuring Emotional Valence in News Coverage (github.com)

🤖 AI Summary
News Rationalizer is an open-source demonstration web app that quantifies the emotional valence of news coverage and surfaces complementary (positive vs. negative) perspectives to help readers “rationalize” coverage. The pipeline scrapes articles from eight mainstream sources via RSS (BBC, Reuters, The Guardian, NPR, Al Jazeera, The Hill, Axios, TechCrunch), classifies them into five topical categories (Nuclear Energy, Data Centers, Healthcare, Immigration, Technology), and scores sentiment at the title and body level using cardiffnlp/twitter-roberta-base-sentiment-latest. Results are presented in a Tufte-inspired Django dashboard with author profiles, historical trends, ranked balance scores, and suggested complementary author pairs for balanced reading. The repo runs on Python 3.11+, uses Django + pandas + transformers + torch, and can be executed via the provided run_analysis.py script (options for ML-based zero-shot categorization using facebook/bart-large-mnli or faster keyword matching). Technically notable features include weighted valence (30% title, 70% content), author-level metrics (mean valence, within-category variance, cross-category variance) and a balance score computed as 1/(1 + 10×cross_category_variance). Complementarity pairs are ranked by opposing valence magnitude so readers can pair articles that “cancel out.” Important caveats: the sentiment model was trained on Twitter data (domain mismatch), sentiment ≠ factual accuracy or bias, and author stats require ≥3 articles per category to be reliable. The project is MIT-licensed and intended as an experimental heuristic for exploring framing and emotional patterns in news, not as a fact-checker or quality assessment tool.
Loading comments...
loading comments...