Propaganda Pipeline¶
Propaganda Pipeline is an open-source Python library for the automatic detection of propaganda techniques in text. It combines large language models, consistency testing, and an LLM-as-a-judge consolidation stage to deliver robust, evidence-backed results across 23 persuasion techniques.
The library is free to use and distributed under the MIT license.
Highlights¶
23 Persuasion Techniques
Detects the full inventory defined in the JRC annotation guidelines, from Loaded Language and Name Calling to False Dilemma and Slippery Slope.
Detects the full inventory defined in the JRC annotation guidelines, from Loaded Language and Name Calling to False Dilemma and Slippery Slope.
LLM-as-a-Judge Consolidation
A dedicated judge module scores and ranks candidate detections, resolving conflicts and filtering out weak signals before producing the final answer.
A dedicated judge module scores and ranks candidate detections, resolving conflicts and filtering out weak signals before producing the final answer.
Consistency Testing
Runs the analysis pipeline multiple times and aggregates results by detection ratio, ensuring only reproducible detections are reported.
Runs the analysis pipeline multiple times and aggregates results by detection ratio, ensuring only reproducible detections are reported.
Span-level Evidence
Every detection comes with verbatim text spans extracted from the source, a confidence score, and a plain-language rationale summary.
Every detection comes with verbatim text spans extracted from the source, a confidence score, and a plain-language rationale summary.
HTML Visualizations
Built-in rendering highlights detected spans directly in the source text, with color-coded badges per technique for easy inspection in notebooks.
Built-in rendering highlights detected spans directly in the source text, with color-coded badges per technique for easy inspection in notebooks.
DSPy + OpenAI Backend
Built on DSPy for structured LLM programming. Compatible with any OpenAI-compatible model endpoint.
Built on DSPy for structured LLM programming. Compatible with any OpenAI-compatible model endpoint.
Modular & Extensible
Each technique is an independent
Each technique is an independent
TechniqueRunner subclass.
You can run all 23 detectors or select a custom subset for your use case.
Structured Pydantic Outputs
All LLM outputs are validated through Pydantic schemas, guaranteeing well-formed, type-safe candidate dicts on every run.
All LLM outputs are validated through Pydantic schemas, guaranteeing well-formed, type-safe candidate dicts on every run.