detoxis-spanish-toxicity-classifier

21
license:mit
by
Juanpeg1729
Other
OTHER
New
21 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary

AI model with specialized capabilities.

Code Examples

🏷️ Labelspythontransformers
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
import numpy as np

model = AutoModelForSequenceClassification.from_pretrained("Juanpeg1729/detoxis-spanish-toxicity-classifier")
tokenizer = AutoTokenizer.from_pretrained("Juanpeg1729/detoxis-spanish-toxicity-classifier")

thresholds = [1.0, 0.9800000000000001, 0.7299999999999999, 1.2499999999999998]

text = "Tu texto aquí"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
with torch.no_grad():
    outputs = model(**inputs)
    probs = torch.softmax(outputs.logits, dim=-1).numpy()[0]
    adjusted = probs * np.array(thresholds)
    prediction = adjusted.argmax()

Deploy This Model

Production-ready deployment in minutes

Together.ai

Instant API access to this model

Fastest API

Production-ready inference API. Start free, scale to millions.

Try Free API

Replicate

One-click model deployment

Easiest Setup

Run models in the cloud with simple API. No DevOps required.

Deploy Now

Disclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.