Views
No views yet
| variety | macro-F1 | sarcasm/positive F1 | majority baseline |
|---|---|---|---|
| en-AU | 0.751 | 0.728 | 0.366 |
| en-UK | 0.687 | 0.515 | 0.439 |
| en-IN | 0.629 | 0.396 | 0.460 |
argmax is the wrong operating point. The positive class is a minority, so the threshold
was tuned on validation to maximise macro-F1:1import torch
2from transformers import AutoTokenizer, AutoModelForSequenceClassification
3
4name = "ppokhrel2109/besstie-sarcasm-deberta-v3"
5tok = AutoTokenizer.from_pretrained(name)
6model = AutoModelForSequenceClassification.from_pretrained(name).eval()
7
8text = "oh brilliant, another delayed train"
9with torch.no_grad():
10 logits = model(**tok(text, return_tensors="pt", truncation=True, max_length=128)).logits
11probability = torch.softmax(logits / 1.1819, dim=-1)[0, 1].item()
12label = "sarcastic" if probability >= 0.360 else "not sarcastic"