Downloads · 30 days
12
22% of all-time downloads
ziyanhashim/jais-lora-gulf-arabic-sentiment
jais-lora-gulf-arabic-sentiment is a text classification model from ziyanhashim. Use it when you need a label for a piece of text. It is set up for peft. The card lists the license as other.
A LoRA adapter fine-tuned on Jais-1.3B for 3-class sentiment analysis (Negative, Neutral, Positive) in Gulf Arabic code-switched text (Arabic mixed with English).
Downloads · 30 days
12
22% of all-time downloads
All-time downloads
54
Public
Repo size
53.6 MB
Likes
0
Public
Click a slice to open those files.
.safetensors53.6 MB · 92%
From the Hugging Face model README
A LoRA adapter fine-tuned on Jais-1.3B for 3-class sentiment analysis (Negative, Neutral, Positive) in Gulf Arabic code-switched text (Arabic mixed with English).
| Metric | Score |
|---|---|
| Accuracy | 89.20% |
| F1 (macro) | 86.06% |
| Precision | 86.27% |
| Recall | 85.91% |
| DSFS (cultural) | 72.5% |
The Dialectal Sentiment Fidelity Score (DSFS) evaluates cultural understanding across Gulf expressions (70%), code-switching patterns (70%), and culturally ambiguous/sarcastic phrases (80%).
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from peft import PeftModel
base_model = "inceptionai/jais-family-1p3b"
adapter = "ziyanhashim/jais-lora-gulf-arabic-sentiment"
tokenizer = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True, token="hf_xxx")
base = AutoModelForSequenceClassification.from_pretrained(
base_model, num_labels=3, torch_dtype=torch.float32,
trust_remote_code=True, ignore_mismatched_sizes=True, token="hf_xxx"
)
model = PeftModel.from_pretrained(base, adapter).eval()
text = "هالمطعم وايد حلو the food is amazing"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
with torch.no_grad():
probs = torch.softmax(model(**inputs).logits, dim=-1)[0]
labels = {0: "Negative", 1: "Neutral", 2: "Positive"}
print(f"{labels[probs.argmax().item()]}: {probs.max():.2%}")
Note: The base model
inceptionai/jais-family-1p3bis gated — you need a HuggingFace token with access.
| Parameter | Value |
|---|---|
| Base model | inceptionai/jais-family-1p3b (1.3B params) |
| LoRA rank (r) | 16 |
| LoRA alpha | 32 |
| LoRA dropout | 0.1 |
| Target modules | c_attn, c_proj, c_fc, c_fc2 |
| Trainable params | 13.4M (~0.96% of total) |
| Epochs | 5 |
| Batch size | 16 |
| Learning rate | 2e-5 |
| Training time | ~3.2 hours |
| Peak GPU memory | 15.45 GB |
~166K samples from multiple Arabic sentiment sources:
Labels: Negative (0), Neutral (1), Positive (2)
Ziyan Hashim & Hani Moustafa — Group big_boyz CSCI316 Big Data Mining & Applications, University of Wollongong in Dubai