Skip to content

About

Propaganda analysis.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

213 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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

File Description
Makefile Pipeline orchestration (full reference)

Database & Search

File Description
mongo2chroma.py MongoDB β†’ ChromaDB vector loader
hybrid.py Hybrid vector + BM25 search
geminize.py LLM processing pipeline
report.py News report generation

AI Services

File Description
ner/main.py Named Entity Recognition (Flair)
ollamaai.py Ollama LLM client
mgm/mgm.py Video generation (SD Turbo + Kokoro)

Bias Detection

File Description
t5/bias_detector/ T5+LoRA bias detection
llm/bias_processor.py LLM-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.

Directory Description
db/README.md Batch processing, vector generation, reporting scripts (37 scripts)
llm/README.md LLM testing, SVO extraction, bias testing scripts (15 scripts)
ner/README.md NER service management scripts
ner-hub/README.md NER processor scripts
mgm/README.md Video generation scripts
mp3/README.md TTS batch processing scripts
vec/README.md Memgraph vector database scripts
dbscan/README.md Article clustering scripts
redist/README.md Model training scripts
semantic/README.md Semantic search scripts

Environment & Setup


Quick Reference Index

Need... Use
Load RSS feeds make load β†’ main_go.md
Extract entities make ner β†’ ner-hub/main.go
Search articles hybrid.md β†’ python db/hybrid.py
Generate vectors make vector β†’ mongo2chroma.md
Detect bias make t5bias β†’ llm/bias_processor.py
Create reports make runreport β†’ report.md
Text-to-speech make mp3small β†’ mgm.md
Train custom model make lora-full β†’ LoRA-train/README.md
Serve model make lora-serve β†’ LoRA-server/server.py
Browser extension browser-extension/README.md
Dashboard make dashboard β†’ dashboard.md
Full pipeline make testrun β†’ makefile.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).

About

Propaganda analysis.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages