Views
No views yet
UBC-NLP/MARBERTv2 for Arabic Sentiment Analysis.
The model is trained to classify Arabic text (specifically tweets) into two categories: Positive (LABEL_1) or Negative (LABEL_0).| Metric | Score |
|---|---|
| Accuracy | 94.40% |
| F1 (Macro) | 94.40% |
| Precision (Macro) | 94.40% |
| Recall (Macro) | 94.40% |
| Loss | 0.1667 |
load_best_model_at_end was used.transformers pipeline.1from transformers import pipeline
2
3# Load the pipeline
4pipe = pipeline(
5 "sentiment-analysis",
6 model="iMeshal/arabic-sentiment-classifier-marbert"
7)
8
9# Test with new texts
10texts = [
11 "هذا المنتج رائع جداً أنصح به",
12 "أسوأ خدمة عملاء على الإطلاق",
13 "الجو اليوم جميل"
14]
15
16results = pipe(texts)
17print(results)
18# Output:
19# [
20# {'label': 'LABEL_1', 'score': 0.99...}, # Positive
21# {'label': 'LABEL_0', 'score': 0.99...}, # Negative
22# {'label': 'LABEL_1', 'score': 0.98...} # Positive
23# ]
24transformers.Trainer class with the following key hyperparameters:UBC-NLP/MARBERTv2AutoTokenizer (with padding="max_length", truncation=True, max_length=512)