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

Model tree for Mahmoud-103/arabert-hard-sentiment

Finetuned
(4,049)
this model

Space using Mahmoud-103/arabert-hard-sentiment 1