Text Classification
fastText
Joblib
Safetensors
PyTorch
Arabic
bert
arabic
sentiment-analysis
camelbert
scikit-learn
Instructions to use YossifSamy99/arabic-nlp-models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- fastText
How to use YossifSamy99/arabic-nlp-models with fastText:
from huggingface_hub import hf_hub_download import fasttext model = fasttext.load_model(hf_hub_download("YossifSamy99/arabic-nlp-models", "model.bin")) - Notebooks
- Google Colab
- Kaggle
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).
- Live Interactive Demo: Hugging Face Space
- Full Source Code & Training Notebook: GitHub Repository
๐ฆ 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