Downloads · 30 days
12
24% of all-time downloads
MennatullahHany/Arabic-Speech-Guard
Arabic-Speech-Guard is a text classification model from MennatullahHany. Use it when you need a label for a piece of text.
Arabic-Speech-Guard is an Arabic text classification model fine-tuned on AraBERT to detect offensive and harmful speech.
Downloads · 30 days
12
24% of all-time downloads
All-time downloads
49
Public
Parameters
135M
541 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors541 MB · 100%
From the Hugging Face model README
Arabic-Speech-Guard is an Arabic text classification model fine-tuned on AraBERT to detect offensive and harmful speech.
aubmindlab/bert-base-arabertv2from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "USERNAME/Arabic-Speech-Guard"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "اكتب النص هنا"
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
with torch.no_grad():
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=1).item()
print("Prediction:", "Danger" if prediction == 1 else "Safe")