/ Модель

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

Контекст
4 098 токенов
Параметры
152 млн
Лицензия
MIT
Архитектура
longformer · dense
Базовая модель
longformer-base-4096
Опубликована
6 фев 2026

longformer-framing-gold

Классификация текстаТекст → label3 профессии
104скачиваний за 30 дней0лайковвеса обновлены12 фев 2026

Описание модели

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

Англоязычный классификатор Longformer выявляет до 15 медийных фреймов в новостных и политических текстах.

Модель ry-rousseau/longformer-framing-gold — многометочная модель классификации текста на основе Longformer, разработанная Райаном Руссо. Она определяет до 15 медийных фреймов в новостных статьях и политических текстах по таксономии Media Frames Corpus, например экономические последствия, ресурсы и моральные аргументы. Модель обучена в два этапа: на размеченных Mistral-7B примерно 380 тысячах статей, а затем дообучена на человеческих аннотациях из Media Frames Corpus и SemEval 2023 Task 3. Для предсказаний можно добавлять тему статьи; модель использует разреженное внимание и поддерживает длинные тексты.

Модель предназначена для анализа медийной подачи, политической коммуникации, поляризации и публикаций в социальных сетях. В README указано значение weighted F1 0,686 на тестовом наборе и преимущество над использованными авторами генеративными подходами в этой задаче. Это англоязычная модель на 151,8 млн параметров с контекстом до 4098 токенов; лицензия — MIT. Ограничения: качество зависит от представления фреймов и распределения данных, а результаты по отдельным классам неоднородны; например, для Capacity and Resources указан F1 0,46. Оценка «без галлюцинаций» в README относится к тому, что классификатор выбирает метки, а не генерирует свободный текст.

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

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

Ограничения

Качество классификации различается между классами; в README для Capacity and Resources указан F1 0,46. Показатель weighted F1 0,686 получен на тестовом наборе автора, поэтому он не гарантирует такое же качество на других темах и источниках.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus

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

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

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

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

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

Открыть на Hugging Face

Media Framing Detector with Longformer

A multi-label transformer model for detecting media frames in news articles and political text. This model identifies up to 15 distinct framing strategies used in communication, based on the Media Frames Corpus taxonomy (Card et al., 2015).

Model Description

This Longformer-based classifier detects media frames in text up to ~1,600 words, addressing key limitations in existing approaches:

  • No hallucination: Unlike GenAI prompt-engineering approaches, this discriminative model cannot hallucinate non-existent frames
  • Long context: Handles full articles (2048 tokens) using sparse attention, unlike sentence-level classifiers
  • Human-aligned: Fine-tuned on gold-standard human annotations from 19 trained annotators, combining best available data for the task

Performance: Weighted F1 of 0.686 on held-out test set, outperforming GenAI approaches while being 47x smaller than mm-framing's Mistral-7B. Trained on 385,000 total articles across political spectrum from 24 independent news providers.

Read the full write-up: https://ry-rousseau.github.io/2026/02/09/longformer-framing-classifier.html

Intended Uses

  • Automated detection of argumentation strategies in news media
  • Analysis of political communication and polarization
  • Social media content analysis (posts, threads, articles)
  • Bias detection
FrameDescription (Card et al., 2015 / Boydstun et al., 2014)
EconomicThe costs, benefits, or other financial implications of the issue.
Capacity and ResourcesThe availability of physical, human, or financial resources, and the capacity of current systems.
MoralityAny perspective or policy objective/action compelled by religious doctrine, ethics, or social responsibility.
Fairness and EqualityThe balance or distribution of rights, responsibilities, and resources; equality or inequality in the application of laws.
Legality, Constitutionality and JurisprudenceThe rights, freedoms, and authority of individuals, corporations, and government (focuses on the constraints/freedoms granted via the Constitution or laws).
Policy Prescription and EvaluationDiscussion of specific policies aimed at addressing problems, and the evaluation of whether certain policies will work or are working.
Crime and PunishmentThe effectiveness and implications of laws and their enforcement (includes breaking laws, loopholes, sentencing, and punishment).
Security and DefenseThreats to the welfare of the individual, community, or nation (includes protection from not-yet-manifested threats).
Health and SafetyHealth care access/effectiveness, sanitation, disease, mental health, and public safety (e.g., infrastructure safety).
Quality of LifeThreats and opportunities for the individual's wealth, happiness, and well-being (effects on mobility, ease of routine, community life).
Cultural IdentityThe traditions, customs, or values of a social group in relation to a specific policy issue.
Public OpinionAttitudes and opinions of the general public, including polling and demographics.
PoliticalConsiderations related to politics and politicians, including lobbying, elections, and attempts to sway voters (explicit mentions of partisan maneuvering).
External Regulation and ReputationThe international reputation or foreign policy of the U.S. (relations with other nations, trade agreements).
OtherAny coherent group of frames not covered by the above categories.

How to Use

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

# Load model and tokenizer
model_name = "ry-rousseau/media-framing-longformer"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

# Prepare input with topic injection (highly recommended)
topic = "immigration" # or use topic classifier
text = "Your article text here..."
input_text = f"TOPIC:{topic}\n{text}"

# Tokenize and predict
inputs = tokenizer(input_text, return_tensors="pt", truncation=True, max_length=2048)
outputs = model(**inputs)

# Get predictions (apply optimized thresholds per class)
probs = torch.sigmoid(outputs.logits)
predictions = (probs > 0.5).int() # Use class-specific thresholds for better performance

# Frame labels
frames = [
"Economic", "Capacity and Resources", "Morality", "Fairness and Equality",
"Legality, Constitutionality and Jurisprudence", "Policy Prescription and Evaluation",
"Crime and Punishment", "Security and Defense", "Health and Safety",
"Quality of Life", "Cultural Identity", "Public Opinion", "Political",
"External Regulation and Reputation", "Other"
]

detected_frames = [frames[i] for i, pred in enumerate(predictions[0]) if pred == 1]
print("Detected frames:", detected_frames)

The topic classifier is RoBERTa with a head-tail truncation strategy for long articles, trained on 64,000 examples:

Training Data

Gold Standard (Human Annotations)

  • Media Frames Corpus (MFC): 2,224 NYT articles on immigration, same-sex marriage, and smoking (1990-2012)
  • SemEval 2023 Task 3: 516 articles on Ukraine-Russia war, COVID-19, migration, abortion, climate change (2020-2022)
  • Total: 2,740 articles with annotations from 19 trained human annotators
  • Annotation strategy: Union of annotations (mean 4.14 frames per article)

Silver Training Data

  • Source: copenlu/mm-framing dataset
  • Size: ~380,000 articles labeled by Mistral-7B
  • Purpose: Pre-training to learn frame patterns before gold fine-tuning

Training Procedure

Phase 1: Silver Training

Trained on machine-labeled data to learn broad frame patterns:

  • Model: allenai/longformer-base-4096
  • Loss: Binary cross-entropy with class weights
  • Epochs: 4
  • Batch size: 16 (effective 32 with gradient accumulation)
  • Learning rate: 2e-5
  • Duration: 72 hours on NVIDIA A40 (48GB VRAM)

Phase 2: Gold Fine-Tuning

Fine-tuned on human annotations to align with expert reasoning:

  • Loss: Focal loss (gamma=2.0) to focus on difficult examples
  • Epochs: 10
  • Batch size: 2 (effective 16 with gradient accumulation)
  • Learning rate: 2e-5 with scheduler
  • Validation: 90/10 split

Key Features

  • Topic injection: Prepending article topic improves Micro F1 by +2.7%
  • Global attention: Applied to [CLS] token and topic token for mixture-of-experts effect
  • Threshold optimization: Post-training per-class threshold tuning for class imbalance

Evaluation Results

Overall Performance (Test Set)

MetricScore
Weighted F10.686
Micro F10.685
Macro F10.645

Per-Frame Performance

FramePrecisionRecallF1Support
Economic0.780.700.7487
Capacity & Resources0.440.480.4625
Morality0.530.640.5861
Fairness & Equality0.600.520.5663
Legality0.830.790.81164
Policy Prescription0.580.850.69110
Crime & Punishment0.630.860.7387
Security & Defense0.490.720.5829
Health & Safety0.610.770.6869
Quality of Life0.570.740.6496
Cultural Identity0.460.740.5772
Public Opinion0.510.770.6181
Political0.700.940.81134
External Regulation0.920.410.5729

Note: "Other" frame excluded from evaluation metrics, as per SemEval method.

More Info

Model will be iterated in future. It should run on most mid-range GPUs locally with gradient accumulation.

@misc{rousseau2026framing, title={15-Class Media Framing Detector with Longformer}, author={Rousseau, Ryan}, year={2026}, howpublished={\url{https://huggingface.co/ry-rousseau/media-framing-longformer}} }

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
LongformerForSequenceClassification
Ревизия весов
138009f

0 моделей