This checkpoint should be loaded into BartForConditionalGeneration.frompretrained. See the BART docs for more information.
Search public pages, research tools, and SAVRN solutions.
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.
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.
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.
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)
If you find this model useful, make a link to the huggingface model.
7 files, 1.2 GB in total. The weights are 1 file totalling 1.2 GB in bin.
| File | Type | Size | SHA-256 |
|---|---|---|---|
| pytorch_model.bin | Weights | 1.2 GB | 68308d3bc961 |
| config.json | Configuration | 907 B | — |
| special_tokens_map.json | Configuration | 65 B | — |
| README.md | Documentation | 4.8 KB | — |
| .gitattributes | Repository | 1.3 KB | — |
| spiece.model | Tokenizer | 4.3 MB | ef78f86560d8 |
| tokenizer_config.json | Tokenizer | 82 B | — |
Released by Nikeghbal through its official repository on Hugging Face. Read the license.
| Precision | Weights in memory |
|---|---|
| As published | 1.2 GB |
Weights only, from the published parameter count; the key-value cache and runtime add to this.
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.
This checkpoint should be loaded into BartForConditionalGeneration.frompretrained. See the BART docs for more information.
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…
This model was trained using Amazon SageMaker and the new Hugging Face Deep Learning container.
This checkpoint should be loaded into BartForConditionalGeneration.frompretrained. See the BART docs for more information.
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…