/ Модель

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

Контекст
512 токенов
Параметры
137 млн
Лицензия
Apache 2.0
Архитектура
bert · dense
Базовая модель
toxic-bert
Библиотека
kjarni
Опубликована
19 янв 2026

toxic-bert

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

Англоязычная BERT-модель оценивает комментарии по шести категориям токсичности для предварительной модерации.

619скачиваний за 30 дней0лайковвеса обновлены28 ноя 2026

Бенчмарки

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

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

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

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

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

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

Это англоязычная модель BERT для многометочной классификации токсичных комментариев, опубликованная Kjarni как локальный пакет модели Unitary. Она присваивает независимые оценки от 0 до 1 по шести меткам: токсичность, сильная токсичность, непристойность, угроза, оскорбление и ненависть к идентичности. Модель содержит 136,7 млн параметров, принимает текст с контекстом до 512 токенов и выдаёт оценки классов. Репозиторий содержит веса safetensors; заявленная библиотека запуска Kjarni позволяет выполнять классификацию локально.

Это не новое обучение: веса побитно совпадают с unitary/toxic-bert, а изменения относятся к упаковке файлов для запуска и совместимости с Transformers. Модель подходит для предварительного выявления токсичных комментариев и передачи потенциально проблемных сообщений на проверку модератору. Она обучалась на англоязычных комментариях Википедии из Jigsaw Toxic Comment Classification Challenge 2018; лицензия — Apache-2.0.

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

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

Ограничения

Нецензурная лексика может получать высокую оценку токсичности независимо от тона или намерения, включая юмор и самоиронию; возможна предвзятость к уязвимым группам. Оценки следует использовать как сигнал для проверки человеком, а не как окончательное решение.

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

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

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

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

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

Открыть на Hugging Face

toxic-bert for Kjarni

Flags toxic comments in English, packaged to run locally with Kjarni: one native library, with no Python runtime, server or cloud service. Each comment gets a score from 0 to 1 for six labels, each scored on its own: toxic, severe_toxic, obscene, threat, insult and identity_hate. The model is about 440 MB and downloads on first use.

Usage

Tested with Kjarni 0.8.2. Each example prints the labels scoring above 0.5.

Command line

curl -fsSL https://kjarni.ai/install.sh | sh    # Windows: irm https://kjarni.ai/install.ps1 | iex
kjarni classify -m toxic-bert "You are an idiot and nobody wants you here."
Model: toxic-bert  Device: Cpu

  Input "You are an idiot and nobody wants you here."

  ✓          toxic  ████████████████████   98.8%
            insult  ███████████████████░   94.8%
           obscene  ██████████████░░░░░░   68.8%
      severe_toxic  █░░░░░░░░░░░░░░░░░░░    3.2%
     identity_hate  ░░░░░░░░░░░░░░░░░░░░    1.2%

Python

# pip install kjarni
from kjarni import Classifier

classifier = Classifier(model="toxic-bert", quiet=True)
for text in ["Thanks, that fixed it!", "You are an idiot and nobody wants you here."]:
    result = classifier.classify(text)
    flagged = [label for label, score in result.all_scores if score > 0.5]
    print(flagged, text)
[] Thanks, that fixed it!
['toxic', 'insult', 'obscene'] You are an idiot and nobody wants you here.

Rust

// cargo add kjarni anyhow tokio --features tokio/full
use kjarni::Classifier;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let classifier = Classifier::new("toxic-bert").await?;
    for text in [
        "Thanks, that fixed it!",
        "You are an idiot and nobody wants you here.",
    ] {
        let result = classifier.classify(text).await?;
        let flagged: Vec<_> = result
            .all_scores
            .iter()
            .filter(|(_, s)| *s > 0.5)
            .map(|(l, _)| l)
            .collect();
        println!("{flagged:?} {text}");
    }
    Ok(())
}

C#

// dotnet add package Kjarni
using Kjarni;

using var classifier = new Classifier("toxic-bert", quiet: true);
foreach (var text in new[] { "Thanks, that fixed it!", "You are an idiot and nobody wants you here." })
{
    var result = classifier.Classify(text);
    var flagged = result.AllScores.Where(s => s.Score > 0.5f).Select(s => s.Label);
    Console.WriteLine($"[{string.Join(", ", flagged)}] {text}");
}

C++ (C++23)

#include <kjarni.hpp>
#include <iostream>

int main() {
    kjarni::ClassifierOptions options;
    options.model = "toxic-bert";

    auto classifier = kjarni::Classifier::create(options);
    if (!classifier) return 1;

    for (const char* text : {"Thanks, that fixed it!", "You are an idiot and nobody wants you here."}) {
        auto labels = classifier->classify(text);
        if (!labels) return 1;
        std::cout << "[";
        for (const auto& [label, score] : *labels)
            if (score > 0.5f) std::cout << " " << label;
        std::cout << " ] " << text << "\n";
    }
}

Go

// go get github.com/kjarni-ai/kjarni-go
package main

import (
	"fmt"
	"log"

	kjarni "github.com/kjarni-ai/kjarni-go"
)

func main() {
	classifier, err := kjarni.NewClassifier("toxic-bert", kjarni.WithQuiet(true))
	if err != nil {
		log.Fatal(err)
	}
	defer classifier.Close()

	for _, text := range []string{"Thanks, that fixed it!", "You are an idiot and nobody wants you here."} {
		result, err := classifier.Classify(text)
		if err != nil {
			log.Fatal(err)
		}
		flagged := []string{}
		for _, s := range result.AllScores {
			if s.Score > 0.5 {
				flagged = append(flagged, s.Label)
			}
		}
		fmt.Println(flagged, text)
	}
}

See the Kjarni documentation for other languages and installation details.

What changed from the original

This is not a new model. The weights are unchanged: every tensor is bit-for-bit the same as in the original. Only the packaging differs:

  • The unused position_ids buffer is left out of model.safetensors.
  • A tokenizer.json is added, made from the original's vocab.txt.
  • The configuration and tokenizer files are re-saved by a newer version of transformers.

The files also load in transformers. On four test sentences, Kjarni's scores match transformers running the original model to six decimal places.

Limitations

From the original model card: comments containing swearing, insults or profanity are likely to be flagged as toxic whatever the tone or intent, including humorous or self-deprecating ones. This can bias the model against groups that are already vulnerable. The model was trained on English Wikipedia comments from the 2018 Jigsaw Toxic Comment Classification Challenge, and its scores are best treated as a signal for human review, not a final decision.

Attribution

The model is unitary/toxic-bert, the original model from Detoxify by Laura Hanu and the Unitary team. All credit for the model, its training and its evaluation belongs to them. See the original model card for benchmarks and more on its limitations.

Kjarni and this packaging are not affiliated with or endorsed by Unitary.

This repository is released under the Apache License 2.0, the same license as the original model.

Citation

@misc{Detoxify,
  title={Detoxify},
  author={Hanu, Laura and {Unitary team}},
  howpublished={Github. https://github.com/unitaryai/detoxify},
  year={2020}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей