Encoder Models
Collection
4 items • Updated
How to use r1char9/rubert-tiny2-clf with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="r1char9/rubert-tiny2-clf") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("r1char9/rubert-tiny2-clf")
model = AutoModelForSequenceClassification.from_pretrained("r1char9/rubert-tiny2-clf", device_map="auto")# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("r1char9/rubert-tiny2-clf")
model = AutoModelForSequenceClassification.from_pretrained("r1char9/rubert-tiny2-clf", device_map="auto")A fine-tuned version of RuBERT-tiny2
for prompt intent classification on Russian text: given a user prompt,
the model predicts which of three intents it corresponds to.
| Label | Meaning |
|---|---|
write |
The prompt asks to write/generate text |
draw |
The prompt asks to draw/generate an image |
neutral |
Neither of the above |
from transformers import pipeline
model = pipeline(model="r1char9/rubert-tiny2-clf")
model("Сгенерируй картину Томаса Шелби")
# [{'label': 'draw', 'score': 0.8699279427528381}]
Evaluated on a held-out test set (support: 291 examples total).
| Metric | write | draw | neutral | micro avg | macro avg | weighted avg |
|---|---|---|---|---|---|---|
| Precision | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
| Recall | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
| F1-score | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
| Support | 155 | 117 | 19 | 291 | 291 | 291 |
| AUC-ROC | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
⚠️ All metrics at 1.0 across every class and averaging scheme usually signals evaluation on data overlapping with training data, a very small / easy test set, or a label-leakage issue — worth double-checking with a truly held-out, more diverse test set before relying on this number.
neutral class has much lower support (19 examples) than write
(155) and draw (117) — performance on the minority class may not be as
reliable as the reported metrics suggest.Base model
cointegrated/rubert-tiny2
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="r1char9/rubert-tiny2-clf")