|
import streamlit as st |
|
from transformers import pipeline |
|
|
|
|
|
summarizer = pipeline(task="summarization", model="luisotorres/bart-finetuned-samsum") |
|
|
|
|
|
st.title("📝 Text Summarization with BART Model") |
|
|
|
|
|
with st.sidebar: |
|
st.header("Input") |
|
input_text = st.text_area("Enter text for Summarization:") |
|
|
|
|
|
if st.button("Summarize"): |
|
|
|
if input_text: |
|
summary = summarizer(input_text, max_length=1024, min_length=0, do_sample=False) |
|
st.subheader("Summary") |
|
st.write(summary[0]["summary_text"]) |
|
else: |
|
st.warning("Enter text for summarization.") |
|
|