/ Модель

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

Контекст
514 токенов
Параметры
454 млн
Архитектура
roberta · dense
Базовая модель
roberta-large-emopillars-contextual
Библиотека
transformers
Опубликована
3 апр 2025

roberta-large-emopillars-contextual-emocontext

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

Контекстная модель RoBERTa для классификации эмоций в репликах диалога по 28 эмоциональным классам.

218скачиваний за 30 дней0лайковвеса обновлены24 апр 2025

Бенчмарки

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

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

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

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

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

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

Модель alex-shvets/roberta-large-emopillars-contextual-emocontext — дообученная версия roberta-large-emopillars-contextual, созданная для распознавания эмоций в контексте диалога. Это классификатор последовательностей на архитектуре RoBERTa с 454,1 млн параметров и контекстом до 514 токенов; модель принимает текст и относит эмоции к 28 классам, обучаясь на четырёх метках EmoContext: angry, sad, happy и others.

Модель может получать контекст вместе с описанием персонажа и репликой, чтобы определить эмоцию именно в реплике, либо три реплики диалога, чтобы классифицировать последнюю. В обучающей выборке из 30 157 примеров метки others были дополнительно переопределены с помощью базовой контекстной модели. В README приведены оценки precision, recall и F1 для angry, sad и happy на dev-разбиении EmoContext.

Модель подходит для анализа эмоциональной окраски реплик в диалогах и чатах. Данные не подтверждают поддержку языков, отличных от английского. Лицензия в предоставленных сведениях не указана; автор предупреждает о возможных смещениях и нежелательных искажениях и возлагает на пользователей ответственность за снижение рисков при развёртывании.

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

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

Ограничения

Обучение ориентировано на метки angry, sad, happy и others в наборе EmoContext, хотя классификатор описан как работающий с 28 эмоциональными классами. Автор предупреждает о возможных смещениях и нежелательных искажениях; лицензия не указана в предоставленных данных.

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

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

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

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

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

Открыть на Hugging Face

roberta-large-emopillars-contextual-emocontext

This model is a fine-tuned version of roberta-large-emopillars-contextual on the EmoContext dataset. The base model was trained on EmoPillars' context-full subset.

Model description

The model is a multi-label classifier over 28 emotional classes for a context-aware scenario, fine-tuned on a dataset of 4 classes (angry, sad, happy, and others) that we initially relabelled (see Training data for details). The resulting model takes as input either a context concatenated with a character description and an utterance, and extracts emotions only from the utterance, or a three-turn dialogue and identifies emotions in the last utterance.

How to use

Here is how to use this model:

>>> import torch
>>> from transformers import pipeline
>>> model_name = "roberta-large-emopillars-contextual-emocontext"
>>> threshold = 0.10
>>> emotions = [
>>>     "admiration", "amusement", "anger", "annoyance", "approval", "caring", "confusion",
>>>     "curiosity", "desire", "disappointment", "disapproval", "disgust", "embarrassment",
>>>     "excitement", "fear", "gratitude", "grief", "joy", "love", "nervousness", "optimism",
>>>     "pride", "realization", "relief", "remorse", "sadness", "surprise", "neutral"
>>> ]
>>> label_to_emotion = dict(zip(list(range(len(emotions))), emotions))
>>> emotion_to_emocontext = dict(zip(emotions, ["others"]*len(emotions)))
>>> emotion_to_emocontext.update({
>>>     "anger": "angry",
>>>     "sadness": "sad",
>>>     "joy": "happy"
>>> })
>>> device = torch.device("cuda" if torch.cuda.is_available() else "CPU")
>>> pipe = pipeline("text-classification", model=model_name, truncation=True,
>>>                  return_all_scores=True, device=-1 if device.type=="cpu" else 0)
>>> # input in a format f"{context} {character}: \"{utterance}\""
>>> # alternative input format: f"{persona1}: {utterance1}, {persona2}:\"{utterance2}\"\n{persona1}: \"{utterance3}\""
>>> utterances_in_contexts = [
>>>     "A user watched a video of a musical performance on YouTube. This user expresses an opinion and thoughts. User: \"Ok is it just me or is anyone else getting goosebumps too???\"",
>>>     "User: \"But...\", Conversational Agent: \"then\"\nUser: \"I’m feeling nervous\""
>>> ]
>>> outcome = pipe(utterances_in_contexts)
>>> dominant_classes = [
>>>     [prediction for prediction in example if prediction['score'] >= threshold]
>>>     for example in outcome
>>> ]
>>> for example in dominant_classes:
>>>     print(", ".join([
>>>         "%s (%s): %.2lf" % (
>>>             label_to_emotion[int(prediction['label'])], 
>>>             emotion_to_emocontext[label_to_emotion[int(prediction['label'])]], 
>>>             prediction['score']
>>>         ) 
>>>         for prediction in sorted(example, key=lambda x: x['score'], reverse=True)
>>>     ]))
excitement (others): 0.73, joy (happy): 0.23
sadness (sad): 0.89, nervousness (others): 0.12

Training data

The training data consists of 30,157 samples of the EmoContext dataset. We relabelled the others examples in the training set by choosing the most probable label predicted by our base 28-class contextual model (see our paper for details).

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 2e-05
  • train_batch_size: 16
  • eval_batch_size: 8
  • seed: 752
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • num_epochs: 3.0

Framework versions

  • Transformers 4.45.0.dev0
  • Pytorch 2.4.0a0+gite3b9b71
  • Datasets 2.21.0
  • Tokenizers 0.19.1

Evaluation

Scores for the evaluation on the EmoContext dev split:

classprecisionrecallf1-scoresupport
angry0.760.800.78150
sad0.810.800.81125
happy0.720.750.73142
others0.960.960.962335
micro avg0.930.930.932752
macro avg0.810.830.822752
weighted avg0.930.930.932752
samples avg0.930.930.932752

For more details on the evaluation, please visit our GitHub repository or paper.

Citation information

If you use this model, please cite our paper:

@misc{shvets2025emopillarsknowledgedistillation,
      title={Emo Pillars: Knowledge Distillation to Support Fine-Grained Context-Aware and Context-Less Emotion Classification}, 
      author={Alexander Shvets},
      year={2025},
      eprint={2504.16856},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2504.16856}
}

Disclaimer

The model published in this repository is intended for a generalist purpose and is available to third parties. This model may have bias and/or any other undesirable distortions.

When third parties deploy or provide systems and/or services to other parties using this model (or using systems based on this model) or become users of the model, they should note that it is their responsibility to mitigate the risks arising from its use and, in any event, to comply with applicable regulations, including regulations regarding the use of Artificial Intelligence.

In no event shall the creator of the model be liable for any results arising from the use made by third parties of this model.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей