Create README.md
Browse filesmodel loading:
```py
import torch
from transformers import (
AutoTokenizer,
AutoModelForSequenceClassification,
)
model_name = "AyaHazem61/araBERT-For-Hate-Speech-Detection"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(
model_name,
num_labels=2
)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)
```
model predicting:
```py
texts = ["السلام عليكم و رحمة الله و بركاته"]
inputs = tokenizer(texts , return_tensors="pt", padding="max_length", truncation=True, max_length=512)
model .eval()
with torch.no_grad():
outputs = model (**inputs)
logits = outputs.logits
```
README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
datasets:
|
| 4 |
+
- manueltonneau/arabic-hate-speech-superset
|
| 5 |
+
language:
|
| 6 |
+
- ar
|
| 7 |
+
metrics:
|
| 8 |
+
- f1
|
| 9 |
+
- accuracy
|
| 10 |
+
base_model:
|
| 11 |
+
- aubmindlab/bert-base-arabertv02
|
| 12 |
+
pipeline_tag: text-classification
|
| 13 |
+
---
|