/ Модель

Характеристики

Контекст
512 токенов
Параметры
152 млн
Лицензия
MIT
Архитектура
deberta-v2 · dense
Базовая модель
geberta-base
Библиотека
transformers
Опубликована
30 сен 2023

german_politic_DeBERTa-v2-base

Классификация текстаТекст → label3 профессии

Немецкий классификатор DeBERTa-v2 для предварительного выявления политических текстов в новостях.

120скачиваний за 30 дней1лайквеса обновлены9 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Модель разработал Sinclair Schneider из Research Institute CODE при Университете Бундесвера в Мюнхене. Это классификатор на архитектуре DeBERTa-v2, дообученный на базе ikim-uk-essen/geberta-base для бинарного определения, относится ли немецкий текст к политике (метка politic) или к другой тематике (other). Размер модели — 151,9 млн параметров; она принимает текст и выдаёт метки классов и оценки вероятности. Контекст при обучении ограничен 512 токенами.

Модель предназначена прежде всего для предварительной фильтрации немецких новостных текстов перед последующим анализом политики. На тестовых данных авторы сообщают точность 99,7%, а на немецких новостях — высокую полноту обнаружения политических статей. Однако обучающие отрицательные примеры преимущественно включали спорт, досуг, рецепты и старую литературу: значительная часть современной неполитической прозы, включая материалы о бизнесе, науке и здоровье, ошибочно распознаётся как политическая. Модель не предназначена для определения идеологии или партийных предпочтений и не рассчитана на тексты не на немецком языке.

Модель распространяется по лицензии MIT. Данные обучения частично состоят из защищённых авторским правом новостных текстов; лицензия на эти тексты в README указана как неизвестная.

Сценарии применения

  • предварительная фильтрация немецких новостей перед анализом политики
  • ранжирование немецких текстов по вероятности политической тематики
  • отбор политических статей с высокой полнотой обнаружения
  • дообучение классификатора на неполитических текстах целевого домена

Ограничения

Модель часто относит к политическим неполитические новости и повседневные тексты, особенно о бизнесе, науке, здоровье, форумах и отзывах; высокая вероятность не означает уверенного обнаружения политики. Она читает только первые 512 токенов, может пропускать короткие политические высказывания и не подходит для не немецких текстов, определения идеологии или автоматических решений о людях без проверки человеком.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

german_politic_DeBERTa-v2-base

This classifier predicts whether a German text is political (politic) or not (other). It is ikim-uk-essen/geberta-base (GeBERTa, a German DeBERTa-v2) fine-tuned on SinclairSchneider/trainset_political_text_yes_no_german. That dataset contains 234,978 texts: political texts from taz, FOCUS online and the Federal Agency for Civic Education (bpb), and non-political texts from Project Gutenberg books, recipes, and taz/FOCUS sport, culture, car, tech and travel articles.

The training script is in this repository: train.py.

Paper: Ideology Prediction of German Political Texts (Schneider, Steuber, Schneider & Dreo Rodosek, ICWSM 2026). In the paper, this model is the pre-filter of the ideology pipeline. Only texts with P(politic) ≥ 0.8 are passed on to the party and ideology classifiers. Code: github.com/SinclairSchneider/german_ideology_prediction.

Summary of results:

  • On a held-out split of its training data, the model reaches 99.7% accuracy / 0.997 weighted F1.
  • On real-world German news (10kGNAD, derStandard.at) it finds almost every political article (recall 99.8%).
  • It also labels most non-political news as political: business 99%, science 99%, panorama 98%, web/tech 87%. Sport is the only section it reliably rejects.
  • It treats some everyday texts the same way, such as forum posts and reviews.
  • See Evaluation and Limitations.

A long-context alternative trained on the same data is SinclairSchneider/german_politic_EuroBERT-210m. The English counterpart is SinclairSchneider/english_politic_RoBERTa-large.

[!IMPORTANT] Before using the model, note:

  • It works as a high-recall "not sport / not leisure" filter rather than a precise politics detector. In the training data, the only modern non-political prose was sport, film, music, car, tech and travel journalism, plus recipes and old literature. Modern texts on other topics are usually classified as politic with confidence above 0.99. That includes economy, science, health, media, panorama, forums and reviews.
  • Raising the threshold doesn't help much. Even at 0.999, 89% of business and 78% of science articles are still labeled politic.
  • Pass truncation=True. The model was trained on at most 512 tokens. Longer inputs don't crash, because DeBERTa uses relative positions, but they are outside what the model saw in training and use more memory.

Quick start

from transformers import pipeline

political_classifier = pipeline("text-classification", model="SinclairSchneider/german_politic_DeBERTa-v2-base")

political_classifier("Trump und Putin einigen sich auf begrenzte Waffenruhe")
# [{'label': 'politic', 'score': 0.9999680519104004}]

political_classifier("Franck Ribéry und Arjen Robben feiern beim \"Beckenbauer Cup\" ihr Comeback beim FC Bayern. Sie präsentieren sich wie zu besten Zeiten und wecken eine große Sehnsucht beim Rekordmeister.")
# [{'label': 'other', 'score': 0.9969837069511414}]

political_classifier("Der Bundestag hat das Gesetz mit den Stimmen der Koalition verabschiedet.")
# [{'label': 'politic', 'score': 0.9999774694442749}]

political_classifier("Mein Laptop startet seit dem letzten Update nicht mehr richtig, hat jemand eine Idee?")
# [{'label': 'politic', 'score': 0.9996838569641113}]   <- wrong: everyday text, see "Limitations"

The outputs were produced on a GPU with transformers 5.15 / torch 2.13. Scores may differ in the last decimal places on other hardware or versions.

Batch usage with a threshold

from transformers import pipeline

political_classifier = pipeline("text-classification", model="SinclairSchneider/german_politic_DeBERTa-v2-base")

texts = [
    "Die Opposition wirft der Regierung Korruption vor.",
    "Für dieses Rezept braucht man zwei Tassen Mehl und eine Prise Salz.",
    " ".join(["Der Bundestag debattierte stundenlang über den neuen Haushaltsentwurf."] * 120),  # > 512 tokens
]
results = political_classifier(texts, truncation=True, top_k=None, batch_size=32)
p_politic = [{d["label"]: d["score"] for d in r}["politic"] for r in results]
print([round(p, 4) for p in p_politic])
# [1.0, 0.0, 1.0]

THRESHOLD = 0.8  # the value used in the ICWSM 2026 paper
print([p >= THRESHOLD for p in p_politic])
# [True, False, True]

Without the pipeline

import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification

repo = "SinclairSchneider/german_politic_DeBERTa-v2-base"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSequenceClassification.from_pretrained(repo).eval()

texts = ["Die NATO-Außenminister berieten in Brüssel über Sanktionen gegen Russland.",
         "Der Stürmer traf zweimal, die Heimmannschaft gewann 3:1."]
enc = tokenizer(texts, truncation=True, max_length=512, padding=True, return_tensors="pt")
with torch.no_grad():
    probs = model(**enc).logits.softmax(dim=-1)
for text, p in zip(texts, probs):
    print(model.config.id2label[int(p.argmax())], round(float(p[1]), 4), text)
# politic 1.0 Die NATO-Außenminister berieten in Brüssel über Sanktionen gegen Russland.
# other 0.0 Der Stürmer traf zweimal, die Heimmannschaft gewann 3:1.

Model details

Developed bySinclair Schneider, Research Institute CODE, Bundeswehr University Munich (NLP Research Group UniBW)
Model typeDebertaV2ForSequenceClassification
Base modelikim-uk-essen/geberta-base (Dada et al., 2023)
Parameters139.2 M
LanguageGerman
Labels0 → other, 1 → politic
Max input length512 tokens
Training dataSinclairSchneider/trainset_political_text_yes_no_german
TrainedOctober 2023
LicenseMIT (same as the base model)
PaperIdeology Prediction of German Political Texts (ICWSM 2026)

Uses

Direct use

  • Pre-filtering news-like German text before political analysis, as in the paper. It keeps almost all political articles, and it reliably removes sport, and largely film/music, car, recipe and literary texts.
  • Ranking texts by P(politic). Scores rank better than the hard decisions suggest (ROC-AUC 0.87 out of domain).

Downstream use

  • As a starting point for fine-tuning on a target domain. Adding modern non-political negatives, such as economy, science, health, local news, forums and reviews, would likely fix the main weakness described below.

Out-of-scope use

  • Separating political from non-political content in general news or everyday text without further validation. Most non-sport news is labeled political.
  • Political stance, ideology or party detection. For that, see the paper's ideology classifiers.
  • Automated decisions about individuals, such as moderation, without human review.
  • Non-German text.

Training data

