Views
No views yet
| Training Loss | Epoch | Step | Validation Loss | F1 |
|---|---|---|---|---|
| 0.0992 | 1.0 | 1391 | 0.0737 | 0.9337 |
| 0.0585 | 2.0 | 2782 | 0.0616 | 0.9384 |
| 0.0358 | 3.0 | 4173 | 0.0787 | 0.9441 |
| 0.0221 | 4.0 | 5564 | 0.0918 | 0.9488 |
| 0.0106 | 5.0 | 6955 | 0.1085 | 0.9461 |
import torch
from transformers import AutoModelForSequenceClassification
from transformers import BertTokenizerFast
tokenizer = BertTokenizerFast.from_pretrained('kartashoffv/vashkontrol-sentiment-rubert')
model = AutoModelForSequenceClassification.from_pretrained('kartashoffv/vashkontrol-sentiment-rubert', return_dict=True)
@torch.no_grad()
def predict(review):
inputs = tokenizer(review, max_length=512, padding=True, truncation=True, return_tensors='pt')
outputs = model(**inputs)
predicted = torch.nn.functional.softmax(outputs.logits, dim=1)
pred_label = torch.argmax(predicted, dim=1).numpy()
return pred_label0: POSITIVE
1: NEUTRAL
2: NEGATIVE