Encoder Models
Collection
4 items • Updated
How to use r1char9/rubert-base-cased-russian-sentiment with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="r1char9/rubert-base-cased-russian-sentiment") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("r1char9/rubert-base-cased-russian-sentiment")
model = AutoModelForSequenceClassification.from_pretrained("r1char9/rubert-base-cased-russian-sentiment", device_map="auto")Модель RuBERT была дообучена на задачу sentiment classification для короткого Russian корпуса. Задача представляет собой multi-class classification со следующими метками:
0: neutral
1: positive
2: negative
from transformers import pipeline
model = pipeline(model="r1char9/rubert-base-cased-russian-sentiment")
model("Привет, ты мне нравишься!")
# [{'label': 'positive', 'score': 0.8220236897468567}]
Модель была натренирована на данных:
tokenizer.max_length: 256
batch_size: 32
optimizer: adam
lr: 0.00001
weight_decay: 0
epochs: 2