Downloads · 30 days
4
4% of all-time downloads
surya120/myplaygirl-nsfw-classifier
myplaygirl-nsfw-classifier is a text classification model from surya120. Use it when you need a label for a piece of text.
This model is a fine-tuned text classification model for detecting NSFW (Not Safe For Work) content in text messages. It is based on a transformer architecture and has been trained to distinguish between explicit sexu…
Downloads · 30 days
4
4% of all-time downloads
All-time downloads
95
Public
Parameters
142M
568 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors568 MB · 98%
From the Hugging Face model README
This model is a fine-tuned text classification model for detecting NSFW (Not Safe For Work) content in text messages. It is based on a transformer architecture and has been trained to distinguish between explicit sexual content (NSFW) and safe content (SFW).
Developed by: MyPlaygirl AI Team
Model type: Text Classification
Language: English
License: MIT
Evaluated on 100 test samples with 90% confidence threshold:
| Metric | NSFW Class (0) | Macro Average |
|---|---|---|
| Precision | 1.0000 | 1.0000 |
| Recall | 1.0000 | 1.0000 |
| F1 Score | 1.0000 | 1.0000 |
Predicted
NSFW SFW
Actual NSFW 50 0
SFW 0 50
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
import torch.nn.functional as F
# Load model
model_name = "surya120/myplaygirl-nsfw-classifier"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Prepare text
text = "Your text here"
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=512)
# Predict with confidence scores
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
# Get probabilities
probs = F.softmax(logits, dim=-1)
confidence, prediction = torch.max(probs, dim=-1)
prediction = prediction.item()
confidence = confidence.item()
# Interpret result
label = "NSFW" if prediction == 0 else "SFW"
print(f"Prediction: {label}")
print(f"Confidence: {confidence:.2%}")
# Apply confidence threshold (recommended: 90%)
CONFIDENCE_THRESHOLD = 0.90
if confidence >= CONFIDENCE_THRESHOLD:
print(f"High confidence prediction: {label}")
else:
print(f"Low confidence prediction: {label} (consider manual review)")
The model was trained on a custom curated dataset containing:
The model was evaluated on 100 balanced test samples (50 NSFW, 50 SFW):
For predictions below the confidence threshold, manual review is recommended for production use.
This model is designed for content moderation purposes. Users should: