/ Модель

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

Контекст
514 токенов
Параметры
152 млн
Лицензия
MIT
Архитектура
roberta · dense
Базовая модель
roberta-base
Библиотека
transformers
Опубликована
13 окт 2026

liar-roberta

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

Дообученная RoBERTa классифицирует короткие англоязычные политические заявления как REAL или FAKE, используя закономерности корпуса LIAR, а не проверку фактов.

39скачиваний за 30 дней7лайковвеса обновлены13 окт 2026

Бенчмарки

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

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

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

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

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

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

Модель liar-roberta разработана Md. Emon Hasan: это дообученная на корпусе LIAR модель RoBERTa для бинарной классификации коротких политических высказываний на метки REAL и FAKE. Она основана на FacebookAI/roberta-base, имеет 151,8 млн параметров и принимает текстовое высказывание; контекст модели составляет 514 токенов, а в обучении использовалось максимальное окно 128 токенов. Репозиторий содержит веса Safetensors и ONNX, модель рассчитана на английский язык.

Модель может служить вспомогательным сигналом для предварительной сортировки коротких заявлений и анализа текстов в стиле корпуса PolitiFact. На тестовой выборке LIAR автор сообщает точность 64,5% и macro-F1 0,6351. Это не проверка фактов: модель не использует поиск или базу знаний, а усваивает языковые закономерности из политических заявлений США примерно за 2007–2016 годы. Она плохо подходит для статей целиком, научных и медицинских утверждений, текстов о других странах и темах, а также для решений без проверки человеком; уверенность классификатора не следует считать вероятностью истинности.

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

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

  • Предварительная сортировка коротких политических заявлений по меткам REAL и FAKE
  • Анализ высказываний в стиле корпуса PolitiFact
  • Получение вспомогательной оценки для очереди заявлений на проверку человеком

Ограничения

Модель не проверяет факты и опирается на языковые закономерности коротких политических заявлений США из корпуса PolitiFact; качество для статей, других стран и тематик не измерено. Оценки могут быть чрезмерно уверенными и устаревать, поэтому результат нельзя использовать как автоматический вердикт или без проверки человеком.

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

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

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

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

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

Открыть на Hugging Face

Hugging Face | GitHub | LinkedIn | WhatsApp | Portfolio | Medium Blog

Author: Md. Emon Hasan

liar-roberta

A binary classifier that labels a short political statement as REAL or FAKE. Full fine-tune of roberta-base on LIAR, the PolitiFact fact-check corpus.

On the LIAR test split it reaches 64.5% accuracy and 0.6351 macro-F1, clearly ahead of a TF-IDF + logistic regression baseline trained on the same data (0.6025 macro-F1). Every number on this page comes from the single run that produced these weights; the raw values are in results.json.

from transformers import pipeline
clf = pipeline("text-classification", model="emonHasan01/liar-roberta")
clf("The moon landing was filmed in a Hollywood studio.")

Label scheme

LIAR ships six truthfulness classes, collapsed here into two:

Binary labelLIAR classes
REAL (0)true, mostly-true
FAKE (1)false, half-true, barely-true, pants-fire

Worth flagging: LIAR's integer label order is not sorted by truthfulness (4 = barely-true and 5 = pants-fire are the two least truthful, not the most). A fair amount of published code treats them as the truthful end and inverts the whole task. This model resolves the mapping from the dataset's label names, never indices.

The collapse leaves the data imbalanced — 460 REAL against 823 FAKE in the test split — so training used class-weighted cross-entropy and the checkpoint was chosen on macro-F1 rather than accuracy.

Results

Model versus baselines

AccuracyMacro F1F1 (FAKE)Precision (FAKE)Recall (FAKE)ROC AUC
Majority class0.64150.3908————
TF-IDF + LogReg0.62200.60250.69050.72720.65740.6496
RoBERTa (this model)0.64460.63510.69400.77510.62820.6959

The majority-class row is there on purpose. Accuracy alone on this dataset says very little, since always answering FAKE already scores 0.6415.

Confusion matrix

Where it succeeds and fails

Accuracy across the six original LIAR classes, before the binary collapse:

Per-class accuracy

LIAR classMapped tonAccuracyMean P(FAKE)
falseFAKE2500.6520.586
half-trueFAKE2670.5320.534
mostly-trueREAL2490.6630.456
trueREAL2110.6870.449
barely-trueFAKE2140.6680.594
pants-fireFAKE920.7500.639

The ends of the scale are separable; the middle is not. half-true and mostly-true differ by an editorial judgement that is largely unrecoverable from 18 words of text, and the model's scores reflect that.

