CodeAKrome/propaganda

Propaganda analysis.

0

stars

213

commits

HTML

primary language

May 31, 2026

updated

README

Image

Propaganda — News Analysis Pipeline

A complete local-first news aggregation, analysis, and reporting pipeline.

Architecture

┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│  RSS Feeds  │───▶│  MongoDB    │───▶│  NER        │
│  (main.go)  │    │  (Articles) │    │  (Flair)    │
└─────────────┘    └─────────────┘    └─────────────┘
                                              │
                   ┌──────────────────────────┘
                   ▼
              ┌─────────────┐    ┌─────────────┐    ┌─────────────┐
              │  ChromaDB   │◀──▶│  Hybrid     │───▶│  Report     │
              │  (Vectors)  │    │  Search     │    │  Generation │
              └─────────────┘    └─────────────┘    └─────────────┘
                                              │
                   ┌──────────────────────────┘
                   ▼
              ┌─────────────┐    ┌─────────────┐
              │  T5 Bias    │    │  Video Gen  │
              │  Detection  │    │  (MGM)      │
              └─────────────┘    └─────────────┘

Quick Start

# 1. Load RSS feeds
cd rss && go run . ../config/big.tsv ../config/kill.tsv

# 2. Run NER
cd ner-hub && go run . --start-date -7 endpoints.tsv

# 3. Generate vectors
python db/mongo2chroma.py load --limit 100

# 4. Search articles
python db/hybrid.py "climate change" -n 10

# 5. Generate report
python db/report.py -7 climate_news "Climate developments" Climate

# 6. Generate video
python mgm/mgm.py article.txt output.mp4

Or use the Makefile:

make testrun    # Full pipeline
make smallthingsthatgo  # Quick test

New Capabilities

Vector Loading with Slack Backfill

Load up to 3333 articles per run, backfilling with older articles if date range has fewer:

# Via Makefile (default: 3333)
make vector

# Via Python directly
python db/mongo2chroma.py load --start-date -2 --slack 3333

See docs/slack_backfill.md for details.

Media Coverup Detection

Analyze bias data to find subjects with extreme coverage bias:

# Interactive CLI with Rich
python scripts/find_media_coverups.py --output interactive

# Output to CSV/JSON
python scripts/find_media_coverups.py --output csv,json

# Via Makefile
make analyze-bias-coverage

See docs/media_coverups.md for details.

Token Counting

Count tokens in text files:

# Fast estimation (chars/4)
python llm/tools/count_tokens.py input.txt

# Accurate count with tiktoken
python llm/tools/count_tokens.py input.txt --accurate

Title Printing in Reports

Report generation now prints all article titles for transparency:

=== [israel] Processing 40 articles (before cypher) ===
 "Israel announces new military operation in Gaza"
 "Netanyahug meets with Biden at White House"
 "Israeli forces raid West Bank refugee camp"
...

Components

Data Ingestion

FileDescription
MakefilePipeline orchestration (full reference)
FileDescription
mongo2chroma.pyMongoDB → ChromaDB vector loader
hybrid.pyHybrid vector + BM25 search
geminize.pyLLM processing pipeline
report.pyNews report generation

AI Services

FileDescription
ner/main.pyNamed Entity Recognition (Flair)
ollamaai.pyOllama LLM client
mgm/mgm.pyVideo generation (SD Turbo + Kokoro)

Bias Detection

FileDescription
t5/bias_detector/T5+LoRA bias detection
llm/bias_processor.pyLLM-based bias processing

Documentation (Complete)

Data Ingestion & NER

Database & Search

LLM & Bias

Training

  • lora.md — LoRA training pipeline

Reporting & Generation

  • report.md — News report generation with LLM failover
  • mgm.md — Video generation with SD Turbo + Kokoro TTS
  • tts.md — TTS utilities

Analysis & Clustering

Utilities & Reference

Browser Extension

Shell Scripts

Shell scripts for various pipeline tasks. See individual directory READMEs for full usage documentation.

DirectoryDescription
db/README.mdBatch processing, vector generation, reporting scripts (37 scripts)
llm/README.mdLLM testing, SVO extraction, bias testing scripts (15 scripts)
ner/README.mdNER service management scripts
ner-hub/README.mdNER processor scripts
mgm/README.mdVideo generation scripts
mp3/README.mdTTS batch processing scripts
vec/README.mdMemgraph vector database scripts
dbscan/README.mdArticle clustering scripts
redist/README.mdModel training scripts
semantic/README.mdSemantic search scripts

