How maheshwaree-02/narrative-tracker works
Narrative Migration Tracker analyzes how narratives move from news to YouTube. Its principal workflow collects platform posts, preprocesses and embeds them, discovers narrative clusters, matches clusters across platforms, infers migration and coordination, then produces explanations and analytical views. The README also documents sentiment analysis, temporal and network analysis, Granger causality, and dashboard capabilities. Source excerpts and the index support several internal connections; README-documented stages fill in high-level workflow links where implementation details were not shown.
Main entry points: runner.py Pipeline Runner · app.py Analytics Dashboard · collectors Platform Collectors · migration.py Migration Detection
Components 31
Collection and Preparation
- Platform Collectors
src/collectors - Post Records
src/models/post.py - Post Database
src/collectors/db.py - Text Preparation
src/preprocessing/pipeline.py
Narrative Analysis
- Semantic Embeddings
src/embeddings/engine.py - Sentiment Analysis
src/05b_sentiment_analysis.py - Narrative Clustering
src/clustering/narrative_clusterer.py - Dynamic Topics
src/clustering/dynamic_topics.py - Narrative Lineage
src/clustering/lineage_tracker.py - Narrative Models
src/models/narrative.py - Cross-Platform Matching
src/matching/cross_platform.py - Migration Detection
src/detection/migration.py - Migration Models
src/models/migration.py - Coordination Detection
src/detection/coordination.py - Coordination Models
src/models/coordination.py - Temporal Analysis
src/analysis/temporal.py - Network Analysis
src/analysis/network.py - Granger Causality
src/12_granger_causality.py
Explanations and Reports
- Narrative Explainer
src/explainer/narrator.py - LLM Client
src/explainer/llm_client.py - Report Generation
src/explainer/report.py - Pipeline Runner
src/pipeline/runner.py
User Interfaces
- Analytics Dashboard
src/dashboard/app.py - Overview View
src/dashboard/pages/overview.py - Timeline View
src/dashboard/pages/timeline.py - Network View
src/dashboard/pages/network.py - Analysis View
src/dashboard/pages/analysis.py - Analytics API
src/api/main.py
Other components
- Analyst
- News Dataset
- YouTube API
Connections 31
- Analyst → Analytics Dashboard: explores results
- News Dataset → Platform Collectors: supplies articles
- YouTube API → Platform Collectors: supplies transcripts
- Platform Collectors → Post Records: creates records
src/collectors/youtube.py - Platform Collectors → Post Database: stores posts
- Post Database → Pipeline Runner: provides posts
src/pipeline/runner.py - Pipeline Runner → Text Preparation: processes posts
src/pipeline/runner.py - Text Preparation → Post Records: cleans records
src/preprocessing/pipeline.py - Pipeline Runner → Semantic Embeddings: generates vectors
src/pipeline/runner.py - Pipeline Runner → Narrative Clustering: clusters posts
src/pipeline/runner.py - Narrative Clustering → Narrative Models: creates clusters
src/clustering/narrative_clusterer.py - Pipeline Runner → Dynamic Topics: tracks topics
src/pipeline/runner.py - Pipeline Runner → Cross-Platform Matching: matches clusters
src/pipeline/runner.py - Cross-Platform Matching → Migration Detection: supplies matches
- Pipeline Runner → Migration Detection: detects migration
src/pipeline/runner.py - Migration Detection → Migration Models: builds events
src/detection/migration.py - Pipeline Runner → Coordination Detection: detects coordination
src/pipeline/runner.py - Coordination Detection → Coordination Models: builds assessments
src/detection/coordination.py - Pipeline Runner → Temporal Analysis: analyzes timing
src/pipeline/runner.py - Pipeline Runner → Network Analysis: builds networks
src/pipeline/runner.py - Migration Detection → Network Analysis: maps migration
- Pipeline Runner → Narrative Explainer: generates explanations
src/pipeline/runner.py - Narrative Explainer → LLM Client: requests generation
src/explainer/narrator.py - Narrative Explainer → Report Generation: provides explanation
src/pipeline/runner.py - Pipeline Runner → Granger Causality: validates influence
- Pipeline Runner → Sentiment Analysis: analyzes framing
- Analytics Dashboard → Overview View: routes view
src/dashboard/app.py - Analytics Dashboard → Timeline View: routes view
src/dashboard/app.py - Analytics Dashboard → Network View: routes view
src/dashboard/app.py - Analytics Dashboard → Analysis View: routes view
src/dashboard/app.py - Analytics API → Pipeline Runner: serves analysis