cointegrated / rut5-base-multitask

huggingface.co
Total runs: 307
24-hour runs: 8
7-day runs: 36
30-day runs: 59
Model's Last Updated: March 17 2023
text-generation

Introduction of rut5-base-multitask

Model Details of rut5-base-multitask

This is a smaller version of the google/mt5-base with only some Rusian and English embeddings left.

More details are given in a Russian post: https://habr.com/ru/post/581932/

The model has been fine-tuned for several tasks with sentences or short paragraphs:

  • translation ( translate ru-en and translate en-ru )
  • Paraphrasing ( paraphrase )
  • Filling gaps in a text ( fill ). The gaps can be denoted as ___ or _3_ , where 3 is the approximate number of words that should be inserted.
  • Restoring the text from a noisy bag of words ( assemble )
  • Simplification of texts ( simplify )
  • Dialogue response generation ( reply based on fiction and answer based on online forums)
  • Open-book question answering ( comprehend )
  • Asking questions about a text ( ask )
  • News title generation ( headline )

For each task, the task name is joined with the input text by the | separator.

The model can be run with the following code:

# !pip install transformers sentencepiece
import torch
from transformers import T5ForConditionalGeneration, T5Tokenizer
tokenizer = T5Tokenizer.from_pretrained("cointegrated/rut5-base-multitask")
model = T5ForConditionalGeneration.from_pretrained("cointegrated/rut5-base-multitask")

def generate(text, **kwargs):
    inputs = tokenizer(text, return_tensors='pt')
    with torch.no_grad():
        hypotheses = model.generate(**inputs, num_beams=5, **kwargs)
    return tokenizer.decode(hypotheses[0], skip_special_tokens=True)

The model can be applied to each of the pretraining tasks:

print(generate('translate ru-en | Каждый охотник желает знать, где сидит фазан.'))
# Each hunter wants to know, where he is.

print(generate('paraphrase | Каждый охотник желает знать, где сидит фазан.', 
               encoder_no_repeat_ngram_size=1, repetition_penalty=0.5, no_repeat_ngram_size=1))
# В любом случае каждый рыбак мечтает познакомиться со своей фермой

print(generate('fill | Каждый охотник _3_, где сидит фазан.'))
# смотрит на озеро

print(generate('assemble | охотник каждый знать фазан сидит'))
# Каждый охотник знает, что фазан сидит.

print(generate('simplify | Местным продуктом-специалитетом с защищённым географическим наименованием по происхождению считается люнебургский степной барашек.', max_length=32))
# Местным продуктом-специалитетом считается люнебургский степной барашек.

print(generate('reply | Помогите мне закадрить девушку'))
# Что я хочу?

print(generate('answer | Помогите мне закадрить девушку'))
# я хочу познакомиться с девушкой!!!!!!!!

print(generate("comprehend | На фоне земельного конфликта между владельцами овец и ранчеро разворачивается история любви овцевода Моргана Лейна, "
    "прибывшего в США из Австралии, и Марии Синглетон, владелицы богатого скотоводческого ранчо. Вопрос: откуда приехал Морган?"))
# из Австралии

print(generate("ask | На фоне земельного конфликта между владельцами овец и ранчеро разворачивается история любви овцевода Моргана Лейна, "
    "прибывшего в США из Австралии, и Марии Синглетон, владелицы богатого скотоводческого ранчо.", max_length=32))
# Что разворачивается на фоне земельного конфликта между владельцами овец и ранчеро?

print(generate("headline | На фоне земельного конфликта между владельцами овец и ранчеро разворачивается история любви овцевода Моргана Лейна, "
    "прибывшего в США из Австралии, и Марии Синглетон, владелицы богатого скотоводческого ранчо.", max_length=32))
# На фоне земельного конфликта разворачивается история любви овцевода Моргана Лейна и Марии Синглетон

However, it is strongly recommended that you fine tune the model for your own task.

Runs of cointegrated rut5-base-multitask on huggingface.co

307
Total runs
8
24-hour runs
14
3-day runs
36
7-day runs
59
30-day runs

More Information About rut5-base-multitask huggingface.co Model

More rut5-base-multitask license Visit here:

https://choosealicense.com/licenses/mit

rut5-base-multitask huggingface.co

rut5-base-multitask huggingface.co is an AI model on huggingface.co that provides rut5-base-multitask's model effect (), which can be used instantly with this cointegrated rut5-base-multitask model. huggingface.co supports a free trial of the rut5-base-multitask model, and also provides paid use of the rut5-base-multitask. Support call rut5-base-multitask model through api, including Node.js, Python, http.

rut5-base-multitask huggingface.co Url

https://huggingface.co/cointegrated/rut5-base-multitask

cointegrated rut5-base-multitask online free

rut5-base-multitask huggingface.co is an online trial and call api platform, which integrates rut5-base-multitask's modeling effects, including api services, and provides a free online trial of rut5-base-multitask, you can try rut5-base-multitask online for free by clicking the link below.

cointegrated rut5-base-multitask online free url in huggingface.co:

https://huggingface.co/cointegrated/rut5-base-multitask

rut5-base-multitask install

rut5-base-multitask is an open source model from GitHub that offers a free installation service, and any user can find rut5-base-multitask on GitHub to install. At the same time, huggingface.co provides the effect of rut5-base-multitask install, users can directly use rut5-base-multitask installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

rut5-base-multitask install url in huggingface.co:

https://huggingface.co/cointegrated/rut5-base-multitask

Url of rut5-base-multitask

rut5-base-multitask huggingface.co Url

Provider of rut5-base-multitask huggingface.co

cointegrated
ORGANIZATIONS

Other API from cointegrated