Spaces:
Sleeping
Sleeping
File size: 561 Bytes
f7f73d5 c34b9cf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import torch
import streamlit as st
from transformers import pipeline
# Initialize the summarization pipeline
summarizer = pipeline("summarization")
st.title("Text Summarization Tool")
st.write("Enter the text you want to summarize below:")
# Text input
text = st.text_area("Text Input", "")
if st.button("Summarize"):
if text:
summary = summarizer(text, max_length=150, min_length=30, do_sample=False)
st.write("Summary:")
st.write(summary[0]['summary_text'])
else:
st.write("Please enter some text to summarize.")
|