ziyanhashim/jais-lora-gulf-arabic-sentiment
010
Jais-1.3B LoRA — Gulf Arabic Sentiment Analysis
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).
Performance
The Dialectal Sentiment Fidelity Score (DSFS) evaluates cultural understanding across Gulf expressions (70%), code-switching patterns (70%), and culturally ambiguous/sarcastic phrases (80%).
Usage
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-1p3b is gated — you need a HuggingFace token with access.Training Details
Dataset
~166K samples from multiple Arabic sentiment sources:
- Arabic Sentiment Twitter Corpus (~58K tweets)
- LABR: Large Arabic Book Reviews (~63K)
- HARD: Hotel Arabic Reviews Dataset
- 60 synthetic Gulf Arabic code-switched examples
Labels: Negative (0), Neutral (1), Positive (2)
Developed By
Ziyan Hashim & Hani Moustafa — Group big_boyz CSCI316 Big Data Mining & Applications, University of Wollongong in Dubai
Framework Versions
- PEFT 0.18.1
- Transformers 4.44.0
- PyTorch 2.0+
