Text Classification
Transformers
ONNX
Safetensors
Transformers.js
modernbert
abacusai
toxicity
content-moderation
trust-and-safety
perspective-api
hate-speech
multi-label-classification
text-embeddings-inference
Instructions to use abacusai/Toxicity-Lens with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use abacusai/Toxicity-Lens with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="abacusai/Toxicity-Lens")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("abacusai/Toxicity-Lens") model = AutoModelForSequenceClassification.from_pretrained("abacusai/Toxicity-Lens", device_map="auto") - Transformers.js
How to use abacusai/Toxicity-Lens with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-classification', 'abacusai/Toxicity-Lens'); - Notebooks
- Google Colab
- Kaggle
Download calibration.json from abacusai/Toxicity-Lens: direct link, hf CLI and curl.
- Browser
- Download file 934 Bytes
-
https://huggingface.co/abacusai/Toxicity-Lens/resolve/main/calibration.json
- Command line
-
hf download hf://abacusai/Toxicity-Lens/calibration.json
-
curl -L -o calibration.json https://huggingface.co/abacusai/Toxicity-Lens/resolve/main/calibration.json
934 Bytes
| { | |
| "TOXICITY": { | |
| "T": 0.8846447061233969, | |
| "b": 0.0, | |
| "bce_before": 0.2647533416748047, | |
| "bce_after": 0.26280491139351864 | |
| }, | |
| "SEVERE_TOXICITY": { | |
| "T": 0.9606839367581773, | |
| "b": 0.0, | |
| "bce_before": 0.030175548046827316, | |
| "bce_after": 0.030081740848102244 | |
| }, | |
| "IDENTITY_ATTACK": { | |
| "T": 0.9321245706711462, | |
| "b": 0.0, | |
| "bce_before": 0.08911137282848358, | |
| "bce_after": 0.08866883811759634 | |
| }, | |
| "INSULT": { | |
| "T": 0.9069584109207444, | |
| "b": 0.0, | |
| "bce_before": 0.22118152678012848, | |
| "bce_after": 0.22001176320529933 | |
| }, | |
| "PROFANITY": { | |
| "T": 0.952039670548603, | |
| "b": 0.0, | |
| "bce_before": 0.062059011310338974, | |
| "bce_after": 0.0618737879040237 | |
| }, | |
| "THREAT": { | |
| "T": 0.939271272105012, | |
| "b": 0.0, | |
| "bce_before": 0.044321250170469284, | |
| "bce_after": 0.04407205513039715 | |
| }, | |
| "SEXUALLY_EXPLICIT": { | |
| "T": 0.9404558833442371, | |
| "b": 0.0, | |
| "bce_before": 0.028944551944732666, | |
| "bce_after": 0.028775966007625036 | |
| } | |
| } |