Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import base64 | |
| from model import Model | |
| st.sidebar.title('Text Summarizer!!') | |
| # st.sidebar.write('Created by Sabir Bagwan') | |
| st.sidebar.write('Created by <strong><em>SABIR BAGWAN</em></strong>', unsafe_allow_html=True) | |
| # Display social media links in sidebar | |
| st.sidebar.markdown("[Twitter](https://twitter.com/sabirbagwan_), \ | |
| [LinkedIn](https://www.linkedin.com/in/sabirbagwan/), \ | |
| [GitHub](https://github.com/sabirbagwan), \ | |
| [Kaggle](https://kaggle.com/sabirbagwan)") | |
| st.sidebar.header("Disclaimer:") | |
| st.sidebar.write("This Streamlit application has been created solely for academic and learning purposes. \ | |
| The results and insights provided by the application should not be taken as accurate or definitive. \ | |
| The creator of this application is not responsible for any actions taken based on the information provided by the application.") | |
| # st.markdown('<h2 style="text-align: center;">Text Summarizer</h2>', unsafe_allow_html=True) | |
| st.markdown("The text summarization app efficiently condenses lengthy documents into concise summaries using advanced natural language processing algorithms. It saves time and enhances productivity by providing users with key information and main ideas without the need to read through the entire text.") | |
| with st.form(key="clf_form"): | |
| text_input = st.text_area("Type Here:") | |
| submit_btn = st.form_submit_button(label="Submit") | |
| count_of_words = len(text_input.split()) | |
| if submit_btn: | |
| if text_input == "": | |
| st.error("Enter something in order to summarize it.") | |
| elif count_of_words <= 100: | |
| st.warning("Please enter more than 100 words in order to summarize it.", icon="⚠️") | |
| else: | |
| st.subheader("Output:") | |
| col1 = st.expander("Summarized Text") | |
| output = Model.predict(text=text_input) | |
| with col1: | |
| st.info("Summarized Text:") | |
| st.write(output) | |