Arabic Speech Guard ๐Ÿ›ก๏ธ

Arabic-Speech-Guard is an Arabic text classification model fine-tuned on AraBERT to detect offensive and harmful speech.

Labels

  • 0 โ†’ Neutral
  • 1 โ†’ Offensive

Model Details

  • Base model: aubmindlab/bert-base-arabertv2
  • Task: Arabic Offensive Speech Detection
  • Language: Arabic

Usage

from 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")
Downloads last month
16
Safetensors
Model size
0.1B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ 1 Ask for provider support

Spaces using MennatullahHany/Arabic-Speech-Guard 4