This model uses a custom PyTorch KABERT architecture and therefore cannot be loaded via Hugging Face pipeline or AutoModel.
Inference must be performed manually using PyTorch, as shown below.
Load model and tokenizer
import torch
import torch.nn as nn
from huggingface_hub import hf_hub_download
from transformers import AutoTokenizer, AutoModel
print(predict_sentiment("این محصول بسیار عالی است")) # Positive
print(predict_sentiment("خیلی بد بود و پیشنهاد نمیکنم")) # Negative
print(predict_sentiment("معمولی بود، نه خوب نه بد")) # Neutral
🔹 Label Mapping
The model was trained with the following label encoding:
ID Sentiment
0 Negative
1 Positive
2 Neutral
🔹 Notes
This repository contains a custom research architecture.
Hugging Face inference widgets are not enabled for non-PreTrainedModel classes.
The model is fully reproducible using the provided code.