SAVRN
Search Contact SAVRN

Open-weight model · Summarization

mt5-persian-summary

by Nikeghbal nafisehNik/mt5-persian-summary

This model is fine-tuned to generate summaries based on the input provided. It has been fine-tuned on a wide range of Persian news data, including BBC news and pnsummary. If you find this model useful, make a link to the huggingface model.

Parameters
Context
Weights1.2 GB
Licensemit
AccessOpen weights
Monthly Downloads1.4k

Model Card

By Nikeghbal, published under mit, revision b575560ad967.

This model is fine-tuned to generate summaries based on the input provided. It has been fine-tuned on a wide range of Persian news data, including BBC news and pnsummary. If you find this model useful, make a link to the huggingface model.

Read Nikeghbal's full model card

This model is fine-tuned to generate summaries based on the input provided. It has been fine-tuned on a wide range of Persian news data, including BBC news and pn_summary.

Usage

from transformers import  AutoModelForSeq2SeqLM, MT5Tokenizer

model = AutoModelForSeq2SeqLM.from_pretrained('nafisehNik/mt5-persian-summary')

tokenizer = MT5Tokenizer.from_pretrained("nafisehNik/mt5-persian-summary")


# method for summary generation, using the global model and tokenizer
def generate_summary(model, abstract, num_beams = 2, repetition_penalty = 1.0,
                    length_penalty = 2.0, early_stopping = True, max_output_length = 120):
    source_encoding=tokenizer(abstract, max_length=1000, padding="max_length", truncation=True, return_attention_mask=True, add_special_tokens=True, return_tensors="pt")

    generated_ids=model.generate(
        input_ids=source_encoding["input_ids"],
        attention_mask=source_encoding["attention_mask"],
        num_beams=num_beams,
        max_length=max_output_length,
        repetition_penalty=repetition_penalty,
        length_penalty=length_penalty,
        early_stopping=early_stopping,
        use_cache=True
        )

    preds=[tokenizer.decode(gen_id, skip_special_tokens=True, clean_up_tokenization_spaces=True) 
         for gen_id in generated_ids]

    return "".join(preds)

text = "YOUR INPUT TEXT"
result = generate_summary(model=model, abstract=text, num_beams=2, max_output_length=120)

Citation

If you find this model useful, make a link to the huggingface model.

Configuration

Architecture
MT5ForConditionalGeneration
Vocabulary size
250,112
Stored precision
float32
Model type
mt5

Identity and Version

Repository
nafisehNik/mt5-persian-summary
Publisher
Nikeghbal
Task
Summarization
Modality
Text
Library
transformers
Parameters
Not stated by the source
Languages
fa
Revision
b575560ad967050e77a40f907abb1ebbeefb9a15
First published
2022-08-17
Last updated
2023-11-07

Files and Weights

7 files, 1.2 GB in total. The weights are 1 file totalling 1.2 GB in bin.

Weights1 file · 1.2 GB
Configuration2 files · 972 B
Tokenizer2 files · 4.3 MB
Documentation1 file · 4.8 KB
Repository1 file · 1.3 KB
Every file
FileTypeSizeSHA-256
pytorch_model.binWeights1.2 GB 68308d3bc961
config.jsonConfiguration907 B
special_tokens_map.jsonConfiguration65 B
README.mdDocumentation4.8 KB
.gitattributesRepository1.3 KB
spiece.modelTokenizer4.3 MB ef78f86560d8
tokenizer_config.jsonTokenizer82 B

License and Download

License
mit
Access
Open weights, no gate
Download size
1.2 GB
Download from Nikeghbal

Released by Nikeghbal through its official repository on Hugging Face. Read the license.

Built From

  • Trained on (disclosed) csebuetnlp/xlsum
  • Trained on (disclosed) pn_summary

Memory Requirements

PrecisionWeights in memory
As published1.2 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About mt5-persian-summary

Can I use mt5-persian-summary commercially?

Yes. mt5-persian-summary is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.

Similar Models

Model · Summarization

distilbart-cnn-12-6

Sam Shleifer

This checkpoint should be loaded into BartForConditionalGeneration.frompretrained. See the BART docs for more information.

Open weights apache-2.0 1,024 tokens transformers

Model · Summarization

pegasus-xsum

Google

Original TF 1 code here Authors: Jingqing Zhang, Yao Zhao, Mohammad Saleh and Peter J. Liu on Dec 18, 2019 The following is copied from the authors' README. We train a pegasus model with sampled gap sentence ratios on both C4 and HugeNews, and stochastically sample important sentences. The updated the results are reported in this table. The "Mixed & Stochastic" model has the following changes: - trained on both C4 and HugeNews (dataset mixture is weighted by their number of examples). - trained for 1.5M instead of 500k (we observe slower convergence on pretraining perplexity). - the model uniformly sample a gap sentence ratio between 15% and 45%. - importance sentences are sampled using a…

Open weights 512 tokens transformers

Model · Summarization

distilbart-xsum-12-6

Sam Shleifer

This checkpoint should be loaded into BartForConditionalGeneration.frompretrained. See the BART docs for more information.

Open weights apache-2.0 1,024 tokens transformers

This repository contains the mT5 checkpoint finetuned on the 45 languages of XL-Sum dataset. For finetuning details and scripts, see the paper and the official repository. Scores on the XL-Sum test sets are as follows: Language | ROUGE-1 / ROUGE-2 / ROUGE-L Amharic | 20.0485 / 7.4111 / 18.0753 Arabic | 34.9107 / 14.7937 / 29.1623 Azerbaijani | 21.4227 / 9.5214 / 19.3331 Bengali | 29.5653 / 12.1095 / 25.1315 Burmese | 15.9626 / 5.1477 / 14.1819 Chinese (Simplified) | 39.4071 / 17.7913 / 33.406 Chinese (Traditional) | 37.1866 / 17.1432 / 31.6184 English | 37.601 / 15.1536 / 29.8817 French | 35.3398 / 16.1739 / 28.2041 Gujarati | 21.9619 / 7.7417 / 19.86 Hausa | 39.4375 / 17.6786 / 31.6667…

Open weights transformers