--- library_name: transformers tags: - text-summarization - pegasus - SAMSum - seq2seq license: mit language: - en base_model: - google/pegasus-cnn_dailymail --- # Model Card for mikemayuare/text-summarizer 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. ## Model Details ### Model Description 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. - **Developed by:** Miguelangel Leon - **Funded by:** This is a personal project, not funded. - **Shared by:** Miguelangel Leon - **Model type:** Sequence-to-Sequence (Text Summarization) - **Language(s) (NLP):** English - **License:** [More Information Needed] - **Finetuned from model:** google/pegasus-cnn_dailymail ### Model Sources - **Repository:** [GitHub Repository](https://github.com/mikemayuare/text-summarizer) ## Uses ### Direct Use 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. ### Downstream Use [optional] 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. ### Out-of-Scope Use This model is not optimized for document summarization of long, formal texts like research papers, books, or non-conversational news articles. ## Bias, Risks, and Limitations 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. ### Recommendations 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. ## How to Get Started with the Model Use the code below to get started with the model for text summarization: ```python 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)