Dragneel / nepali-article-title-generator

huggingface.co
Total runs: 28
24-hour runs: 12
7-day runs: 12
30-day runs: 21
Model's Last Updated: January 24 2025
text-generation

Introduction of nepali-article-title-generator

Model Details of nepali-article-title-generator

Nepali Article Title Generator

This is a fine-tuned MBart model for generating titles (summaries) for Nepali articles. The model was fine-tuned on a Nepali summarization dataset and is designed to generate concise and relevant titles for given Nepali text.

Model Details
  • Model Type : MBart (Multilingual BART)
  • Fine-Tuned For : Nepali Article Title Generation
  • Languages : Nepali ( ne_NP )
  • Model Size : Large
  • Training Dataset : Nepali Summarization Dataset (first 50,000 samples)
  • Fine-Tuning Framework : Hugging Face Transformers
  • Fine-Tuning Epochs : 3
  • Max Input Length : 512 tokens
  • Max Target Length : 128 tokens
How to Use

You can use this model to generate titles for Nepali articles. Below is an example of how to load and use the model.

Installation

First, install the required libraries:

pip install torch transformers
import torch
from transformers import MBartTokenizer, MBartForConditionalGeneration

# Load the fine-tuned model
MODEL_PATH = "Dragneel/nepali-article-title-generator" 
model = MBartForConditionalGeneration.from_pretrained(MODEL_PATH)
tokenizer = MBartTokenizer.from_pretrained(MODEL_PATH)

# Set the source and target language
tokenizer.src_lang = "ne_NP"
tokenizer.tgt_lang = "ne_NP"

# Define the input text
input_text = """
नेपालको पर्यटन उद्योगमा कोरोनाको प्रभावले गर्दा ठूलो मन्दी आएको छ। 
विश्वभर यात्रा प्रतिबन्ध लागू भएपछि नेपाल आउने पर्यटकको संख्या न्यून भएको छ। 
यसले गर्दा होटल, यातायात र अन्य पर्यटन सम्बन्धी व्यवसायमा ठूलो असर परेको छ। 
सरकारले पर्यटन उद्योगलाई बचाउन विभिन्न उपायहरू ल्याएको छ, तर अहिलेसम्म कुनै ठूलो सुधार देखिएको छैन।
"""

# Tokenize the input
inputs = tokenizer(
    input_text,
    return_tensors="pt",
    max_length=512,
    truncation=True,
    padding="max_length"
)

# Generate summary
model.eval()  # Set the model to evaluation mode
with torch.no_grad():
    output_ids = model.generate(
        inputs["input_ids"],
        max_length=128,  # Set the maximum length of the generated text
        num_beams=4,  # Beam search for better quality
        early_stopping=True
    )

# Decode the generated text
summary = tokenizer.decode(output_ids[0], skip_special_tokens=True)
print("Generated Title:", summary)

Runs of Dragneel nepali-article-title-generator on huggingface.co

28
Total runs
12
24-hour runs
12
3-day runs
12
7-day runs
21
30-day runs

More Information About nepali-article-title-generator huggingface.co Model

More nepali-article-title-generator license Visit here:

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

nepali-article-title-generator huggingface.co

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

nepali-article-title-generator huggingface.co Url

https://huggingface.co/Dragneel/nepali-article-title-generator

Dragneel nepali-article-title-generator online free

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

Dragneel nepali-article-title-generator online free url in huggingface.co:

https://huggingface.co/Dragneel/nepali-article-title-generator

nepali-article-title-generator install

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

nepali-article-title-generator install url in huggingface.co:

https://huggingface.co/Dragneel/nepali-article-title-generator

Url of nepali-article-title-generator

nepali-article-title-generator huggingface.co Url

Provider of nepali-article-title-generator huggingface.co

Dragneel
ORGANIZATIONS

Other API from Dragneel