Downloads · 30 days
11
1% of all-time downloads
mikemayuare/text-summarizer
text-summarizer is a machine learning model from mikemayuare. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
This model is fine-tuned on the SAMSum dataset and is designed for text summarization tasks. It is built on top of the google/pegasus-cnndailymail base model. The model is intended for sequence-to-sequence summarizati…
Downloads · 30 days
11
1% of all-time downloads
All-time downloads
1.2K
Public
Parameters
571M
2.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.3 GB · 100%
From the Hugging Face model README
This model is fine-tuned on the SAMSum dataset and is designed for text summarization tasks. It is built on top of the google/pegasus-cnn_dailymail base model. The model is intended for sequence-to-sequence summarization tasks and should be loaded with the AutoModelForSeq2SeqLM class from the Hugging Face Transformers library.
This is a 🤗 transformers model fine-tuned on the SAMSum dataset. The base model is google/pegasus-cnn_dailymail, which is optimized for summarizing CNN and Daily Mail articles. The SAMSum dataset consists of conversations, making this model especially suited for summarizing dialogue or chat-based data.
This model is designed to summarize dialogues or conversational text. It works well for summarizing conversations into concise summaries, as provided in the SAMSum dataset.
This model can be fine-tuned further for other types of text summarization tasks, such as summarizing customer support chats or informal conversations in other contexts.
This model is not optimized for document summarization of long, formal texts like research papers, books, or non-conversational news articles.
As the model is fine-tuned on conversational data from the SAMSum dataset, it may not generalize well to all kinds of conversations, particularly those outside the training distribution. The SAMSum dataset is focused on English-language conversations, so the model's performance may degrade when applied to non-English conversations.
Users should be cautious when using the model for non-dialogue or non-conversational texts, as the model may produce inaccurate summaries. It is recommended to evaluate the model on your specific dataset before deploying it in production.
Use the code below to get started with the model for text summarization:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("mikemayuare/text-summarizer")
model = AutoModelForSeq2SeqLM.from_pretrained("mikemayuare/text-summarizer")
# Sample input
text = "Your conversational input text goes here."
# Tokenize and generate a summary
inputs = tokenizer(text, return_tensors="pt", truncation=True)
summary_ids = model.generate(inputs['input_ids'], max_length=150, min_length=40, length_penalty=2.0, num_beams=4, early_stopping=True)
# Decode the summary
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print(summary)