/ Модель

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

Контекст
512 токенов
Параметры
152 млн
Лицензия
CC BY 4.0
Архитектура
deberta · dense
Опубликована
13 апр 2022

Hatemoji

Классификация текстаТекст → label3 профессии
253скачиваний за 30 дней4лайкавеса обновлены27 апр 2022

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

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

Hatemoji — дообученная на состязательных данных модель DeBERTa для выявления ненавистнических высказываний на английском языке, в том числе с эмодзи.

Hannah Rose Kirk и соавторы разработали Hatemoji — модель DeBERTa base, дообученную для бинарной классификации коротких англоязычных текстов с эмодзи: она определяет, содержит ли высказывание ненависть. Модель использует архитектуру DeBERTa для классификации последовательностей, насчитывает около 151,8 млн параметров и принимает контекст длиной до 512 токенов. Итоговая версия R8-T обучалась в несколько раундов на состязательных примерах, создававшихся при участии людей и модели; также использовались текстовые примеры ненавистнических высказываний.

Модель подходит для выявления ненавистнических высказываний с эмодзи и текстовых высказываний на английском языке. Авторы сообщают о хороших результатах на задачах классификации ненависти с эмодзи, однако модель может хуже справляться с примерами из реальных условий, поскольку обучалась на синтетических состязательных данных. Она выдаёт метку «ненавистническое» или «не ненавистническое». Распространяется по лицензии CC BY 4.0.

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

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

Ограничения

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

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

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

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

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

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

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

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

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

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

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

Открыть на Hugging Face

Hatemoji Model

Model description

This model is a fine-tuned version of the DeBERTa base model. This model is cased. The model was trained on iterative rounds of adversarial data generation with human-and-model-in-the-loop. In each round, annotators are tasked with tricking the model-in-the-loop with emoji-containing statements that it will misclassify. Between each round, the model is retrained. This is the final model from the iterative process, referred to as R8-T in our paper. The intended task is to classify an emoji-containing statement as either non-hateful (LABEL 0.0) or hateful (LABEL 1.0).

Intended uses & limitations

The intended use of the model is to classify English-language, emoji-containing, short-form text documents as a binary task: non-hateful vs hateful. The model has demonstrated strengths compared to commercial and academic models on classifying emoji-based hate, but is also a strong classifier of text-only hate. Because the model was trained on synthetic, adversarially-generated data, it may have some weaknesses when it comes to empirical emoji-based hate 'in-the-wild'.

You can interact with this model on Dynabench, and find its limitations. We hope to continue improving the model on new adversarial data to better iron out its remaining weaknesses!

How to use

The model can be used with pipeline:

from transformers import pipeline
classifier = pipeline("text-classification",model='HannahRoseKirk/Hatemoji', return_all_scores=True)
prediction = classifier("I 💜💙💚 emoji 😍", )
print(prediction)
"""
Output
[[{'label': 'LABEL_0', 'score': 0.9999157190322876}, {'label': 'LABEL_1', 'score': 8.425049600191414e-05}]]
"""

Training data

The model was trained on:

  • The three rounds of emoji-containing, adversarially-generated texts from HatemojiBuild
  • The four rounds of text-only, adversarially-generated texts from Vidgen et al., (2021). Learning from the worst: Dynamically generated datasets to improve online hate detection. Available on Github and explained in their paper.
  • A collection of widely available and publicly accessible datasets from https://hatespeechdata.com/

Train procedure

The model was trained using HuggingFace's run glue script, using the following parameters:

python3 transformers/examples/pytorch/text-classification/run_glue.py \
--model_name_or_path microsoft/deberta-base \
--validation_file path_to_data/dev.csv \
--train_file path_to_data/train.csv \
--do_train --do_eval --max_seq_length 512 --learning_rate 2e-5 \
--num_train_epochs 3 --evaluation_strategy epoch \
--load_best_model_at_end --output_dir path_to_outdir/deberta123/ \
--seed 123 \
--cache_dir /.cache/huggingface/transformers/ \
--overwrite_output_dir > ./log_deb 2> ./err_deb

We experimented with upsampling the train split of each round to improve performance with increments of [1, 5, 10, 100], with the optimum upsampling taken forward to all subsequent rounds. The optimal upsampling ratios for R1-R4 (text rounds from Vidgen et al.,) are carried forward. This model is trained on upsampling ratios of {'R0':1, 'R1':5, 'R2':100, 'R3':1, 'R4':1 , 'R5':100, 'R6':1, 'R7':5}.

Variable and metrics

We wished to train a model which could effectively encode information about emoji-based hate, without worsening performance on text-only hate. Thus, we evaluate the model on:

  • HatemojiCheck, an evaluation checklist with 7 functionalities of emoji-based hate and contrast sets
  • HateCheck, an evaluation checklist contains 29 functional tests for hate speech and contrast sets.
  • The held-out tests sets from HatemojiBuild the three round of adversarially-generated data collection with emoji-containing examples (R5-7). Available on Huuggingface
  • The held-out test sets from the four rounds of adversarially-generated data collection with text-only examples (R1-4, from Vidgen et al.)

For the round-specific test sets, we used a weighted F1-score across them to choose the final model in each round. For more details, see our paper

Evaluation results

We compare our model to:

  • P-IA: the identity attack attribute from Perspective API
  • P-TX: the toxicity attribute from Perspective API
  • B-D: A BERT model trained on the Davidson et al. (2017) dataset
  • B-F: A BERT model trained on the Founta et al. (2018) dataset
Emoji Test SetsText Test SetsAll Rounds
R5-R7HmojiCheckR1-R4HateCheckR1-R7
AccF1AccF1AccF1AccF1AccF1
P-IA0.5080.3940.6890.7540.6790.7200.7650.8390.6580.689
P-TX0.5230.4480.6500.7110.6020.6590.7200.8130.5920.639
B-D0.4890.2700.5780.6360.5890.6070.6320.7380.5910.586
B-F0.4960.3220.5520.6050.5620.5620.6020.6940.5570.532
Hatemoji0.7440.7550.8710.9040.8270.8440.9660.9750.8140.829

For full discussion of the model results, see our paper.

A recent paper by Lees et al., (2022) A New Generation of Perspective API:Efficient Multilingual Character-level Transformers beats this model on the HatemojiCheck benchmark.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей