Views
No views yet
AppreciationComplaintFeedbackcardiffnlp/twitter-roberta-base model, which is pretrained on 58M tweets.| Class | Precision | Recall | F1 Score |
|---|---|---|---|
| Appreciation | 0.906 | 0.936 | 0.921 |
| Complaint | 0.931 | 0.902 | 0.916 |
| Feedback | 0.840 | 0.874 | 0.857 |
| Average | – | – | 0.898 |
Evaluated on 2039 unseen posts with held-out labels using macro-averaged F1.
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2from torch.nn.functional import softmax
3import torch
4
5model = AutoModelForSequenceClassification.from_pretrained("harshithan/fb-post-classifier-roberta_v1")
6tokenizer = AutoTokenizer.from_pretrained("harshithan/fb-post-classifier-roberta_v1")
7
8inputs = tokenizer("I love the fast delivery!", return_tensors="pt")
9outputs = model(**inputs)
10probs = softmax(outputs.logits, dim=1)
11
12label = torch.argmax(probs).item()
13classes = ["Appreciation", "Complaint", "Feedback"]
14print("Predicted:", classes[label])