yassTrad commited on
Commit
75c9590
1 Parent(s): c5fb2b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -43,7 +43,7 @@ def model():
43
 
44
  #Streamlit App
45
 
46
- st.title("Article Extractive Summarizer")
47
 
48
  summary_type = st.sidebar.selectbox("Summary type", options=["Abstractive", "Extractive"])
49
 
@@ -79,10 +79,10 @@ summarize = st.button("Summarize")
79
  if summarize:
80
  text_to_summarize = clean_text if is_url else plain_text
81
 
82
- with st.spinner(text="Loading Model and Extracting summary. This might take a few seconds depending on the length of your text..."):
83
  model = model()
84
  #summarized_text = text_to_summarize if len(text_to_summarize) > 60 else ''.join(model(body, min_length=60))
85
- summarized_text = ''.join(model(text_to_summarize, min_length=60))
86
 
87
  st.subheader("Original text")
88
  st.write(text_to_summarize)
 
43
 
44
  #Streamlit App
45
 
46
+ st.title("Article Summarizer")
47
 
48
  summary_type = st.sidebar.selectbox("Summary type", options=["Abstractive", "Extractive"])
49
 
 
79
  if summarize:
80
  text_to_summarize = clean_text if is_url else plain_text
81
 
82
+ with st.spinner(text="Loading Model and creating summary. This might take a few seconds depending on the length of your text..."):
83
  model = model()
84
  #summarized_text = text_to_summarize if len(text_to_summarize) > 60 else ''.join(model(body, min_length=60))
85
+ summarized_text = ''.join(model(text_to_summarize, min_length=60)) if summary_type == "Extractive" else summarizer(text_to_summarize, max_length=200, min_length=60)['summary_text']
86
 
87
  st.subheader("Original text")
88
  st.write(text_to_summarize)