/ Модель

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

Контекст
514 токенов
Параметры
137 млн
Архитектура
mpnet · dense
Базовая модель
paraphrase-mpnet-base-v2
Библиотека
setfit
Опубликована
30 июн 2024

my-setfit-classifier_toxic

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

Few-shot модель SetFit на MPNet классифицирует текстовые сообщения на токсичные и нетоксичные.

2 758скачиваний за 30 дней0лайковвеса обновлены30 июн 2024

Бенчмарки

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

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

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

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

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

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

waterabbit114/my-setfit-classifier_toxic — модель классификации текста на основе SetFit, дообученная автором на sentence-transformers/paraphrase-mpnet-base-v2. Она использует MPNet для получения представлений текста и классификатор LogisticRegression; обучение выполнено методом few-shot с контрастивным дообучением Sentence Transformer и последующим обучением классификационной головы. Модель различает два класса: примеры токсичных сообщений и примеры, отнесённые к другому классу.

Модель предназначена для классификации коротких текстов, например комментариев и сообщений, по признаку токсичности. В README указана максимальная длина последовательности 512 токенов; метаданные сообщают о 136,7 млн параметров. Для запуска требуется библиотека SetFit. Лицензия в предоставленных данных не указана.

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

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

Ограничения

Модель различает только два класса, а максимальная длина входной последовательности составляет 512 токенов. В предоставленных данных нет результатов оценки качества или сведений о поведении на других языках и типах текстов.

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

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

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

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

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

Открыть на Hugging Face

SetFit with sentence-transformers/paraphrase-mpnet-base-v2

This is a SetFit model that can be used for Text Classification. This SetFit model uses sentence-transformers/paraphrase-mpnet-base-v2 as the Sentence Transformer embedding model. A LogisticRegression instance is used for classification.

The model has been trained using an efficient few-shot learning technique that involves:

  1. Fine-tuning a Sentence Transformer with contrastive learning.
  2. Training a classification head with features from the fine-tuned Sentence Transformer.

Model Details

Model Description

Model Sources

Model Labels

LabelExamples
0', metal unless it was 70s oldskool'"do whichever you think would be best then: if you rename the account, just let me know, and i'll go over there to recreate it; but if you'd prefer to rename the account, recreate it, and send me the password which i can then change, that's fine with me."'" no, it was a far-too-much-of-an-in-joke on the fact that principle→principal is usually one of the first things the fa regulars jump on (along with the dreaded spaced em dash)\xa0–\xa0scent "'
1"hey , you are a chicken shit coward i told you that everytime you had one of your administrator buddies block me, i would quickly be back on with a new ip address editing your vandalism of this article. i meant it!!! why don't you stop masturbating to wikipedia and get a real life? i told you that you don't know who you're fuck with!!!"'and you are a motherfucking asshole,suck your dick,you dirty son of a dicks''" you are actually trying to goad me into an arguement. how cute. when you just said on your cute ani post that we are wearing you out with our arguements. as for that diff of your prefer versions, it would be the one before i reverted you...this one. you didn't like the comprimise, so you revert it to what you feel is best, not to what was there before. try reading up on wp:own, cause you are trying to own this article and that ain't gonna happen. oh, and for someone ""standing by"" their statement that it is good for people to believe ase had a friend that was a murder victim. you sir are a callous asshole (and i stand by that term) and nothing you do will make me believe otherwise. if you can't see what you wrote was unthinkably wrong, rude and cold...you don't deserve to be on wikipedia, not alone the internet....or this planet. - • talk • "'

Evaluation

Metrics

LabelAccuracy
all0.9221

Uses

Direct Use for Inference

First install the SetFit library:

pip install setfit

Then you can load this model and run inference.

from setfit import SetFitModel

# Download from the 🤗 Hub
model = SetFitModel.from_pretrained("waterabbit114/my-setfit-classifier_toxic")
# Run inference
preds = model("\"   link   thanks for fixing that disambiguation link on usher's album ) flash; \"")

Training Details

Training Set Metrics

Training setMinMedianMax
Word count398.8898
LabelTraining Sample Count
010
110

Training Hyperparameters

  • batch_size: (1, 1)
  • num_epochs: (10, 10)
  • max_steps: -1
  • sampling_strategy: oversampling
  • num_iterations: 20
  • body_learning_rate: (2e-05, 2e-05)
  • head_learning_rate: 2e-05
  • loss: CosineSimilarityLoss
  • distance_metric: cosine_distance
  • margin: 0.25
  • end_to_end: False
  • use_amp: False
  • warmup_proportion: 0.1
  • seed: 42
  • eval_max_steps: -1
  • load_best_model_at_end: False

Training Results

