How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
# Warning: Pipeline type "summarization" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline

pipe = pipeline("summarization", model="unnat17/Text-Summarizer")
# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("unnat17/Text-Summarizer")
model = AutoModelForSeq2SeqLM.from_pretrained("unnat17/Text-Summarizer")
Quick Links

T5 Dialogue Summarizer

A fine-tuned T5-small model for text and dialogue summarization.

Model Details

  • Base model: T5-small
  • Task: Text summarization
  • Framework: PyTorch
  • Tokenizer: T5Tokenizer (max_length: 512)
  • Decoding: Beam search (num_beams=4, max_length=150, early_stopping=True)

Usage

Using Pipeline

from transformers import pipeline

summarizer = pipeline("summarization", model="unnat17/t5-dialogue-summarizer")
result = summarizer("Your text here...")
print(result[0]["summary_text"])

Direct Loading

from transformers import T5ForConditionalGeneration, T5Tokenizer

model = T5ForConditionalGeneration.from_pretrained("unnat17/t5-dialogue-summarizer")
tokenizer = T5Tokenizer.from_pretrained("unnat17/t5-dialogue-summarizer")

input_text = "summarize: " + "Your text here..."
inputs = tokenizer(input_text, return_tensors="pt", max_length=512, truncation=True)
output = model.generate(**inputs, num_beams=4, max_length=150, early_stopping=True)
print(tokenizer.decode(output[0], skip_special_tokens=True))

Web Application

A full-stack web application using this model is available at: github.com/unnat-git/Text-Summarizer

Downloads last month
78
Safetensors
Model size
60.5M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Space using unnat17/Text-Summarizer 1