Moran commited on
Commit
6fc2b4c
·
1 Parent(s): de7955a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -18
app.py CHANGED
@@ -31,34 +31,25 @@ def start_summarize(long_text, model):
31
  # summary = "It works!"
32
  inf_learn = from_pretrained_fastai(repo_id)
33
  summary = inf_learn.blurr_generate([long_text][0]['generated_texts']
34
-
35
  else:
36
  summary = long_text
37
- st.markdown("Summary")
38
- st.success(summary)
39
- time.sleep(10)
40
- grade = st.select_slider('What do you think about the summary?', options=['Bad', 'Good', 'Excellent'], value=('Good'))
41
- #end strat_summarize
42
-
43
-
44
- summary = ""
45
- st.caption(" © Aviv Lazar & Moran Shemesh")
46
 
47
  with st.spinner('Please wait...'):
48
  time.sleep(10)
49
-
50
  st.title ("Text Summarization")
51
  model_type = st.radio('Pick a model',['RankText', 'Bart'])
52
- user_text = st.text_area('Enter or paste text to summarize')
53
-
54
-
55
-
56
-
57
  st.button('Summarize', on_click=start_summarize, args=(user_text, model_type, ) )
58
  # increment = st.button('Increment', on_click=increment_counter,
59
  # args=(increment_value, ))
60
-
61
-
62
 
63
 
64
  # summary = inf_learn.blurr_summarize(text)
 
31
  # summary = "It works!"
32
  inf_learn = from_pretrained_fastai(repo_id)
33
  summary = inf_learn.blurr_generate([long_text][0]['generated_texts']
 
34
  else:
35
  summary = long_text
36
+ if summary!="":
37
+ st.markdown("Summary")
38
+ st.success(summary)
39
+ time.sleep(10)
40
+ st.select_slider('What do you think about the summary?', options=['Bad', 'Good', 'Excellent'], value=('Good'))
41
+ #end start_summarize
 
 
 
42
 
43
  with st.spinner('Please wait...'):
44
  time.sleep(10)
45
+ summary = ""
46
  st.title ("Text Summarization")
47
  model_type = st.radio('Pick a model',['RankText', 'Bart'])
48
+ user_text = st.text_area('Enter or paste text to summarize')
 
 
 
 
49
  st.button('Summarize', on_click=start_summarize, args=(user_text, model_type, ) )
50
  # increment = st.button('Increment', on_click=increment_counter,
51
  # args=(increment_value, ))
52
+ st.caption(" © Aviv Lazar & Moran Shemesh")
 
53
 
54
 
55
  # summary = inf_learn.blurr_summarize(text)