xlm-r-biasscanner-ellul
bias and propaganda detector in news
2 min readupdated
Created by Tim Mentzer, this model is designed to analyze English and German news texts for hidden bias and propaganda techniques. Built on the XLM-RoBERTa-base base model, it is augmented with four parallel prediction heads. It does more than just indicate whether bias is present; it evaluates its strength, identifies the dominant type, and pinpoints specific manipulations from 38 possible categories according to the Mentzer-Leidner taxonomy. This tool will be useful for media researchers, journalists, and analytics developers building systems for the automatic audit of news texts and articles.
Key features
- Bilingual: support for texts in English and German.
- Multi-task: simultaneous evaluation of binary bias, effect strength, manipulation types, and dominant category.
- Precise taxonomy: classification across 38 detailed propaganda and bias types.
- Ordinal regression: assessment of bias intensity on a scale from zero to one.
What you can do
- News analysis: evaluate individual sentences and aggregate results across entire articles or publications.
- Media research: examine materials for hidden rhetoric and propaganda techniques.
- Pipeline integration: incorporate the model into analytical dashboards and text-checking add-ons.
Example
Sample code for loading the custom architecture and getting predictions from all four model heads:
import json
import torch
import torch.nn as nn
from pathlib import Path
from huggingface_hub import snapshot_download
from transformers import AutoConfig, AutoModel
local_dir = Path(snapshot_download("Timperator2/xlm-r-biasscanner-ellul"))
cfg = json.loads((local_dir / "config.json").read_text())
backbone_cfg = AutoConfig.from_pretrained(local_dir / "backbone")
backbone = AutoModel.from_config(backbone_cfg).float()
Read more
DetailsBinary F1: 0.890, ROC-AUC: 0.963
Bias strength Mean Absolute Error (MAE): 0.112
Trained on the ELLUL dataset (3,668 annotated sentences)
Requirements: graphics card with CUDA support (recommended for inference)










Comments