MARBERTv2 Arabic Sentiment Analysis
هذا النموذج مخصص لتصنيف المشاعر في النصوص العربية إلى ثلاث فئات: **إيجابي (Positive)**، محايد (Neutral)، وسلبي (Negative). تم بناء النموذج باستخدام بنية MARBERTv2 وتدريبه على مجموعة بيانات عربية ضخمة ومصنفة.
This model is designed for Arabic Sentiment Analysis, classifying text into three categories: Positive, Neutral, and Negative. It is based on the MARBERTv2 architecture and was fine-tuned on a custom Arabic dataset.
Model Details | تفاصيل النموذج
- Developed by: Eng.Rafat Mohammed
- Model type: BERT-based Sequence Classification
- Language(s): Arabic (ar)
- License: MIT
- Finetuned from model: UBC-NLP/MARBERTv2
Intended Uses & Limitations | الاستخدامات والقيود
Intended Use
- تحليل آراء العملاء في منصات التواصل الاجتماعي.
- تصنيف التعليقات والتقييمات للمنتجات والخدمات العربية.
- دراسات تحليل المشاعر العامة للنصوص العربية.
Limitations
- قد يواجه النموذج صعوبة في فهم بعض اللهجات العربية المحلية شديدة الخصوصية.
- الأداء الأفضل يكون مع النصوص التي تم تنظيفها من الرموز التعبيرية المبالغ فيها والروابط.
Training Procedure | طريقة التدريب
Training Hyperparameters
- Epochs: 3
- Learning Rate: 2e-5
- Batch Size: 8
- Weight Decay: 0.01
- Warmup steps: 300
- Max Sequence Length: 256
Dataset Split
تم تقسيم البيانات بنسبة 80/20:
- Training set: 40,000 samples
- Evaluation set: 10,000 samples
Evaluation Results | نتائج التقييم
| Metric | Value |
|---|---|
| Accuracy | 80.93% |
| F1 Score | 80.69% |
| Eval Loss | 0.7561 |
Usage Example | مثال على الاستخدام
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# تحميل النموذج والتوكنايزر
model_name = "RafatMohammed/MARBERTv2-sentiment-final"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# دالة التوقع
def predict_sentiment(text):
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=128)
with torch.no_grad():
outputs = model(**inputs)
pred_id = outputs.logits.argmax(dim=-1).item()
id2label = {0: "negative", 1: "neutral", 2: "positive"}
return id2label[pred_id]
# تجربة
print(predict_sentiment("الخدمة ممتازة وسريعة جداً")) # Output: positive
print(predict_sentiment("تأخر الطلب كثيراً ولم يعجبني الطعام")) # Output: negative
Citation | الاقتباس
إذا وجدت هذا النموذج مفيداً في بحثك، يرجى الإشارة إليه.
@misc{marbertv2-arabic-sentiment,
author = {Rafat Mohammed},
title = {MARBERTv2 Arabic Sentiment Analysis Model},
year = {2026},
publisher = {Hugging Face},
journal = {Hugging Face Model Hub}
}
- Downloads last month
- 25
Space using RafatMohammed/arabic-sentiment-marbertv2 1
Evaluation results
- accuracy on Arabic-Sentiment-50Kself-reported0.809
- f1 on Arabic-Sentiment-50Kself-reported0.807