import streamlit as st from transformers import pipeline # Initialize the summarization pipeline summarizer = pipeline("summarization") # App title and description st.title("Summarization App") st.write(""" Welcome to the Summarization App! This tool helps you summarize your study materials or chapters quickly and efficiently. Simply paste the content you want to summarize in the text box below. """) # Text input area for the study material study_material = st.text_area("Enter your study material or chapter here:") # Button to generate summary if st.button("Generate Summary"): if study_material: with st.spinner("Summarizing..."): # Perform summarization using Hugging Face's transformer model summary = summarizer(study_material, max_length=1000, min_length=50, do_sample=False) st.subheader("Summary:") st.write(summary[0]['summary_text']) else: st.warning("Please enter some study material to summarize.") # Optionally, you can add more features or display additional information as needed.