Environment & Setup


Quick Reference Index

Need...Use
Load RSS feedsmake loadmain_go.md
Extract entitiesmake nerner-hub/main.go
Search articleshybrid.mdpython db/hybrid.py
Generate vectorsmake vectormongo2chroma.md
Detect biasmake t5biasllm/bias_processor.py
Create reportsmake runreportreport.md
Text-to-speechmake mp3smallmgm.md
Train custom modelmake lora-fullLoRA-train/README.md
Serve modelmake lora-serveLoRA-server/server.py
Browser extensionbrowser-extension/README.md
Dashboardmake dashboarddashboard.md
Full pipelinemake testrunmakefile.md

Environment Variables

Copy .env.example to .env and fill in your values:

# MongoDB
MONGO_URI=mongodb://user:pass@host:27017
MONGO_USER=root
MONGO_PASS=your_password_here

# LLM APIs
GEMINI_API_KEY=your_gemini_api_key
GROQ_API_KEY=your_groq_api_key
OLLAMA_HOST=localhost:11434

# Services
NER_URL=http://localhost:8100/extract
T5_PORT=1337
CHROMA_PATH=./chroma_db

See .env.example for the complete list.

Directory Structure

propaganda/
├── rss/               # RSS feed aggregator (Go)
├── Makefile           # Pipeline tasks
├── config/            # Feed configs
├── db/                # Database scripts
│   ├── mongo2chroma.py
│   ├── hybrid.py
│   ├── geminize.py
│   └── report.py
├── ner-hub/           # Named Entity Recognition (Go)
├── llm/               # LLM processing
├── t5/                # T5 bias detection
├── mgm/               # Video generation
├── front/             # React web UI
├── back/              # Express API
├── dashboard/         # Streamlit dashboard
└── docs/              # Documentation

Frontend

cd front && npm install && npm start

API server:

cd back && node server.js

Dashboard

cd dashboard && streamlit run app.py

License

MIT — 100% local, no API keys required (except Gemini optional).

Contributors

CodeAKrome

213 commits

CodeAKrome/propaganda

Propaganda analysis.

0

stars

213

commits

HTML

primary language

May 31, 2026

updated

README

Image

Propaganda — News Analysis Pipeline

A complete local-first news aggregation, analysis, and reporting pipeline.

Architecture

┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│  RSS Feeds  │───▶│  MongoDB    │───▶│  NER        │
│  (main.go)  │    │  (Articles) │    │  (Flair)    │
└─────────────┘    └─────────────┘    └─────────────┘
                                              │
                   ┌──────────────────────────┘
                   ▼
              ┌─────────────┐    ┌─────────────┐    ┌─────────────┐
              │  ChromaDB   │◀──▶│  Hybrid     │───▶│  Report     │
              │  (Vectors)  │    │  Search     │    │  Generation │
              └─────────────┘    └─────────────┘    └─────────────┘
                                              │
                   ┌──────────────────────────┘
                   ▼
              ┌─────────────┐    ┌─────────────┐
              │  T5 Bias    │    │  Video Gen  │
              │  Detection  │    │  (MGM)      │
              └─────────────┘    └─────────────┘

Quick Start

# 1. Load RSS feeds
cd rss && go run . ../config/big.tsv ../config/kill.tsv

# 2. Run NER
cd ner-hub && go run . --start-date -7 endpoints.tsv

# 3. Generate vectors
python db/mongo2chroma.py load --limit 100

# 4. Search articles
python db/hybrid.py "climate change" -n 10

# 5. Generate report
python db/report.py -7 climate_news "Climate developments" Climate

# 6. Generate video
python mgm/mgm.py article.txt output.mp4

Or use the Makefile:

make testrun    # Full pipeline
make smallthingsthatgo  # Quick test

New Capabilities

Vector Loading with Slack Backfill

Load up to 3333 articles per run, backfilling with older articles if date range has fewer:

# Via Makefile (default: 3333)
make vector

# Via Python directly
python db/mongo2chroma.py load --start-date -2 --slack 3333

See docs/slack_backfill.md for details.

Media Coverup Detection

Analyze bias data to find subjects with extreme coverage bias:

# Interactive CLI with Rich
python scripts/find_media_coverups.py --output interactive

