Downloads · 30 days
11
17% of all-time downloads
moazx/AraBERT-Restaurant-Sentiment
AraBERT-Restaurant-Sentiment is a text classification model from moazx. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This repository contains the fine-tuned model moazx/AraBERT-Restaurant-Sentiment for classifying Arabic restaurant reviews into positive and negative sentiments. The model is based on the AraBERT architecture and trai…
Downloads · 30 days
11
17% of all-time downloads
All-time downloads
63
Public
Parameters
135M
541 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors541 MB · 100%
From the Hugging Face model README
This repository contains the fine-tuned model moazx/AraBERT-Restaurant-Sentiment for classifying Arabic restaurant reviews into positive and negative sentiments. The model is based on the AraBERT architecture and trained on a dataset of 800 Arabic restaurant reviews, collected and labeled using ChatGPT.
The AraBERT-Restaurant-Sentiment model is fine-tuned to classify Arabic restaurant reviews into two categories:
The dataset used for training consists of 400 positive and 400 negative reviews, covering multiple Arabic dialects.
Below are some examples of the model's output:
Below are some examples of the model's output:
Input: المطعم ما عجبني، الطعم مو حلو والخدمة كانت سيئة جداً، والموظفين ما كانوا محترمين. الأسعار غالية مقارنة بالجودة. ما بنصح فيه.
Expected Classification: سلبي
Predicted Classification: سلبي
Probability (Negative): 0.98
Probability (Positive): 0.02
Input: المطعم يجنن والاكل تحفة
Expected Classification: إيجابي
Predicted Classification: إيجابي
Probability (Negative): 0.01
Probability (Positive): 0.99
The model was trained using the notebook available at Kaggle. The training process involves the following steps:
To use the moazx/AraBERT-Restaurant-Sentiment model, you can load it using the Hugging Face transformers library. Below is an example of how to use the model to classify a restaurant review:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("moazx/AraBERT-Restaurant-Sentiment")
model = AutoModelForSequenceClassification.from_pretrained("moazx/AraBERT-Restaurant-Sentiment")
# Encode the input text
input_text = "المطعم يجنن والاكل تحفة"
inputs = tokenizer(input_text, return_tensors="pt")
# Get the model predictions
outputs = model(**inputs)
probabilities = torch.nn.functional.softmax(outputs.logits, dim=-1)
# Print the results
negative_prob = probabilities[0][0].item()
positive_prob = probabilities[0][1].item()
predicted_class = "إيجابي" if positive_prob > negative_prob else "سلبي"
print(f"التصنيف المتوقع: {predicted_class}")
print(f"احتمالية سلبي: {negative_prob:.2f}")
print(f"احتمالية إيجابي: {positive_prob:.2f}")
The dataset used for training the model was collected and labeled using ChatGPT. Special thanks to the creators of AraBERT and the Hugging Face team for their continuous support and development of open-source NLP tools.
For more details on the training process and dataset, please refer to the Kaggle Notebook.