File size: 1,086 Bytes
4c3f4aa
 
 
47ac32c
 
4c3f4aa
47ac32c
 
 
 
 
4c3f4aa
47ac32c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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.