Text Classification
Transformers
Safetensors
Laya
Arabic
modernbert
feature-extraction
arabic
nlu
intent-classification
natural-language-inference
custom_code
Eval Results (legacy)
Instructions to use Wouze/laya-ara with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Wouze/laya-ara with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Wouze/laya-ara", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("Wouze/laya-ara", trust_remote_code=True) model = AutoModel.from_pretrained("Wouze/laya-ara", trust_remote_code=True, device_map="auto") - Laya
How to use Wouze/laya-ara with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download examples/predict_triage.py from Wouze/laya-ara: direct link, hf CLI and curl.
- Browser
- Download file 1.41 kB
-
https://huggingface.co/Wouze/laya-ara/resolve/main/examples/predict_triage.py
- Command line
-
hf download hf://Wouze/laya-ara/examples/predict_triage.py
-
curl -L -o predict_triage.py https://huggingface.co/Wouze/laya-ara/resolve/main/examples/predict_triage.py
1.41 kB
| #!/usr/bin/env python3 | |
| """One Gulf WhatsApp pass: queue + urgency + refund + churn.""" | |
| from __future__ import annotations | |
| import os | |
| os.environ.setdefault("USE_TF", "0") | |
| import laya | |
| # pip install laya==0.3.4 | |
| # Local override: LAYA_AR_MODEL=/path/to/artifacts/laya-ar-v48 | |
| MODEL = os.environ.get("LAYA_AR_MODEL", "Wouze/laya-ara") | |
| STATE = { | |
| "channel": "whatsapp", | |
| "message": "الحوالة ما وصلت وصار لها يومين، أبي استرجاع الحين وإلا بنقلع", | |
| } | |
| QUESTIONS = { | |
| "queue": { | |
| "type": "choice", | |
| "instructions": "Which support queue?", | |
| "criteria": { | |
| "billing": "payments, refunds, charges", | |
| "technical": "bugs, outages, app issues", | |
| "account": "login, KYC, profile", | |
| "sales": "plans and pricing", | |
| "other": "none of the above", | |
| }, | |
| }, | |
| "urgency": { | |
| "type": "score", | |
| "instructions": "Urgency level?", | |
| "criteria": ["low", "medium", "high", "critical"], | |
| }, | |
| "refund_requested": {"type": "noul", "instructions": "Does the user ask for a refund?"}, | |
| "churn_threat": {"type": "noul", "instructions": "Does the user threaten to cancel or leave?"}, | |
| } | |
| def main() -> None: | |
| agent = laya.load(MODEL, token=os.environ.get("HF_TOKEN")) | |
| out = agent.predict(STATE, QUESTIONS) | |
| print(out) | |
| if __name__ == "__main__": | |
| main() | |