Instructions to use alfredmh/Palette_nlu_service with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alfredmh/Palette_nlu_service with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="alfredmh/Palette_nlu_service")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("alfredmh/Palette_nlu_service", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Palette_nlu_service — Persian Sales NLU
مدل تخصصی تشخیص Intent / Slot / Search-Query برای فروش فارسی.
- مدل پایه برای ترین:
sbunlp/fabert - معماری سرویس: encoder مشترک + سرهای Intent / Slot / Query
- Output schema: structured JSON matching the Palette
INTENT_PROMPT
Intents (23)
PRODUCT_SEARCH, PRODUCT_PRICE, PRODUCT_DETAIL, PRODUCT_AVAILABILITY,
PRODUCT_RECOMMENDATION, PRODUCT_COMPARE, PRODUCT_IMAGE, NEGOTIATION,
ORDER_TRACKING, FAQ_*, GREETING, WELLNESS, THANKS, FAREWELL, HELP,
OUT_OF_SCOPE
Files
| Path | Description |
|---|---|
checkpoints/best.pt |
Trained weights |
configs/model_config.yaml |
Head sizes / pretrained name |
label_maps/ |
intent2id / slot2id |
tokenizer/ |
tokenizer assets |
Load locally
import torch
from src.models.joint_bert import JointBERT
from src.utils.config import load_joint_bert_config
model = JointBERT(load_joint_bert_config("configs/model_config.yaml"))
ckpt = torch.load("checkpoints/best.pt", map_location="cpu", weights_only=False)
model.load_state_dict(ckpt["model_state_dict"], strict=False)
model.eval()
Serve API
See the companion repo Palette_nlu_service — python scripts/serve.py.
Model tree for alfredmh/Palette_nlu_service
Base model
sbunlp/fabert