Spaces:
Sleeping
Sleeping
File size: 812 Bytes
b3c8315 4dc5e30 b3c8315 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | import streamlit as st
# Pipeline
from transformers import pipeline
summarizer = pipeline(task="summarization", model="TiffanySMY/Bart_model_for_summarization")
# Title
st.title("📝 Paragraph Summarization Using BART")
# Creating a sidebar for input
st.header("Input")
input_text = st.text_area("Enter a paragraph for summarization.")
# Creating a button to start the summarization
if st.button("Summarize"):
# If the input box isn't empty, process the input and generate a summary
if input_text:
summary = summarizer(input_text, max_length=1024, min_length=0, do_sample=False)
st.subheader("Original Text")
st.write(input_text)
st.subheader("Summary")
st.write(summary[0]["summary_text"])
else:
st.warning("Enter a paragraph for summarization.") |