Downloads · 30 days
5
29% of all-time downloads
AventIQ-AI/T5_keyword_based_summarizer
T5_keyword_based_summarizer 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.
- Model Name: t5-summary-finetuned-kw-fp16 - Base Model: T5-base (t5-base from Hugging Face) - Date: March 19, 2025 - Version: 1.0 - Task: Keyword-Based Text Summarization - Description: A fine-tuned T5-base model qua…
Downloads · 30 days
5
29% of all-time downloads
All-time downloads
17
Public
Parameters
223M
447 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors446 MB · 100%
From the Hugging Face model README
Dataset Name: Custom Keyword-Based Summarization Dataset
Epochs: 2 (stopped early; originally set for 3)
Requirements
Python 3.8+
Libraries: transformers, torch, pandas
GPU with FP16 support (e.g., NVIDIA with ~1.5 GB VRAM free)
from transformers import T5ForConditionalGeneration, T5Tokenizer
# Load model and tokenizer
model = T5ForConditionalGeneration.from_pretrained("./t5_summary_finetuned_final_fp16").to("cuda")
tokenizer = T5Tokenizer.from_pretrained("./t5_summary_finetuned_final_fp16")
# Generate summary
text = "A new laptop was released with a fast processor and sleek design. It’s popular among gamers."
keyword = "processor"
input_text = f"{text} Keyword: {keyword}"
inputs = tokenizer(input_text, max_length=128, truncation=True, padding="max_length", return_tensors="pt").to("cuda")
outputs = model.generate(input_ids=inputs["input_ids"], attention_mask=inputs["attention_mask"].to(torch.float16), max_length=128, num_beams=4, early_stopping=True, no_repeat_ngram_size=2)
summary = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(summary) # Expected: "The new laptop has a fast processor."