AraBERT fine-tuned for Arabic hotel review sentiment
Binary sentiment classifier (negative / positive) for Arabic hotel reviews, fine-tuned from
aubmindlab/bert-base-arabertv02
on the HARD dataset (Booking.com reviews, MSA and dialectal Arabic).
Code and full pipeline: https://github.com/Mahmoud5150/ANLP_v2
Results (held-out test set, 10,217 reviews)
| Model | Test accuracy |
|---|---|
| TF-IDF + logistic regression | 85.76% |
| This model | 91.85% |
Reviews predicted with โฅ0.9 confidence (82% of the test set) are correct 96.8% of the time.
Usage
from transformers import pipeline
clf = pipeline("text-classification", model="Mahmoud-103/arabert-hard-sentiment")
clf("ุงูุบุฑูุฉ ูุธููุฉ ูุงูู
ูุธููู ู
ุชุนุงูููู ุฌุฏุง")
# [{'label': 'positive', 'score': 0.97}]
Training data
HARD (balanced version). Ratings 1โ2 โ negative, 4โ5 โ positive. Booking.com auto-generated titles (e.g. "ุงุณุชุซูุงุฆู", "ู ุฎูุจ ููุฃู ู"), which appear in ~40% of reviews and reveal the label, were removed before training, so scores are not directly comparable to results that keep them. Split: 82,821 train / 10,217 val / 10,217 test.
Training
2 epochs, learning rate 2e-5, batch size 32 per device, max length 128, fp16, on a Kaggle T4 ร2. Best epoch selected by validation F1 (val accuracy 91.91%).
Limitations
- Trained on hotel reviews only; other domains are untested.
- Labels come from star ratings, which are noisy; mixed reviews ("good location, dirty room") are the hardest case.
- Binary only: no neutral class.
- The HARD dataset has no stated license; intended for research and educational use.
Citation (dataset)
Elnagar, A., Khalifa, Y. S., & Einea, A. (2018). Hotel Arabic-Reviews Dataset Construction for Sentiment Analysis Applications. In Intelligent Natural Language Processing: Trends and Applications, Springer.
- Downloads last month
- 18
Model tree for Mahmoud-103/arabert-hard-sentiment
Base model
aubmindlab/bert-base-arabertv02