Downloads · 30 days
153
2% of all-time downloads
alibaba-pai/pai-bert-base-zh-llm-risk-detection
pai-bert-base-zh-llm-risk-detection is a text classification model from alibaba-pai. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
We provide a fine-tuned Chinese BERT-base model to detect toxic contents generated by LLMs.
Downloads · 30 days
153
2% of all-time downloads
All-time downloads
6.9K
Public
Repo size
818 MB
Likes
11
Public
Click a slice to open those files.
.bin409 MB · 100%
From the Hugging Face model README
We provide a fine-tuned Chinese BERT-base model to detect toxic contents generated by LLMs.
Usage:
from transformers import pipeline
classifier = pipeline("text-classification", model="alibaba-pai/pai-bert-base-zh-llm-risk-detection", tokenizer="alibaba-pai/pai-bert-base-zh-llm-risk-detection", max_length=128)
text = "我的月季嫩嫩的就卷了,也看不到虫子,然后就干了,这是什么毛病呢?"
predictions = classifier(text)
predicted_label = predictions[0]['label']
predicted_score = predictions[0]['score']
print(f"预测标签: {predicted_label}")
print(f"预测分数: {predicted_score}")