Arabic Sentiment Analysis Models (4-Paradigm Benchmark)

Pre-trained model artifacts powering the Arabic Sentiment Arena interactive benchmark. All four models were trained and evaluated on the same ~58,000 Arabic tweets dataset (80/10/10 split, 11,520 test tweets).


๐Ÿ“ฆ Hosted Artifacts

Model Directory / Files Framework Test Accuracy Macro F1 CPU Latency
CAMeLBERT-Mix (Fine-tuned) camelbert/ (model.safetensors, tokenizer files) Transformers / PyTorch 94.42% 0.9442 94.72 ms
Bi-LSTM bilstm/ (bilstm_model.pt, vocab.joblib) PyTorch 78.26% 0.7823 3.65 ms
TF-IDF + Logistic Regression tfidf/ (tfidf_pipeline.joblib) Scikit-Learn 78.04% 0.7802 0.79 ms
FastText + Logistic Regression fasttext/ (fasttext_clf.joblib, cc.ar.300.bin) FastText / Scikit-Learn 69.90% 0.6989 0.24 ms

๐Ÿ’ป Quick Usage (CAMeLBERT-Mix)

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

repo_id = "YossifSamy99/arabic-nlp-models"
tokenizer = AutoTokenizer.from_pretrained(repo_id, subfolder="camelbert")
model = AutoModelForSequenceClassification.from_pretrained(repo_id, subfolder="camelbert")
model.eval()

text = "ุงู„ุฎุฏู…ุฉ ุงู„ู†ู‡ุงุฑุฏุฉ ูƒุงู†ุช ููˆู‚ ุงู„ู…ู…ุชุงุฒ ุจุฌุฏ ูˆุงู„ุชุนุงู…ู„ ุฑุงู‚ูŠ ุฌุฏุงู‹ ๐Ÿ˜๐Ÿ‘"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)

with torch.no_grad():
    probs = torch.softmax(model(**inputs).logits, dim=-1)[0]

pred_id = torch.argmax(probs).item()
print(f"Label: {model.config.id2label[pred_id]} | Confidence: {probs[pred_id]:.2%}")

For full preprocessing pipelines (clean_classical vs. clean_transformer) and inference wrappers for all four models, refer to core/wrappers.py.

Downloads last month
14
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

Space using YossifSamy99/arabic-nlp-models 1