Edit model card

Den4ikAI/ruBert-base-qa-ranker

Модель для оценки релевантности ответов на вопросы.

Использование

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))

Citation

@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
}
Downloads last month
45
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Dataset used to train Den4ikAI/ruBert-base-qa-ranker