# Output to CSV/JSON
python scripts/find_media_coverups.py --output csv,json

# Via Makefile
make analyze-bias-coverage

See docs/media_coverups.md for details.

Token Counting

Count tokens in text files:

# Fast estimation (chars/4)
python llm/tools/count_tokens.py input.txt

# Accurate count with tiktoken
python llm/tools/count_tokens.py input.txt --accurate

Title Printing in Reports

Report generation now prints all article titles for transparency:

=== [israel] Processing 40 articles (before cypher) ===
 "Israel announces new military operation in Gaza"
 "Netanyahug meets with Biden at White House"
 "Israeli forces raid West Bank refugee camp"
...

Components

Data Ingestion

FileDescription
MakefilePipeline orchestration (full reference)
FileDescription
mongo2chroma.pyMongoDB → ChromaDB vector loader
hybrid.pyHybrid vector + BM25 search
geminize.pyLLM processing pipeline
report.pyNews report generation

AI Services

FileDescription
ner/main.pyNamed Entity Recognition (Flair)
ollamaai.pyOllama LLM client
mgm/mgm.pyVideo generation (SD Turbo + Kokoro)

Bias Detection

FileDescription
t5/bias_detector/T5+LoRA bias detection
llm/bias_processor.pyLLM-based bias processing

Documentation (Complete)

Data Ingestion & NER

Database & Search

LLM & Bias

Training

  • lora.md — LoRA training pipeline

Reporting & Generation

  • report.md — News report generation with LLM failover
  • mgm.md — Video generation with SD Turbo + Kokoro TTS
  • tts.md — TTS utilities

Analysis & Clustering

Utilities & Reference

Browser Extension

Shell Scripts

Shell scripts for various pipeline tasks. See individual directory READMEs for full usage documentation.

DirectoryDescription
db/README.mdBatch processing, vector generation, reporting scripts (37 scripts)
llm/README.mdLLM testing, SVO extraction, bias testing scripts (15 scripts)
ner/README.mdNER service management scripts
ner-hub/README.mdNER processor scripts
mgm/README.mdVideo generation scripts
mp3/README.mdTTS batch processing scripts
vec/README.mdMemgraph vector database scripts
dbscan/README.mdArticle clustering scripts
redist/README.mdModel training scripts
semantic/README.mdSemantic search scripts

Environment & Setup


Quick Reference Index

Need...Use
Load RSS feedsmake loadmain_go.md
Extract entitiesmake nerner-hub/main.go
Search articleshybrid.mdpython db/hybrid.py
Generate vectorsmake vectormongo2chroma.md
Detect biasmake t5biasllm/bias_processor.py
Create reportsmake runreportreport.md
Text-to-speechmake mp3smallmgm.md
Train custom modelmake lora-fullLoRA-train/README.md
Serve modelmake lora-serveLoRA-server/server.py
Browser extensionbrowser-extension/README.md
Dashboardmake dashboarddashboard.md
Full pipelinemake testrunmakefile.md

Environment Variables

Copy .env.example to .env and fill in your values:

# MongoDB
MONGO_URI=mongodb://user:pass@host:27017
MONGO_USER=root
MONGO_PASS=your_password_here

# LLM APIs
GEMINI_API_KEY=your_gemini_api_key
GROQ_API_KEY=your_groq_api_key
OLLAMA_HOST=localhost:11434

# Services
NER_URL=http://localhost:8100/extract
T5_PORT=1337
CHROMA_PATH=./chroma_db

See .env.example for the complete list.

Directory Structure

propaganda/
├── rss/               # RSS feed aggregator (Go)
├── Makefile           # Pipeline tasks
├── config/            # Feed configs
├── db/                # Database scripts
│   ├── mongo2chroma.py
│   ├── hybrid.py
│   ├── geminize.py
│   └── report.py
├── ner-hub/           # Named Entity Recognition (Go)
├── llm/               # LLM processing
├── t5/                # T5 bias detection
├── mgm/               # Video generation
├── front/             # React web UI
├── back/              # Express API
├── dashboard/         # Streamlit dashboard
└── docs/              # Documentation

Frontend

cd front && npm install && npm start

API server:

cd back && node server.js

Dashboard

cd dashboard && streamlit run app.py

License

MIT — 100% local, no API keys required (except Gemini optional).

Contributors

CodeAKrome

213 commits

Languages

HTML

92.9%

Python

5.4%