Spaces:
Build error
Build error
File size: 543 Bytes
9b7b0e5 023384b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import streamlit as st
from summarize import load_text, summarize_text
# Streamlit app
st.title("Text Summarizer")
# User input for URL
url = st.text_input("Enter the URL of the article or blog post:")
if st.button("Summarize"):
if url:
text = load_text(url)
if text:
summary = summarize_text(text)
st.subheader("Summary:")
st.write(summary["output_text"])
else:
st.error("Failed to load text from the URL.")
else:
st.error("Please enter a valid URL.") |