Spaces:
Sleeping
Sleeping
Download app.py from Zainulabedin1/SmartStudyAssistant: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/Zainulabedin1/SmartStudyAssistant/resolve/main/app.py
- Command line
-
hf download hf://spaces/Zainulabedin1/SmartStudyAssistant/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Zainulabedin1/SmartStudyAssistant/resolve/main/app.py
1.09 kB
| 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. | |