File size: 791 Bytes
cf53b75
 
 
 
f39343a
 
 
 
f10368a
f39343a
 
 
 
5af0584
f39343a
 
 
f10368a
 
7b5bdb7
 
f10368a
 
 
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
import streamlit as st


if __name__ == "__main__":
    # adding modules to path
    import sys
    sys.path.append("../extractive_summarizer")
    st.title("Text Summarizer πŸ“")
    summarize_type = st.sidebar.selectbox("Summarization type", options=["Extractive", "Abstractive"])

    inp_text = st.text_input("Enter the text here")

    if summarize_type == "Extractive":
        from extractive_summarizer.model_processors import Summarizer

        # init model
        model = Summarizer()
        summarize = st.button("Summarize")
        if summarize:
            with st.expander("View input text"):
                st.write(inp_text)
            st.subheader("Summarized text")
            summarized_text = model(inp_text, num_sentences=5)
            st.info(summarized_text)