Summarization
Transformers
English
code
Summarizer
BART
Gradio
Machine Learning
Natural Language Processing (NLP)
Deep Learning
Interactive Demo
Python
AI
Instructions to use Dannyar608/Text_summarizer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Dannyar608/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="Dannyar608/Text_summarizer")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Dannyar608/Text_summarizer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit History
-
Create README.md
Verified signatureThe code provided sets up a simple web-based interface for summarizing text using the facebook/bart-large-cnn model. It first installs the necessary Python libraries: transformers for using pre-trained models, and gradio for creating interactive demos. The pipeline function from transformers is then used to load the pre-trained BART model for summarization, which is specifically fine-tuned on the CNN/Daily Mail dataset for generating abstractive summaries. The function summarize_text takes an input text and uses the summarization pipeline to produce a summary, with the length of the summary constrained between 100 and 200 tokens. The do_sample=False parameter ensures deterministic results, meaning the summary is consistent with each run. Finally, a Gradio interface is created with an input textbox for users to enter their text and an output textbox to display the generated summary. The interface also includes a title and description to guide the user. When the user submits text, the mo…a82f821 -
Create Code
Verified signature414fbb0 -
initial commit
Verified signature9703448