Downloads · 30 days
7
0% of all-time downloads
Den4ikAI/ruBert-base-qa-ranker
ruBert-base-qa-ranker is a text classification model from Den4ikAI. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
Модель для оценки релевантности ответов на вопросы.
Downloads · 30 days
7
0% of all-time downloads
All-time downloads
4.6K
Public
Repo size
1.4 GB
Likes
2
Public
Click a slice to open those files.
.bin711 MB · 99%
From the Hugging Face model README
Модель для оценки релевантности ответов на вопросы.
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained('Den4ikAI/ruBert-base-qa-ranker')
model = AutoModelForSequenceClassification.from_pretrained('Den4ikAI/ruBert-base-qa-ranker')
inputs = tokenizer('[CLS]Что такое QR-код?[RESPONSE_TOKEN]QR-код - это тип матричного штрих-кода.', max_length=512, add_special_tokens=False, return_tensors='pt')
with torch.inference_mode():
logits = model(**inputs).logits
probas = torch.sigmoid(logits)[0].cpu().detach().numpy()
relevance, no_relevance = probas
print('Relevance: {}'.format(relevance))
@MISC{Den4ikAI/ruBert-base-qa-ranker,
author = {Denis Petrov},
title = {Russian QA relevancy model},
url = {https://huggingface.co/Den4ikAI/ruBert-base-qa-ranker},
year = 2023
}