import streamlit as st from transformers import pipeline st.title("Text Summarization with Hugging Face") # Choose model and set up pipeline model_name = "t5-base" summarizer = pipeline("summarization", model=model_name) # Get user input text = st.text_area("Enter some text to summarize:") # If user has entered text, summarize it if text: summary = summarizer(text, max_length=100, min_length=30, do_sample=False) st.write("Here is your summary:") st.write(summary[0]["summary_text"])