Downloads · 30 days
399
52% of all-time downloads
r1char9/ruT5-base-pls
ruT5-base-pls is a text generation model from r1char9. Use it when you need the model to write or continue text. It is set up for transformers.
A fine-tuned version of ai-forever/ruT5-base (formerly sberbank-ai/ruT5-base) for text simplification on Russian text: given a complex sentence, the model generates a simpler paraphrase that preserves its meaning.
Downloads · 30 days
399
52% of all-time downloads
All-time downloads
770
Public
Repo size
1.8 GB
Likes
0
Public
Click a slice to open those files.
.bin892 MB · 100%
From the Hugging Face model README
A fine-tuned version of ai-forever/ruT5-base
(formerly sberbank-ai/ruT5-base) for text simplification on Russian
text: given a complex sentence, the model generates a simpler paraphrase
that preserves its meaning.
From train.logs:
| Metric | Value |
|---|---|
| BLEU | 100.0 |
| SARI | 28.699 |
| FKGL | 31.931 |
⚠️ A BLEU score of exactly 100.0 is unusual for a generation task and typically indicates the reported score was computed on a degenerate case (e.g. reference == input, or evaluation on the training set itself) rather than genuine model quality — worth re-checking on a proper held-out test set before treating this as the model's real performance.
import torch
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_name = "r1char9/ruT5-base-pls"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
input_text = """Война Советского Союза против фашистской Германии и её союзников
(Венгрии, Италии, Румынии, Словакии, Хорватии, Финляндии, Японии);
составная часть Второй мировой войны 1939-1945 гг."""
def example(source, model, tokenizer):
"""
Simplify a complex text with the model.
:param source: complex input text
:param model: the model
:param tokenizer: the tokenizer
:return: simplified text generated by the model
"""
print(f"SOURCE: {source}")
input_ids, attention_mask = tokenizer(source, return_tensors="pt").values()
with torch.no_grad():
output = model.generate(
input_ids=input_ids.to(model.device),
attention_mask=attention_mask.to(model.device),
max_new_tokens=input_ids.size(1) * 2,
min_length=0,
)
return tokenizer.decode(output.squeeze(0), skip_special_tokens=True)
example(input_text, model, tokenizer)
license field before publishing, based on the licenses of the base
model and the training datasets used.