File size: 2,047 Bytes
66d7b2f
 
 
 
dfd4a96
22d1738
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dfd4a96
66d7b2f
5aea78e
 
66d7b2f
 
 
 
 
 
 
 
22d1738
66d7b2f
 
 
 
 
844e867
 
66d7b2f
844e867
66d7b2f
 
 
844e867
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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)