EpochStepTraining LossValidation Loss
0.001310.0656-
0.0625500.0046-
0.1251000.0018-
0.18751500.0003-
0.252000.0062-
0.31252500.0011-
0.3753000.0009-
0.43753500.0-
0.54000.0008-
0.56254500.0001-
0.6255000.0002-
0.68755500.0-
0.756000.0-
0.81256500.0002-
0.8757000.0001-
0.93757500.0001-
1.08000.0002-
1.06258500.0002-
1.1259000.0001-
1.18759500.0001-
1.2510000.0003-
1.312510500.0001-
1.37511000.0001-
1.437511500.0002-
1.512000.0001-
1.562512500.0005-
1.62513000.0001-
1.687513500.0-
1.7514000.0001-
1.812514500.0001-
1.87515000.0001-
1.937515500.0001-
2.016000.0-
2.062516500.0-
2.12517000.0003-
2.187517500.0-
2.2518000.0004-
2.312518500.0004-
2.37519000.0-
2.437519500.0-
2.520000.0-
2.562520500.0-
2.62521000.0003-
2.687521500.0-
2.7522000.0001-
2.812522500.0-
2.87523000.0-
2.937523500.0001-
3.024000.0-
3.062524500.0-
3.12525000.0002-
3.187525500.0-
3.2526000.0001-
3.312526500.0-
3.37527000.0-
3.437527500.0001-
3.528000.0-
3.562528500.0-
3.62529000.0001-
3.687529500.0-
3.7530000.0-
3.812530500.0-
3.87531000.0-
3.937531500.0-
4.032000.0-
4.062532500.0001-
4.12533000.0-
4.187533500.0-
4.2534000.0-
4.312534500.0-
4.37535000.0-
4.437535500.0-
4.536000.0-
4.562536500.0-
4.62537000.0002-
4.687537500.0-
4.7538000.0-
4.812538500.0-
4.87539000.0-
4.937539500.0-
5.040000.0001-
5.062540500.0-
5.12541000.0-
5.187541500.0-
5.2542000.0-
5.312542500.0-
5.37543000.0-
5.437543500.0-
5.544000.0-
5.562544500.0-
5.62545000.0-
5.687545500.0-
5.7546000.0-
5.812546500.0-
5.87547000.0-
5.937547500.0-
6.048000.0001-
6.062548500.0-
6.12549000.0003-
6.187549500.0002-
6.2550000.0-
6.312550500.0-
6.37551000.0-
6.437551500.0001-
6.552000.0-
6.562552500.0-
6.62553000.0-
6.687553500.0001-
6.7554000.0001-
6.812554500.0-
6.87555000.0-
6.937555500.0-
7.056000.0-
7.062556500.0-
7.12557000.0-
7.187557500.0-
7.2558000.0-
7.312558500.0-
7.37559000.0-
7.437559500.0-
7.560000.0-
7.562560500.0-
7.62561000.0-
7.687561500.0-
7.7562000.0001-
7.812562500.0-
7.87563000.0-
7.937563500.0001-
8.064000.0-
8.062564500.0-
8.12565000.0-
8.187565500.0-
8.2566000.0-
8.312566500.0-
8.37567000.0-
8.437567500.0-
8.568000.0-
8.562568500.0-
8.62569000.0001-
8.687569500.0-
8.7570000.0-
8.812570500.0-
8.87571000.0-
8.937571500.0-
9.072000.0-
9.062572500.0-
9.12573000.0-
9.187573500.0-
9.2574000.0-
9.312574500.0-
9.37575000.0-
9.437575500.0-
9.576000.0-
9.562576500.0-
9.62577000.0-
9.687577500.0-
9.7578000.0-
9.812578500.0-
9.87579000.0-
9.937579500.0-
10.080000.0-

Framework Versions

  • Python: 3.11.7
  • SetFit: 1.0.3
  • Sentence Transformers: 2.2.2
  • Transformers: 4.35.2
  • PyTorch: 2.1.1+cu121
  • Datasets: 2.14.5
  • Tokenizers: 0.15.1

Citation

BibTeX

@article{https://doi.org/10.48550/arxiv.2209.11055,
    doi = {10.48550/ARXIV.2209.11055},
    url = {https://arxiv.org/abs/2209.11055},
    author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
    keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
    title = {Efficient Few-Shot Learning Without Prompts},
    publisher = {arXiv},
    year = {2022},
    copyright = {Creative Commons Attribution 4.0 International}
}

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

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

GPU в ailist

Универсальный рантайм · setfit

Нельзя запустить

Модели SetFit требуют отдельного рантайма.

Класс архитектуры
MPNetModel
Ревизия весов
927b1d9

0 моделей