Downloads · 30 days
105
2% of all-time downloads
uget/sexual_content_dection
sexual_content_dection is a text classification model from uget. Use it when you need a label for a piece of text. The card lists the license as mit.
Detect sexual content in text or file names.
Downloads · 30 days
105
2% of all-time downloads
All-time downloads
5.9K
Public
Parameters
178M
711 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors711 MB · 99%
From the Hugging Face model README
Detect sexual content in text or file names.
<a href="https://ko-fi.com/ugetai" target="_blank" rel="noopener noreferrer">Buy me a cup of coffee,thanks</a>
predict("Tiffany Doll - Wine Makes Me Anal (31.03.2018)_1080p.mp4")
{
"predictions": 1,
"label": "Sexual"
}
predict("橙子 · 保安和女业主的一夜春宵。路见不平拔刀相助,救下苏姐,以身相许!")
{
"predictions": 1,
"label": "Sexual"
}
predict("MILK-217-UNCENSORED-LEAKピタコス Gカップ痴女 完全着衣で濃密5PLAY 椿りか 580 2.TS")
{
"predictions": 1,
"label": "Sexual"
}
predict("DVAJ-548_CH_SD")
{
"predictions": 1,
"label": "Sexual"
}
Create a python file under this model, such as 'use_model.py'
import torch
from transformers import BertForSequenceClassification, BertTokenizer
# load model
tokenizer = BertTokenizer.from_pretrained("uget/sexual_content_dection")
model = BertForSequenceClassification.from_pretrained("uget/sexual_content_dection")
def predict(text):
encoding = tokenizer(text, return_tensors="pt")
encoding = {k: v.to(model.device) for k,v in encoding.items()}
outputs = model(**encoding)
probs = torch.sigmoid(outputs.logits)
predictions = torch.argmax(probs, dim=-1)
label_map = {0: "None", 1: "Sexual"}
predicted_label = label_map[predictions.item()]
print(f"Predictions:{predictions.item()}, Label:{predicted_label}")
return {"predictions": predictions.item(), "label": predicted_label}
predict("Tiffany Doll - Wine Makes Me Anal (31.03.2018)_1080p.mp4")
Run
python3 use_model.py
Response JSON
{
"predictions": 1,
"label": "Sexual"
}
The results only include two situations:
<a href="https://ko-fi.com/ugetai" target="_blank" rel="noopener noreferrer">Buy me a cup of coffee,thanks</a>
Email: [email protected]