YAML Metadata Warning: The pipeline tag "text2text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other

This is a model for generation paraphrases for given text.

Usage

Using model with Huggingface Transformers:

import torch
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model_name = "fyaronskiy/ruT5-large-paraphraser"
model = AutoModelForSeq2SeqLM.from_pretrained(model_name).to(device)
tokenizer = AutoTokenizer.from_pretrained(model_name)

def paraphrase(text, beams=5, grams=3, **kwargs):
    x = tokenizer(text, return_tensors='pt', padding=True).to(device)
    max_size = int(x.input_ids.shape[1] * 1.5)
    output = model.generate(**x, encoder_no_repeat_ngram_size=grams, num_beams=beams, \
                         max_length=max_size, do_sample = True,  **kwargs)
    
    return tokenizer.decode(output[0], skip_special_tokens=True)

paraphrase('Для оценки ситуации в данной сфере эксперты РИА Новости рассчитали соотношение среднедушевых доходов в регионах России и стоимости фиксированного набора потребительских товаров и услуг. Этот показатель позволяет сравнивать регионы по уровню доходов с учетом их покупательной способности, во многом зависящей от уровня местных цен.')
# 'Эксперты РИА Новости оценили среднедушевые доходы россиян и стоимость фиксированной потребительской корзины, а также ее покупательную способность, которая во многом зависит от уровня цен в регионе.'

paraphrase('Каждый охотник желает знать, где сидит фазан')
# 'Каждый охотник хочет знать о том, где находится фазан.'
Downloads last month
48
Safetensors
Model size
0.7B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for fyaronskiy/ruT5-large-paraphraser

Adapter
(2)
this model

Dataset used to train fyaronskiy/ruT5-large-paraphraser

Collection including fyaronskiy/ruT5-large-paraphraser