Nepali Text Summarizer
Fine-tuned mBART-large-50 with LoRA adapters for abstractive summarization of Nepali text.
How to use
You can load the model and tokenizer directly from the Hugging Face Hub using the transformers library:
from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
repo_id = "Suprishma/mbart-lora-nepali"
tokenizer = MBart50TokenizerFast.from_pretrained(repo_id)
model = MBartForConditionalGeneration.from_pretrained(repo_id)
# Example of how to perform summarization:
# nepali_text_to_summarize = "... your Nepali text ..."
# tokenizer.src_lang = "ne_NP"
# inputs = tokenizer(nepali_text_to_summarize, return_tensors="pt", max_length=1024, truncation=True)
# summary_ids = model.generate(
# inputs["input_ids"],
# num_beams=5,
# max_length=150,
# min_length=30,
# early_stopping=True,
# no_repeat_ngram_size=3,
# forced_bos_token_id=tokenizer.lang_code_to_id["ne_NP"]
# )
# summary_text = tokenizer.decode(summary_ids[0], skip_special_tokens=True, clean_up_tokenization_spaces=False)
# print(summary_text)
- Downloads last month
- 11
Model tree for Suprishma/mbart-lora-nepali
Base model
facebook/mbart-large-50