d0rj/RuModernBERT-small-rucola

Usage

Labels: "1" refers to "acceptable", while "0" corresponds to "unacceptable".

Simple

from transformers import pipeline


pipe = pipeline('text-classification', model='d0rj/RuModernBERT-small-rucola')
pipe(["Мне предоставилась возможность все видеть, сам оставаясь незамеченным.", "Весной в лесу очень хорошо"])
>>> [{'label': 'LABEL_0', 'score': 0.5270525217056274},
>>> {'label': 'LABEL_1', 'score': 0.923351526260376}]

Using weights

import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer


model = AutoModelForSequenceClassification.from_pretrained("d0rj/RuModernBERT-small-rucola")
tokenizer = AutoTokenizer.from_pretrained("d0rj/RuModernBERT-small-rucola")


@torch.inference_mode()
def predict(text: str | list[str], model = model, tokenizer = tokenizer) -> list[int]:
    inputs = tokenizer(text, return_tensors='pt', padding=True, truncation=True).to(model.device)
    outputs = model(**inputs)
    probs = torch.nn.functional.softmax(outputs.logits, dim=-1)
    return probs.cpu().argmax(dim=-1).numpy().tolist()


predict(["Мне предоставилась возможность все видеть, сам оставаясь незамеченным.", "Весной в лесу очень хорошо"])
>>> [0, 1]

Metrics

name accuracy MCC model size, params
d0rj/RuModernBERT-small-rucola 0.7 0.25 34.5M
RussianNLP/ruRoBERTa-large-rucola 0.82 0.56 355M

Training

See raw Weights & Biases logs or simple report.

Downloads last month
0
Safetensors
Model size
34.5M params
Tensor type
F32
·
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.

Model tree for d0rj/RuModernBERT-small-rucola

Finetuned
(1)
this model

Dataset used to train d0rj/RuModernBERT-small-rucola

Evaluation results