cointegrated / rut5-base-absum

huggingface.co
Total runs: 514
24-hour runs: 23
7-day runs: -68
30-day runs: 114
Model's Last Updated: March 17 2023
summarization

Introduction of rut5-base-absum

Model Details of rut5-base-absum

This is a model for abstractive Russian summarization, based on cointegrated/rut5-base-multitask and fine-tuned on 4 datasets.

It can be used as follows:

import torch
from transformers import T5ForConditionalGeneration, T5Tokenizer
MODEL_NAME = 'cointegrated/rut5-base-absum'
model = T5ForConditionalGeneration.from_pretrained(MODEL_NAME)
tokenizer = T5Tokenizer.from_pretrained(MODEL_NAME)
model.cuda();
model.eval();

def summarize(
    text, n_words=None, compression=None,
    max_length=1000, num_beams=3, do_sample=False, repetition_penalty=10.0, 
    **kwargs
):
    """
    Summarize the text
    The following parameters are mutually exclusive:
    - n_words (int) is an approximate number of words to generate.
    - compression (float) is an approximate length ratio of summary and original text.
    """
    if n_words:
        text = '[{}] '.format(n_words) + text
    elif compression:
        text = '[{0:.1g}] '.format(compression) + text
    x = tokenizer(text, return_tensors='pt', padding=True).to(model.device)
    with torch.inference_mode():
        out = model.generate(
            **x, 
            max_length=max_length, num_beams=num_beams, 
            do_sample=do_sample, repetition_penalty=repetition_penalty, 
            **kwargs
        )
    return tokenizer.decode(out[0], skip_special_tokens=True)

text = """Высота башни составляет 324 метра (1063 фута), примерно такая же высота, как у 81-этажного здания, и самое высокое сооружение в Париже. Его основание квадратно, размером 125 метров (410 футов) с любой стороны. Во время строительства Эйфелева башня превзошла монумент Вашингтона, став самым высоким искусственным сооружением в мире, и этот титул она удерживала в течение 41 года до завершения строительство здания Крайслер в Нью-Йорке в 1930 году. Это первое сооружение которое достигло высоты 300 метров. Из-за добавления вещательной антенны на вершине башни в 1957 году она сейчас выше здания Крайслер на 5,2 метра (17 футов). За исключением передатчиков, Эйфелева башня является второй самой высокой отдельно стоящей структурой во Франции после виадука Мийо."""
print(summarize(text))
# Эйфелева башня достигла высоты 300 метров.
print(summarize(text, n_words=10))
# Французская Эйфелева башня достигла высоты 300 метров.

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

514
Total runs
23
24-hour runs
39
3-day runs
-68
7-day runs
114
30-day runs

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

More rut5-base-absum license Visit here:

https://choosealicense.com/licenses/mit

rut5-base-absum huggingface.co

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

cointegrated rut5-base-absum online free

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

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

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

rut5-base-absum install

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

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

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

Url of rut5-base-absum

Provider of rut5-base-absum huggingface.co

cointegrated
ORGANIZATIONS

Other API from cointegrated