LabelSourceRows
politictaz.de, articles tagged Politik80,663
politicbpb.de (Federal Agency for Civic Education)31,282
politicFOCUS online, section politik5,544
otherProject Gutenberg, paragraphs of German books85,983
othertaz.de, Sport/Film/Musik13,710
otherChefkoch.de recipe instructions9,009
otherFOCUS online, sport/auto/digital/reisen8,787

These are 117,489 texts per class. 81% of the other class is literature and recipes, and the political texts are much longer: median 532 words vs. 118. The dataset card lists composition, duplicates and known artifacts.

Training procedure

Preprocessing

The raw text column was used without cleaning. It was tokenized with the GeBERTa SentencePiece tokenizer (cased) and truncated to 512 tokens, and batches were padded dynamically. The SentencePiece tokenizer treats line breaks like spaces, so the model never sees line structure. The data was split randomly 80/20 with train_test_split(0.2) and no seed, giving 187,982 train / 46,996 eval texts. That split can't be reproduced exactly, and duplicate texts in the dataset can end up on both sides.

Training hyperparameters

HyperparameterValue
OptimizerAdamW (adamw_torch, default betas/epsilon)
Learning rate2e-5, linear decay to 0, no warm-up
Weight decay0.01
Epochs4 (11,752 steps, 2,938 per epoch)
Batch size16 per GPU × 4 GPUs = 64
Max sequence length512
Precisionfp32
Dropout0.1 (hidden and attention)
Model selectionbest eval loss → epoch 2 (step 5,876) was published
Seed (Trainer)42

Speeds, sizes, times

Hardware4 × NVIDIA RTX 6000 Ada Generation (48 GB)
Training time≈ 2 h 19 min for 4 epochs (≈ 2.45 h including evaluation)
Evaluation throughput≈ 261 texts/s (46,996 texts in ≈ 180 s)
Inference throughput (single GPU)≈ 108 news articles/s (fp32, batch 16, length-sorted 10kGNAD articles, median 298 words)
Total training FLOPs2.31 × 10¹⁷
Checkpoint size557 MB (float32; model.safetensors and pytorch_model.bin)
SoftwarePython 3.10.12, PyTorch 2.0.1, Transformers 4.32.0, Datasets 2.13.1, Tokenizers 0.13.3, SentencePiece 0.1.99

Evaluation

1. In-distribution: held-out 20% of the training data (46,996 texts)

EpochEval lossAccuracyWeighted F1Weighted precisionWeighted recall
10.01060.99620.99620.99620.9962
2 (published)0.01040.99660.99660.99660.9966
30.01110.99690.99690.99690.9969
40.01620.99710.99710.99710.9971

The eval texts come from the same sources, and exact duplicates can appear in both train and eval. These numbers reflect how easy it is to tell the training sources apart, not how well the model generalizes.

2. Out-of-domain: 10kGNAD (derStandard.at)

Setup. 10kGNAD contains 10,273 articles from the Austrian newspaper DER STANDARD (2015–2016). The newspaper's moderators sorted them into 9 sections, and 10,271 articles remain after removing duplicates.

Target: the sections Inland (domestic politics, 1,014) and International (1,510) count as politic; all others count as other (7,747). The model input was the article text (median 298 words), truncated to 512 tokens.

InputAccuracyPrecision (politic)Recall (politic)F1 (politic)Macro F1ROC-AUC
Full article0.4150.2960.9980.4560.4120.866
First 100 words0.4270.3000.9970.4610.4240.863
First sentence0.4800.3070.8860.4560.4790.728

Confusion matrix, full article at 0.5: TN 1,743 · FP 6,004 · FN 5 · TP 2,519.

Share of each section predicted as politic (full article)

ThresholdInlandInternationalWirtschaftWissenschaftPanoramaWebEtat (media)KulturSport
0.599.9%99.7%99.0%98.6%97.9%86.7%80.8%64.4%4.9%
0.8 (paper)99.7%99.6%98.6%97.6%97.2%84.7%77.2%62.0%4.2%
0.9999.2%99.3%96.1%91.8%95.1%78.5%67.5%53.8%3.0%
0.99998.1%98.7%88.5%78.4%91.4%67.8%56.1%45.8%2.1%

The median P(politic) is 1.0000 for Wirtschaft and Panorama, 0.9999 for Wissenschaft, 0.9998 for Web, 0.9996 for Etat, 0.9976 for Kultur and 0.0000 for Sport.

Threshold sweep

Full articles:

ThresholdAccuracyPrecisionRecallF1 (politic)Macro F1
0.50.4150.2960.9980.4560.412
0.80.4250.2990.9960.4600.422
0.90.4300.3010.9960.4620.428
0.990.4560.3100.9930.4730.455
0.9990.5080.3310.9850.4960.508

What goes wrong

  • The section labels are partly noisy. The highest-scoring "false positives" really are political. derStandard filed much of its 2015 refugee-crisis and Greek-debt-crisis coverage under Panorama and Wirtschaft, e.g. "Der ungarische Premier Viktor Orbán erklärte in Wien, warum er den Grenzzaun …" (Panorama, 0.99999) or "Alexis Tsipras und seine linksgeführte Regierung haben ihre Wette gewonnen …" (Wirtschaft, 0.99999).
  • Most errors are genuine, though. In random samples of 10 false positives each from Wissenschaft and Web, by our reading 7 and 6 respectively were clearly non-political. Examples: a study on empathy in parrots (0.978), climbing plants in the rainforest (1.0), a NASA magnetosphere mission (0.9999), the Windows 10 release (0.9999), a mobile game update (0.998).
  • Only 5 political articles were missed. Two are one-line stubs ("Das Land im Herzen Afrikas kommt nicht zur Ruhe.", "Vorläufiges Endergebnis mit Mandatsverteilung."). The others are a football article and two film/culture pieces filed under International.
  • The scores are overconfident. 92.7% of all predictions have a confidence ≥ 0.99, but only 41.5% of those are correct.
  • Length doesn't matter. Accuracy is 0.37–0.44 and the false-positive rate on non-political articles is 73–80% in every length bin (< 100 to ≥ 500 words).

3. Short sentences and everyday texts

These are hand-written examples, not drawn from any dataset. 13 of 19 are correct at 0.5.

TextGoldP(politic)
Der Senat hat die neue Verfassungsrichterin bestätigt.politic0.051 ✗
Der Premierminister kündigte für nächsten Monat Neuwahlen an.politic0.99998
Die Abgeordneten debattieren über eine Erhöhung des Mindestlohns.politic0.99998
Der Präsident legte sein Veto gegen den Verteidigungshaushalt ein.politic0.997
Die NATO-Außenminister berieten in Brüssel über Sanktionen gegen Russland.politic0.99999
Die Opposition wirft der Regierung Korruption vor.politic0.99998
Der Bundestag hat das Gesetz mit den Stimmen der Koalition verabschiedet.politic0.99998
Trump und Putin einigen sich auf begrenzte Waffenruhepolitic0.99997
Ich gehe gerne ins Fitnessstudio.other0.009
Für dieses Rezept braucht man zwei Tassen Mehl und eine Prise Salz.other0.00001
Der Stürmer traf zweimal, die Heimmannschaft gewann 3:1.other0.00004
Das neue Smartphone hat einen größeren Akku und eine bessere Kamera.other0.007
Die Band kündigte eine Welttournee ab März an.other0.953 ✗
Forscher haben im Regenwald eine neue Froschart entdeckt.other0.916 ✗
Ausreichend Wasser zu trinken ist wichtig für die Gesundheit.other0.002
Unser Hotel hatte einen wunderschönen Blick auf den Strand.other0.979 ✗
Mein Laptop startet seit dem letzten Update nicht mehr richtig, hat jemand eine Idee?other0.9997 ✗
Seit geraumer Zeit passiert es immer häufiger, dass das Tachodisplay beim Aufsperren als auch Starten des Fahrzeugs schwarz bleibt. …other0.9996 ✗
Franck Ribéry und Arjen Robben feiern beim "Beckenbauer Cup" ihr Comeback beim FC Bayern. …other0.003

4. Shortcut probes

The training data's other class is dominated by Gutenberg paragraphs, which are hard-wrapped at about 70 characters and often use pre-1996 spelling. To check whether the model relies on these surface cues, they were applied to the 2,524 political 10kGNAD articles:

ModificationPredicted politic
None99.8%
Hard line breaks every 70 characters (Gutenberg style)99.8%
dass → daß (old spelling; 1,631 articles containing dass)99.9% → 99.9%
First 100 words only99.7%
First sentence only88.6%

The model is robust to line breaks, because its tokenizer ignores them, and to the dass/daß spelling. Its weakness is topical coverage, not surface formatting. By contrast, the EuroBERT model trained on the same data flips 94% of these articles to other when they are hard-wrapped.

Bias, risks, and limitations

  • "Political" effectively means "modern news prose that is not about sport or leisure". The training negatives cover sport, film, music, cars, tech gadgets, travel, recipes and historical literature. Economy, science, health, media, panorama, regional news, forums and reviews are missing, and the model calls most of them political.
  • German news from the 2010s–2023. The training news comes from German outlets only (taz, FOCUS, bpb), with no Austrian or Swiss news. The model still finds Austrian political news (10kGNAD), but with the same false positives.
  • Overconfidence. Probabilities near 1.0 are the norm for any news-like text, so they don't indicate that a text is clearly political.
  • Short political statements can be missed. Example: "Der Senat hat die neue Verfassungsrichterin bestätigt." → 0.05.
  • Truncation. Only the first 512 tokens are read.
  • Training data copyright. The training texts are partly copyrighted news articles (license unknown).

Recommendations

  1. Use the model where missing political texts is worse than including non-political ones, e.g. as the first stage of a pipeline whose later stages tolerate noise, as in the paper.
  2. If precision matters, add a second filter, such as a topic classifier or keyword rules for economy, science and culture. Or fine-tune further with modern non-political negatives.
  3. Validate the threshold on a labeled sample of your own data. On news, thresholds between 0.5 and 0.999 change little.
  4. Always pass truncation=True.

Environmental impact

  • Hardware: 4 × NVIDIA RTX 6000 Ada (300 W TDP each), on-premise university GPU server.
  • Time: ≈ 2.45 h, including evaluation.
  • Energy: at most ≈ 2.9 kWh for the GPUs.
  • Carbon emitted: ≈ 1.2 kg CO₂eq, assuming ~0.4 kg CO₂eq/kWh (Lacoste et al., 2019).

These figures cover the published run only. An earlier run in October 2023 on a different version of the data isn't included.

Technical specifications

  • Encoder: DeBERTa-v2 base with 12 layers, hidden size 768, 12 heads, feed-forward size 3,072, GELU and disentangled relative-position attention (c2p + p2c). It uses no absolute position embeddings. The SentencePiece vocabulary has 50,266 tokens and is case-sensitive.
  • Classification head: ContextPooler (dense 768→768 + GELU on the [CLS] token) → dropout → linear 768→2.
  • Objective: softmax cross-entropy.

Citation

If you use this model, please cite the paper:

@article{schneider2026ideology,
  title     = {Ideology Prediction of German Political Texts},
  author    = {Schneider, Sinclair and Steuber, Florian and Schneider, Jo{\~a}o A. G. and Dreo Rodosek, Gabi},
  journal   = {Proceedings of the International AAAI Conference on Web and Social Media},
  volume    = {20},
  number    = {1},
  pages     = {2006--2021},
  year      = {2026},
  doi       = {10.1609/icwsm.v20i1.42735},
  url       = {https://doi.org/10.1609/icwsm.v20i1.42735}
}

Training data:

@misc{schneider_trainset_political_text_yes_no_german,
  author       = {Schneider, Sinclair},
  title        = {German Political vs. Other Text: a weakly labelled training set for political text detection},
  year         = {2025},
  publisher    = {Hugging Face},
  doi          = {10.57967/hf/4925},
  howpublished = {\url{https://huggingface.co/datasets/SinclairSchneider/trainset_political_text_yes_no_german}}
}

Base model:

@inproceedings{dada2023geberta,
  title     = {On the Impact of Cross-Domain Data on {German} Language Models},
  author    = {Dada, Amin and Chen, Aokun and Peng, Cheng and Smith, Kaleb and Idrissi-Yaghir, Ahmad and Seibold, Constantin and Li, Jianning and Heiliger, Lars and Friedrich, Christoph and Truhn, Daniel and Egger, Jan and Bian, Jiang and Kleesiek, Jens and Wu, Yonghui},
  booktitle = {Findings of the Association for Computational Linguistics: EMNLP 2023},
  pages     = {13801--13813},
  year      = {2023}
}

Out-of-domain evaluation data (10kGNAD is derived from the One Million Posts Corpus):

@inproceedings{schabus2017onemillion,
  title     = {One Million Posts: A Data Set of German Online Discussions},
  author    = {Schabus, Dietmar and Skowron, Marcin and Trapp, Martin},
  booktitle = {Proceedings of the 40th International ACM SIGIR Conference on Research and Development in Information Retrieval},
  pages     = {1241--1244},
  year      = {2017},
  doi       = {10.1145/3077136.3080711}
}

Model card authors and contact

Sinclair Schneider, Research Institute CODE, Bundeswehr University Munich. Questions and issues are welcome in the Community tab.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · text-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
DebertaV2ForSequenceClassification
Ревизия весов
20f0729

0 моделей