ayoubkirouane/news_summary
Viewer • Updated • 4.51k • 7 • 2
How to use ayoubkirouane/T5-4-Summarization with Transformers:
# 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="ayoubkirouane/T5-4-Summarization") # Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("ayoubkirouane/T5-4-Summarization")
model = AutoModelForSeq2SeqLM.from_pretrained("ayoubkirouane/T5-4-Summarization")T5-4-Summarization is a fine-tuned version of the T5 model designed for the task of text summarization. T5 (Text-to-Text Transfer Transformer) is a versatile encoder-decoder model that can handle a wide range of text generation tasks by converting them into a text-to-text format. It has been pre-trained on a variety of tasks, including supervised and self-supervised training.
T5-4-Summarization can be utilized in various natural language processing tasks and applications, including but not limited to:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("summarization", model="ayoubkirouane/T5-4-Summarization")
text = """
put the text you want to summarize here .
"""
pipe(text)[0]["summary_text"]