Downloads · 30 days
12
3% of all-time downloads
mansoorhamidzadeh/mt5-title-generation
mt5-title-generation is a text generation model from mansoorhamidzadeh. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
Model Description: This model is a fine-tuned version of mt5-small on a custom Persian dataset for the task of title generation. The model was trained for 4 epochs on a dataset containing 25,000 rows of Persian text,…
Downloads · 30 days
12
3% of all-time downloads
All-time downloads
458
Public
Parameters
300M
1.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.2 GB · 98%
From the Hugging Face model README
Model Description:
This model is a fine-tuned version of mt5-small on a custom Persian dataset for the task of title generation. The model was trained for 4 epochs on a dataset containing 25,000 rows of Persian text, using an NVIDIA P100 GPU. It is designed to generate titles for Persian text, making it useful for applications such as summarizing articles, generating headlines, and creating titles for various text inputs.
Intended Use: The model is intended for generating titles for Persian text. It can be used in applications such as summarizing articles, generating headlines, or creating titles for various text inputs.
Model Architecture:
mt5-smallDataset: The model was fine-tuned on a custom Persian dataset specifically curated for the task of title generation. The dataset includes 25,000 rows of Persian texts along with their corresponding titles.
Data Preprocessing:
Training Configuration:
Training Environment:
You can use this model with the transformers library as follows:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("mansoorhamidzadeh/mt5-title-generation")
model = AutoModelForSeq2SeqLM.from_pretrained("mansoorhamidzadeh/mt5-title-generation")
# Example text in Persian
input_text = "به گزارش ایمنا، در دیدار سوپر جام فوتبال روسیه زنیت سنپترزبورگ قهرمان رقابتهای لیگ و جام حذفی این کشور در حضور عدهای معدود از تماشاگران به دیدار لوکوموتیو مسکو نایب قهرمان لیگ روسیه رفت"
inputs = tokenizer(input_text, return_tensors="pt", max_length=512, truncation=True)
outputs = model.generate(inputs.input_ids, max_length=50, num_beams=5, early_stopping=True)
# Decode the generated title
generated_title = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(generated_title)
# Create a text generation pipeline
title_generation_pipeline = pipeline("text-generation", model="mansoorhamidzadeh/mt5-title-generation")
generated_title = title_generation_pipeline(input_text, max_length=50, num_beams=5, early_stopping=True)
print(generated_title)
@misc{mansoorhamidzadeh,
author = {Mansoor Hamidzadeh},
title = {Title Generation for Persian using Transformers},
year = {2024},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/mansoorhamidzadeh/mt5-title-generation}},
}