Downloads · 30 days
6
26% of all-time downloads
AventIQ-AI/t5-news-title-creation
t5-news-title-creation is a machine learning model from AventIQ-AI. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a T5-Small model fine-tuned for generating concise and informative news titles from article summaries. It is useful for news agencies, content creators, and media professionals to generate titles efficiently.
Downloads · 30 days
6
26% of all-time downloads
All-time downloads
23
Public
Parameters
60.5M
147 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors146 MB · 99%
How the weights are stored.
F1647.9M · 79%
From the Hugging Face model README
This is a T5-Small model fine-tuned for generating concise and informative news titles from article summaries. It is useful for news agencies, content creators, and media professionals to generate titles efficiently.
Model Type: Sequence-to-Sequence Transformer
Base Model: t5-small
Maximum Sequence Length: 128 tokens (input and output)
Output: News titles based on input summaries
Task: Title Creation
Documentation: T5 Model Documentation
Repository: Hugging Face Model Hub
Hugging Face Model: Available on Hugging Face
T5ForConditionalGeneration(
(shared): Embedding(32128, 512)
(encoder): T5Stack(
(embed_tokens): Embedding(32128, 512)
(block): ModuleList(...)
(final_layer_norm): LayerNorm((512,), eps=1e-12)
(dropout): Dropout(p=0.1)
)
(decoder): T5Stack(
(embed_tokens): Embedding(32128, 512)
(block): ModuleList(...)
(final_layer_norm): LayerNorm((512,), eps=1e-12)
(dropout): Dropout(p=0.1)
)
(lm_head): Linear(in_features=512, out_features=32128, bias=False)
)
pip install -U transformers torch datasets
from transformers import T5ForConditionalGeneration, T5Tokenizer
import torch
# Model Name
model_name = "your_fine_tuned_model_id"
tokenizer = T5Tokenizer.from_pretrained(model_name)
model = T5ForConditionalGeneration.from_pretrained(model_name)
# Move model to GPU if available
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)
# Inference
news_summary = "Ministry of Education has announced a major reform in the national curriculum to enhance digital literacy among students."
inputs = tokenizer(news_summary, max_length=128, truncation=True, padding="max_length", return_tensors="pt").to(device)
outputs = model.generate(
input_ids=inputs["input_ids"],
attention_mask=inputs["attention_mask"],
max_length=20,
num_beams=5,
early_stopping=True
)
headline = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(f"Generated Title: {headline}")
Dataset Name: News Titles Dataset
Size: 30,000 rows
Columns: article_summary (input), title (output)
article_summary:
Type: string
Min length: ~20 tokens
Mean length: ~50-60 tokens (estimated)
Max length: ~128 tokens
title:
Type: string
Min length: ~5 tokens
Mean length: ~10-15 tokens
Max length: ~20 tokens