HRP Stage 04 โ€” Hotel Review Sentiment Classification

Arabic / ุงู„ุนุฑุจูŠุฉ: ู†ู…ูˆุฐุฌ ุชุนู„ูŠู…ูŠ ู„ุชุตู†ูŠู ู…ุดุงุนุฑ ุชู‚ูŠูŠู…ุงุช ุงู„ูู†ุงุฏู‚ ุถู…ู† ู…ุดุฑูˆุน HRP (ู…ู†ุตุฉ ุญุฌุฒ ุงู„ูู†ุงุฏู‚ ูˆุทู„ุจ ุงู„ุณูŠุงุฑุงุช). ุชู… ุชุฏุฑูŠุจู‡ ุนู„ู‰ ุชู‚ูŠูŠู…ุงุช ุงุตุทู†ุงุนูŠุฉ ุจุงู„ูƒุงู…ู„ุŒ ูˆู„ูŠุณ ุจูŠุงู†ุงุช ุนู…ู„ุงุก ุญู‚ูŠู‚ูŠูŠู†. ู„ู„ุชุฌุงุฑุจ ูˆุงู„ุชุนู„ูŠู… ูู‚ุทุŒ ูˆู„ูŠุณ ู„ุงุชุฎุงุฐ ู‚ุฑุงุฑุงุช ุชุดุบูŠู„ูŠุฉ ุชู„ู‚ุงุฆูŠุฉ.

English: Educational scikit-learn Logistic Regression + TF-IDF model for hotel review sentiment. Trained and tested on synthetic Arabic/English reviews only. Results do not establish real-world predictive validity.

Task and data

  • Sentiment classes: NEGATIVE, NEUTRAL, POSITIVE.
  • Inputs: concatenate review_title and review_text, as in the original HRP Stage 04 pipeline.
  • Dataset reference: HRP Stage 04 Synthetic Hotel Reviews.
  • Original source corpus: 16,000 synthetic examples (10,867 Arabic; 5,133 English).
  • Original split: chronological 70% training, 15% validation, 15% test.
  • No rating, IDs, moderation statuses, or other outcome leakage fields as model inputs.

Model artifacts

  • sentiment_model.joblib: serialized scikit-learn pipeline, including its text normalizer and TF-IDF components.
  • sentiment_label_encoder.joblib: maps predicted class indices back to sentiment labels.
  • src/text_preprocessing.py and src/__init__.py: required to load the custom text-normalization function referenced by the joblib artifact.
  • model_metadata.json, results/final_test_metrics.json, and example_inference.py: documentation and reproducibility examples.

Original held-out synthetic test results

Metric Value
Accuracy 0.8742
Macro F1 0.7966
Balanced accuracy 0.8306
ROC AUC (macro OVR) 0.9215

These scores were recorded during the original HRP Stage 04 evaluation on synthetic data. They have not been revalidated against the sanitized published export, and synthetic review patterns may repeat across chronological splits. Do not equate the scores with performance on independent, real customer reviews.

Run locally or on Colab

Install requirements, download this repository's contents into one folder (including src/), and run:

pip install -r requirements.txt
python example_inference.py

You can also retrieve the full model repository through huggingface_hub.snapshot_download:

from huggingface_hub import snapshot_download
path = snapshot_download(repo_id="AL-mozahem/HRP-Stage04-Hotel-Review-Sentiment")
print(path)

Important: .joblib deserialization can execute arbitrary code. Load only model files from sources you trust. Use scikit-learn 1.8.0 and joblib 1.5.3, which match the original stage's pinned dependencies.

Limitations and appropriate use

  • Synthetic bilingual data do not represent the full range of real dialects, spelling errors, sarcasm, code-switching, or changing customer behavior.
  • For academic demonstrations, evaluation exercises, and comparisons with other models; not production inference without clean, real-data retraining and robust out-of-sample validation.
  • Negative sentiment is not evidence of a moderation-policy violation; this repository contains only the sentiment model. Moderation is a separate decision-support task requiring human review.
  • The dataset is an educational sanitized release; neither the raw corpus nor personally identifying schema columns are published here.

Project

HRP โ€” Hotel & Ride-Hailing Platform, Stage 04 / supervised text classification. The broader platform's AI is decision support only; this repository does not change booking, review-publication, or administrative status automatically.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Space using AL-mozahem/HRP-Stage04-Hotel-Review-Sentiment 1