Gladiator commited on
Commit
f10368a
β€’
1 Parent(s): 8d3b04a

added button to toggle summarize

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -6,17 +6,17 @@ if __name__ == "__main__":
6
  import sys
7
  sys.path.append("../extractive_summarizer")
8
  st.title("Text Summarizer πŸ“")
9
- st.write("This is a test statement")
10
 
11
  inp_text = st.text_input("Enter the text here")
12
- summarize_type = st.sidebar.selectbox("Summarization type", options=["Extractive", "Abstractive"])
13
 
14
  if summarize_type == "Extractive":
15
  from extractive_summarizer.model_processors import Summarizer
16
 
17
  # init model
18
  model = Summarizer()
19
- summarized_text = model(inp_text, num_sentences=5)
20
-
21
- st.subheader("Summarized text")
22
- st.markdown(summarized_text)
 
 
6
  import sys
7
  sys.path.append("../extractive_summarizer")
8
  st.title("Text Summarizer πŸ“")
9
+ summarize_type = st.sidebar.selectbox("Summarization type", options=["Extractive", "Abstractive"])
10
 
11
  inp_text = st.text_input("Enter the text here")
 
12
 
13
  if summarize_type == "Extractive":
14
  from extractive_summarizer.model_processors import Summarizer
15
 
16
  # init model
17
  model = Summarizer()
18
+ summarize = st.button("Summarize")
19
+ if summarize:
20
+ st.subheader("Summarized text")
21
+ summarized_text = model(inp_text, num_sentences=5)
22
+ st.info(summarized_text)