Summarization
Transformers
Safetensors
PyTorch
English
t5
text2text-generation
t5-small
text-summarization
text-generation-inference
Instructions to use unnat17/Text-Summarizer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unnat17/Text-Summarizer 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="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") - Notebooks
- Google Colab
- Kaggle
| language: en | |
| license: mit | |
| tags: | |
| - t5 | |
| - t5-small | |
| - summarization | |
| - text-summarization | |
| - pytorch | |
| - transformers | |
| pipeline_tag: summarization | |
| library_name: transformers | |
| # 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 | |
| ```python | |
| from transformers import pipeline | |
| summarizer = pipeline("summarization", model="unnat17/t5-dialogue-summarizer") | |
| result = summarizer("Your text here...") | |
| print(result[0]["summary_text"]) | |
| ``` | |
| ### Direct Loading | |
| ```python | |
| 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](https://github.com/unnat-git/Text-Summarizer) | |