IlyaGusev / rubert_ext_sum_gazeta

huggingface.co
Total runs: 85
24-hour runs: 0
7-day runs: -12
30-day runs: 18
Model's Last Updated: July 13 2022
token-classification

Introduction of rubert_ext_sum_gazeta

Model Details of rubert_ext_sum_gazeta

RuBERTExtSumGazeta

Model description

Model for extractive summarization based on rubert-base-cased

Intended uses & limitations
How to use

Colab: link

import razdel
from transformers import AutoTokenizer, BertForTokenClassification

model_name = "IlyaGusev/rubert_ext_sum_gazeta"

tokenizer = AutoTokenizer.from_pretrained(model_name)
sep_token = tokenizer.sep_token
sep_token_id = tokenizer.sep_token_id

model = BertForTokenClassification.from_pretrained(model_name)

article_text = "..."
sentences = [s.text for s in razdel.sentenize(article_text)]
article_text = sep_token.join(sentences)

inputs = tokenizer(
    [article_text],
    max_length=500,
    padding="max_length",
    truncation=True,
    return_tensors="pt",
)
sep_mask = inputs["input_ids"][0] == sep_token_id

# Fix token_type_ids
current_token_type_id = 0 
for pos, input_id in enumerate(inputs["input_ids"][0]):
    inputs["token_type_ids"][0][pos] = current_token_type_id
    if input_id == sep_token_id:
        current_token_type_id = 1 - current_token_type_id

# Infer model
with torch.no_grad(): 
    outputs = model(**inputs) 
logits = outputs.logits[0, :, 1]

# Choose sentences 
logits = logits[sep_mask]
logits, indices = logits.sort(descending=True)
logits, indices = logits.cpu().tolist(), indices.cpu().tolist()
pairs = list(zip(logits, indices))
pairs = pairs[:3]
indices = list(sorted([idx for _, idx in pairs]))
summary = " ".join([sentences[idx] for idx in indices])
print(summary)
Limitations and bias
  • The model should work well with Gazeta.ru articles, but for any other agencies it can suffer from domain shift
Training data
Training procedure

TBD

Eval results

TBD

Evaluation: https://github.com/IlyaGusev/summarus/blob/master/evaluate.py

Flags: --language ru --tokenize-after --lower

Runs of IlyaGusev rubert_ext_sum_gazeta on huggingface.co

85
Total runs
0
24-hour runs
-6
3-day runs
-12
7-day runs
18
30-day runs

More Information About rubert_ext_sum_gazeta huggingface.co Model

More rubert_ext_sum_gazeta license Visit here:

https://choosealicense.com/licenses/apache-2.0

rubert_ext_sum_gazeta huggingface.co

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

rubert_ext_sum_gazeta huggingface.co Url

https://huggingface.co/IlyaGusev/rubert_ext_sum_gazeta

IlyaGusev rubert_ext_sum_gazeta online free

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

IlyaGusev rubert_ext_sum_gazeta online free url in huggingface.co:

https://huggingface.co/IlyaGusev/rubert_ext_sum_gazeta

rubert_ext_sum_gazeta install

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

rubert_ext_sum_gazeta install url in huggingface.co:

https://huggingface.co/IlyaGusev/rubert_ext_sum_gazeta

Url of rubert_ext_sum_gazeta

rubert_ext_sum_gazeta huggingface.co Url

Provider of rubert_ext_sum_gazeta huggingface.co

IlyaGusev
ORGANIZATIONS

Other API from IlyaGusev

huggingface.co

Total runs: 8
Run Growth: 0
Growth Rate: 0.00%
Updated: July 13 2022
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated: May 18 2023