/ Модель

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

Контекст
512 токенов
Лицензия
Apache 2.0
Архитектура
distilbert · dense
Базовая модель
distilbert-base-uncased
Опубликована
19 авг 2023

distilbert-base-uncased-finetuned-emotion

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

Компактная модель DistilBERT классифицирует английские тексты по шести базовым эмоциям.

499скачиваний за 30 дней3лайкавеса обновлены12 сен 2023

Бенчмарки

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

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

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

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

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

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

Модель esuriddick/distilbert-base-uncased-finetuned-emotion разработана автором репозитория и дообучена на базе distilbert/distilbert-base-uncased для распознавания эмоций в английском тексте. Это компактная двунаправленная архитектура DistilBERT для классификации последовательностей; она принимает текст длиной до 512 токенов и относит его к одной из шести категорий: гнев, страх, радость, любовь, грусть или удивление.

Модель подходит для анализа коротких сообщений и текстов, в том числе похожих на публикации в Twitter. В README указаны результаты на оценочной выборке: точность 0,9375 и F1 0,9379. Файлы доступны в форматах PyTorch и Safetensors. Лицензия — Apache-2.0.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

distilbert-base-uncased-finetuned-emotion

This model is a fine-tuned version of distilbert-base-uncased on the emotion dataset. It achieves the following results on the evaluation set:

  • Loss: 0.1448
  • Accuracy: 0.9375
  • F1: 0.9379

The notebook used to fine-tune this model may be found HERE.

Model description

DistilBERT is a transformers model, smaller and faster than BERT, which was pretrained on the same corpus in a self-supervised fashion, using the BERT base model as a teacher. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts using the BERT base model. More precisely, it was pretrained with three objectives:

  • Distillation loss: the model was trained to return the same probabilities as the BERT base model.
  • Masked language modeling (MLM): this is part of the original training loss of the BERT base model. When taking a sentence, the model randomly masks 15% of the words in the input then run the entire masked sentence through the model and has to predict the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like GPT which internally mask the future tokens. It allows the model to learn a bidirectional representation of the sentence.
  • Cosine embedding loss: the model was also trained to generate hidden states as close as possible as the BERT base model.

This way, the model learns the same inner representation of the English language than its teacher model, while being faster for inference or downstream tasks.

Intended uses & limitations

Emotion is a dataset of English Twitter messages with six basic emotions: anger, fear, joy, love, sadness, and surprise. This dataset was developed for the paper entitled "CARER: Contextualized Affect Representations for Emotion Recognition" (Saravia et al.) through noisy labels, annotated via distant supervision as in the paper"Twitter sentiment classification using distant supervision" (Go et al).

The DistilBERT model was fine-tuned to this dataset, allowing for the classification of sentences into one of the six basic emotions (anger, fear, joy, love, sadness, and surprise).

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 5e-05
  • train_batch_size: 64
  • eval_batch_size: 64
  • seed: 42
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • num_epochs: 2

Training results

Training LossEpochStepValidation LossAccuracyF1
0.53371.02500.19920.9270.9262
0.14052.05000.14480.93750.9379

Framework versions

  • Transformers 4.30.2
  • Pytorch 2.0.0
  • Datasets 2.1.0
  • Tokenizers 0.13.3

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
DistilBertForSequenceClassification
Ревизия весов
7c0c353

0 моделей