/ Модель

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

Контекст
514 токенов
Параметры
152 млн
Лицензия
CC BY-NC 4.0
Архитектура
roberta · dense
Базовая модель
POLITICS
Библиотека
transformers
Опубликована
28 апр 2025

political-leaning-politics

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

RoBERTa-модель для классификации англоязычных текстов о политике США по ориентации: левая, центристская или правая.

483скачиваний за 30 дней9лайковвеса обновлены21 июл 2025

Бенчмарки

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

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

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

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

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

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

Matous Volf и Jakub Simko разработали модель для классификации политической ориентации текста. Она относит текст к одному из трёх классов: левый, центристский или правый; оценки классов представлены как вероятности. Модель основана на POLITICS и дообучена на новостных статьях, публикациях в социальных сетях и сгенерированных языковой моделью политологических высказываниях.

Модель предназначена для анализа англоязычных текстов в контексте политики США: понятия «левый» и «правый» здесь связаны преимущественно с либеральными взглядами и Демократической партией, а также с консервативными взглядами и Республиканской партией. Она использует архитектуру RoBERTa, содержит 151,8 млн параметров и принимает последовательности длиной до 514 токенов. Для входных текстов, которые могут быть неполитическими, авторы рекомендуют предварительно применять отдельный классификатор политичности: эта модель сама не определяет, относится ли текст к политике.

Модель создана в рамках исследования об автоматической классификации политической ориентации и политичности текста. На приведённых в карточке тестовых наборах указаны точность 84,7–89,2% и F1 84,6–89,2%; результаты зависят от набора данных и не гарантируют качество на текстах вне обучающего распределения. Весы опубликованы в формате Safetensors, лицензия — CC BY-NC 4.0, допускающая использование с некоммерческими ограничениями.

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

  • Определение политической ориентации новостной статьи
  • Классификация политических публикаций в социальных сетях
  • Анализ политических высказываний на левый, центристский или правый уклон

Ограничения

Модель ориентирована на англоязычный контекст политики США, поэтому её метки не следует напрямую трактовать как универсальную политическую шкалу. Она не проверяет, является ли текст политическим, а качество может снижаться на текстах, не похожих на обучающие данные.

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

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

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

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

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

Открыть на Hugging Face

Text political leaning classifier based on POLITICS

This model classifies text by its political leaning into three classes: left, center, right. It has been trained on news articles, social network posts and LLM-generated politological statements. The training data comes from the context of the United States, and so the left class is mostly defined by the liberal ideology and democratic party views, and the same applies for the right class being closely tied to the conservative and republican views.

The model is a part of the research done in the paper Political Leaning and Politicalness Classification of Texts. It focuses on predicting political leaning as well as politicalness – a binary class indicating whether a text even is about politics or not. We have benchmarked the existing models for politicalness and shown that one of them – Political DEBATE – achieves an \(F_1\) score of over 90 %. This makes it suitable for filtering non-political texts in front of a political leaning classifier like this one. We recommend doing so if the input to this model is not guaranteed to be about politics.

Our paper addresses the challenge of automatically classifying text according to political leaning and politicalness using transformer models. We compose a comprehensive overview of existing datasets and models for these tasks, finding that current approaches create siloed solutions that perform poorly on out-of-distribution texts. To address this limitation, we compile a diverse dataset by combining 12 datasets for political leaning classification and creating a new dataset for politicalness by extending 18 existing datasets with the appropriate label. Through extensive benchmarking with leave-one-in and leave-one-out methodologies, we evaluate the performance of existing models and train new ones with enhanced generalization capabilities.

Alongside the paper, we release the complete source code and results. A second, larger model has also been produced and deployed in a demo web app.

Usage

The model outputs 0 for the left, 1 for the center and 2 for the right leaning. The score of the predicted class is between \(\frac{1}{3}\) and 1.

To use the model, you can either utilize the high-level Hugging Face pipeline:

from transformers import pipeline

pipe = pipeline(
    "text-classification",
    model="matous-volf/political-leaning-politics",
    tokenizer="launch/POLITICS"
)

text = "The government should raise taxes on the rich so it can give more money to the homeless."

output = pipe(text)
print(output)

Or load it directly:

from torch import argmax
from transformers import AutoModelForSequenceClassification, AutoTokenizer
from torch.nn.functional import softmax

tokenizer = AutoTokenizer.from_pretrained("launch/POLITICS")
model = AutoModelForSequenceClassification.from_pretrained("matous-volf/political-leaning-politics")

text = "The government should cut taxes because it is not using them efficiently anyway."

tokens = tokenizer(text, return_tensors="pt")
output = model(**tokens)
logits = output.logits

political_leaning = argmax(logits, dim=1).item()
probabilities = softmax(logits, dim=1)
score = probabilities[0, political_leaning].item()
print(political_leaning, score)

Evaluation

The following table displays the performance of the model on test sets (15 %) of the datasets used for training.

datasetaccuracy\(F_1\) score
Article bias prediction84.784.6
BIGNEWSBLN89.289.2
CommonCrawl news articles85.285.1
Dem., rep. party platform topics77.677.3
GPT-4 political bias84.884.2
GPT-4 political ideologies97.597.5
Media political stance90.891.1
Political podcasts99.499.5
Political tweets76.476.2
Qbias51.651
average83.783.6

The following is an example of a confusion matrix, after evaluating the model on a test set from the CommonCrawl news articles dataset.

The complete results of all our measurements are available in the source code repository.

Training

This model is based on POLITICS, a pretrained model on English news articles of politics. All the datasets used for fine-tuning are listed in the paper, as well as a detailed description of the preprocessing, training and evaluation methodology. In summary, we have run a hyperparameter search with a setup designed for maximizing performance on unseen types of text (out-of-distribution) to increase the model's generalization abilities. In this setup, we have left one of the datasets at a time out of the training sample and used it as the validation set. Then, we have taken the resulting optimal hyperparameters and trained this model on all the available datasets.

Authors

Citation

BibTeX

@misc{volf-simko-2025-political-leaning,
  title        = {Political Leaning and Politicalness Classification of Texts},
  author       = {Matous Volf and Jakub Simko},
  year         = 2025,
  url          = {https://arxiv.org/abs/2507.13913},
  eprint       = {2507.13913},
  archiveprefix = {arXiv},
  primaryclass = {cs.CL}
}

APA

Volf, M. and Simko, J. (2025). Political Leaning and Politicalness Classification of Texts. DELTA – High school of computer science and economics, Pardubice, Czechia; Kempelen Institute of Intelligent Technologies, Bratislava, Slovakia.

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
RobertaForSequenceClassification
Ревизия весов
bd4cf01

0 моделей