tomaarsen/setfit-absa-semeval-restaurants
Viewer • Updated • 4.83k • 285 • 4
How to use sy12ssss/absa-deberta-v3 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="sy12ssss/absa-deberta-v3") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("sy12ssss/absa-deberta-v3")
model = AutoModelForSequenceClassification.from_pretrained("sy12ssss/absa-deberta-v3", device_map="auto")DeBERTa-v3-base fine-tuned for aspect-based sentiment analysis. Input is an (aspect, sentence) pair, output is negative, neutral or positive for that aspect.
Int8 quantization of this model was not usable (accuracy collapsed), so the browser demo uses absa-roberta-base.
| Runtime | Size | Accuracy |
|---|---|---|
| PyTorch fp32 | ~500 MB | 0.8214 |
Temperature scaling: T = 1.604, ECE reduced from 0.0993 to 0.0505.
Pass the aspect as the first text and the sentence as the second (tokenizer(aspect, sentence)). Divide logits by the temperature before the softmax for calibrated confidence.
Trained on restaurant and laptop reviews only (SemEval-2014 Task 4). The aspect must be provided.
Base model
microsoft/deberta-v3-base