Most confident mistakes

LIAR classTruePredictedConfidenceStatement
trueREALFAKE0.90"Obama has more czars than the Romanovs."
trueREALFAKE0.88The words subhuman mongrel, which Ted Nugent called President Barack Obama, were used by the Na
mostly-trueREALFAKE0.88Obama-Nelson economic record: Job creation ... at slowest post-recession rate since Great Depre

Of 456 errors, 150 are real statements flagged as fake and 306 are fake statements let through.

Choosing a threshold

P(FAKE) is exposed, so the 0.5 cutoff is a starting point rather than a verdict:

Precision/recall trade-off

ThresholdPrecision (FAKE)Recall (FAKE)F1Share flagged
0.200.6421.0000.78299.9%
0.300.6690.9390.78290.0%
0.400.7330.7850.75868.7%
0.500.7750.6280.69452.0%
0.600.7960.4850.60339.0%
0.700.8350.3010.44323.1%
0.800.8840.1390.23910.1%

At threshold 0.65 precision reaches 0.811, with recall falling to 0.385.

Is the confidence meaningful?

Reliability diagram

Expected calibration error is 0.042 over 10 bins. Points below the diagonal mean overconfidence: when the model says 0.9 it is right less often than 90% of the time. Treat the score as a ranking signal, not as a probability of being lied to.

Usage

import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification

tok = AutoTokenizer.from_pretrained("emonHasan01/liar-roberta")
model = AutoModelForSequenceClassification.from_pretrained("emonHasan01/liar-roberta")

inputs = tok("Your statement here", return_tensors="pt", truncation=True, max_length=128)
with torch.no_grad():
    probs = model(**inputs).logits.softmax(-1)[0]
print("P(REAL)", probs[0].item(), "P(FAKE)", probs[1].item())

Longer documents

The model saw statements of about 22 tokens and has a 128-token window. Feeding a whole article truncates it. Chunk and average instead:

def classify_long(text, tok, model, chunk_words=60):
    w = text.split()
    chunks = [" ".join(w[i:i+chunk_words]) for i in range(0, len(w), chunk_words)] or [text]
    enc = tok(chunks[:32], return_tensors="pt", truncation=True, padding=True, max_length=128)
    with torch.no_grad():
        p = model(**enc).logits.softmax(-1).mean(0)
    return {"REAL": p[0].item(), "FAKE": p[1].item()}

Results on full articles are out of distribution either way — see Limitations.

Training

Base modelroberta-base, 125M parameters, all trained
ObjectiveClass-weighted cross-entropy (weights 1.41, 0.78)
Max length128 tokens
Learning rate2e-5, AdamW, 10% warmup
Batch size16
Epochs3, best checkpoint by validation macro-F1
Weight decay0.01
Seed42
HardwareTesla T4
Training time~5 minutes

Statement length in the training set: median 22 tokens, 95th percentile 40, so a 128-token window truncates almost nothing.

Limitations

Please read this section before using the model for anything that matters.

  • It does not check facts. There is no retrieval and no knowledge base. The model learns lexical and stylistic patterns that correlate with a PolitiFact verdict. A false claim written in the register of a true one gets through, which the confident-mistakes table above shows directly.
  • The domain is narrow. Short US political statements, roughly 2007–2016, selected for fact-checking by PolitiFact. It has not learned to judge full news articles, scientific claims, health advice, or non-US or non-political content, and accuracy there is unmeasured and probably much worse.
  • The binary collapse discards information. Grouping half-true with pants-fire throws away most of the distinction the annotators recorded.
  • It inherits PolitiFact's selection. Which speakers and claims get fact-checked at all is an editorial decision, absorbed here along with the labels.
  • It is overconfident (ECE 0.042). Do not read the softmax score as a probability.
  • Temporal drift. Names, events, and political vocabulary have moved on since the corpus was collected.
  • The ceiling is low, and that is expected. LIAR is a hard benchmark and published binary results sit broadly in this range. A very high accuracy on LIAR usually means a label-mapping bug or a leak rather than a better model.

Do not use this as an automated arbiter of truth, for moderation at scale, or in any decision affecting a person without a human reading the output.

Citation

@inproceedings{wang2017liar,
  title     = {"Liar, Liar Pants on Fire": A New Benchmark Dataset for Fake News Detection},
  author    = {Wang, William Yang},
  booktitle = {Proceedings of ACL},
  year      = {2017}
}

Reproducing

Everything on this page — training, both baselines, all five charts and this card — comes from one Colab notebook run on a Tesla T4. No metric was typed in by hand.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей