SEACrowd/thai_toxicity_tweet
Updated • 86
How to use mashironotdev/thai-toxic-classifier with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="mashironotdev/thai-toxic-classifier") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("mashironotdev/thai-toxic-classifier")
model = AutoModelForSequenceClassification.from_pretrained("mashironotdev/thai-toxic-classifier")# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("mashironotdev/thai-toxic-classifier")
model = AutoModelForSequenceClassification.from_pretrained("mashironotdev/thai-toxic-classifier")A Thai language toxicity detection model trained to classify whether a Thai sentence is toxic or non-toxic.
The model is intended for research and experimentation in Thai NLP safety, moderation systems, and toxicity analysis.
Repository:
https://huggingface.co/mashironotdev/thai-toxic-classifier
This model performs binary text classification on Thai text:
| Label | Meaning |
|---|---|
| 0 | non-toxic |
| 1 | toxic |
Example:
| Text | Prediction |
|---|---|
| สวัสดีครับ | non-toxic |
| ขอบคุณมากครับ | non-toxic |
| มึงโง่หรือไง | toxic |
| ไอ้ควาย | toxic |
This model is designed for:
Possible downstream uses:
This model should not be used for:
The model was trained on Thai toxicity datasets including:
The dataset contains Thai sentences labeled as toxic or non-toxic.
Typical preprocessing steps:
Example configuration:
# install dependencies
# pip install transformers torch
from transformers import pipeline
# load model from Hugging Face
classifier = pipeline(
"text-classification",
model="mashironotdev/thai-toxic-classifier"
)
# example inputs
texts = [
"สวัสดีครับ",
"ขอบคุณมากครับ",
"มึงโง่หรือไง",
"ไอ้ควาย"
]
# run inference
results = classifier(texts)
# print results
for text, result in zip(texts, results):
print(text, "->", result)
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="mashironotdev/thai-toxic-classifier")