Views
No views yet
roberta-base for binary sentiment classification on the
BESSTIE dataset, variety mixed, training seed 123.| id | label |
|---|---|
| 0 | Negative |
| 1 | Positive |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4repo = "vyshnav112233/BESSTIE-RoBERTa-mixed-seed123"
5tok = AutoTokenizer.from_pretrained(repo)
6model = AutoModelForSequenceClassification.from_pretrained(repo)
7model.eval()
8
9inputs = tok("I loved this!", return_tensors="pt", truncation=True, max_length=128)
10with torch.no_grad():
11 logits = model(**inputs).logits
12pred = int(logits.argmax(-1))
13print(model.config.id2label[pred])roberta-basenum_labels=2)mixed (one of en-AU, en-UK, en-IN, mixed)123best_model.pt
for users who want to reload the state_dict directly into a
RobertaForSequenceClassification instance.