/ Модель

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

Контекст
512 токенов
Параметры
137 млн
Лицензия
MIT
Архитектура
bert · dense
Опубликована
1 апр 2024

bert-43-multilabel-emotion-detection

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

Дообученная BERT-модель для классификации английских текстов по 43 категориям эмоций.

25скачиваний за 30 дней11лайковвеса обновлены15 апр 2024

Бенчмарки

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

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

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

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

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

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

Модель borisn70/bert-43-multilabel-emotion-detection разработана на основе bert-base-uncased и дообучена для классификации английских предложений по 43 категориям эмоций. Это плотная BERT-модель с головой BertForSequenceClassification; размер — 136,7 млн параметров, максимальный контекст — 512 токенов. Веса представлены в формате safetensors, лицензия — MIT.

Модель предназначена для анализа эмоционального содержания текста: разметки отзывов и сообщений, мониторинга соцсетей и анализа обратной связи клиентов. В README указаны метрики на валидационной выборке: accuracy 92,02% и weighted F1 91,93%. Модель поддерживает английский язык; качество может различаться между категориями эмоций, а смещения обучающих данных могут отражаться на предсказаниях.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Model Description

This model, "bert-43-multilabel-emotion-detection", is a fine-tuned version of "bert-base-uncased", trained to classify sentences based on their emotional content into one of 43 categories in the English language. The model was trained on a combination of datasets including tweet_emotions, GoEmotions, and synthetic data, amounting to approximately 271,000 records with around 6,306 records per label.

Intended Use

This model is intended for any application that requires understanding or categorizing the emotional content of English text. This could include sentiment analysis, social media monitoring, customer feedback analysis, and more.

Training Data

The training data comprises the following datasets:

  • Tweet Emotions
  • GoEmotions
  • Synthetic data

Training Procedure

The model was trained over 20 epochs, taking about 6 hours on a Google Colab V100 GPU with 16 GB RAM.

The following settings have been used:

from transformers import TrainingArguments

training_args = TrainingArguments(
    output_dir='results',        
    optim="adamw_torch",
    learning_rate=2e-5,               # learning rate
    num_train_epochs=20,              # total number of training epochs
    per_device_train_batch_size=128,  # batch size per device during training
    per_device_eval_batch_size=128,   # batch size for evaluation
    warmup_steps=500,                 # number of warmup steps for learning rate scheduler
    weight_decay=0.01,                # strength of weight decay
    logging_dir='./logs',             # directory for storing logs
    logging_steps=100,
)

Performance

The model achieved the following performance metrics on the validation set:

  • Accuracy: 92.02%
  • Weighted F1-Score: 91.93%
  • Weighted Precision: 91.88%
  • Weighted Recall: 92.02%

Performance details for each of the 43 labels.

Labels Mapping

Label IDEmotion
0admiration
1amusement
2anger
3annoyance
4approval
5caring
6confusion
7curiosity
8desire
9disappointment
10disapproval
11disgust
12embarrassment
13excitement
14fear
15gratitude
16grief
17joy
18love
19nervousness
20optimism
21pride
22realization
23relief
24remorse
25sadness
26surprise
27neutral
28worry
29happiness
30fun
31hate
32autonomy
33safety
34understanding
35empty
36enthusiasm
37recreation
38sense of belonging
39meaning
40sustenance
41creativity
42boredom

Accuracy Report

LabelPrecisionRecallF1-Score
00.86250.79690.8284
10.91280.95580.9338
20.90280.87490.8886
30.85700.86390.8605
40.85840.84490.8516
50.93430.96670.9502
60.94920.96960.9593
70.92340.94620.9347
80.96440.99240.9782
90.94810.93770.9428
100.92500.92670.9259
110.96530.99140.9782
120.99480.99760.9962
130.94740.96760.9574
140.89260.88530.8889
150.95010.95150.9508
160.99760.99900.9983
170.91140.87160.8911
180.78250.78210.7823
190.99620.99900.9976
200.95160.96380.9577
210.99530.99950.9974
220.96300.97910.9710
230.91340.91340.9134
240.97530.99480.9849
250.73740.74690.7421
260.78640.75830.7721
270.60000.56660.5828
280.73690.68360.7093
290.80660.72220.7620
300.91160.92250.9170
310.91080.95240.9312
320.96110.96340.9622
330.95920.97240.9657
340.97000.96860.9693
350.94590.97340.9594
360.93590.98570.9601
370.99860.99860.9986
380.99430.99900.9967
390.99901.00000.9995
400.99050.99140.9910
410.99810.99480.9964
420.99290.99860.9957
weighted avg0.91880.92020.9193

How to Use

from transformers import pipeline

# Load the pre-trained model and tokenizer
model = 'borisn70/bert-43-multilabel-emotion-detection'
tokenizer = 'borisn70/bert-43-multilabel-emotion-detection'

# Create a pipeline for sentiment analysis
nlp = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)

# Test the model with a sentence
result = nlp("I feel great about this!")

# Print the result
print(result)

Limitations and Biases

  • The model's performance can vary significantly across different emotional categories, especially those with less representation in the training data.
  • Users should be cautious about potential biases in the training data, which may be reflected in the model's predictions.

Contact

If you have any questions, feedback, or would like to report any issues regarding the model, please feel free to reach out.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей