Views
No views yet
relevance: is the last message in the dialogue relevant in the context of the full dialogue.specificity: is the last message in the dialogue interesting and promotes the continuation of the dialogue. max_length = 32.| threshold | f0.5 | ROC AUC | |
|---|---|---|---|
| relevance | 0.51 | 0.82 | 0.74 |
| specificity | 0.54 | 0.81 | 0.8 |
1import torch
2from transformers import AutoTokenizer, AutoModelForSequenceClassification
3
4tokenizer = AutoTokenizer.from_pretrained('tinkoff-ai/response-quality-classifier-tiny')
5model = AutoModelForSequenceClassification.from_pretrained('tinkoff-ai/response-quality-classifier-tiny')
6inputs = tokenizer('[CLS]привет[SEP]привет![SEP]как дела?[RESPONSE_TOKEN]норм, у тя как?', max_length=128, add_special_tokens=False, return_tensors='pt')
7with torch.inference_mode():
8 logits = model(**inputs).logits
9 probas = torch.sigmoid(logits)[0].cpu().detach().numpy()
10relevance, specificity = probas