Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,8 +8,8 @@ from nltk.tokenize import sent_tokenize
|
|
| 8 |
|
| 9 |
|
| 10 |
#container_main = st.container()
|
| 11 |
-
|
| 12 |
-
|
| 13 |
|
| 14 |
def textrank(corpus, ratio=0.2):
|
| 15 |
if type(corpus) is str:
|
|
@@ -32,7 +32,9 @@ def start_summarize(long_text, model):
|
|
| 32 |
summary = inf_learn.blurr_generate([long_text])[0]['generated_texts']
|
| 33 |
else:
|
| 34 |
summary = long_text
|
| 35 |
-
|
|
|
|
|
|
|
| 36 |
#end start_summarize
|
| 37 |
|
| 38 |
st.title ("Text Summarization")
|
|
@@ -42,11 +44,11 @@ start = st.button('Summarize', on_click=start_summarize, args=(user_text, model_
|
|
| 42 |
# increment = st.button('Increment', on_click=increment_counter,
|
| 43 |
# args=(increment_value, ))
|
| 44 |
|
| 45 |
-
|
| 46 |
-
|
| 47 |
# st.success(summary)
|
| 48 |
# time.sleep(10)
|
| 49 |
-
#
|
| 50 |
|
| 51 |
with st.spinner('Please wait...'):
|
| 52 |
time.sleep(10)
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
#container_main = st.container()
|
| 11 |
+
container_summarization = st.container()
|
| 12 |
+
|
| 13 |
|
| 14 |
def textrank(corpus, ratio=0.2):
|
| 15 |
if type(corpus) is str:
|
|
|
|
| 32 |
summary = inf_learn.blurr_generate([long_text])[0]['generated_texts']
|
| 33 |
else:
|
| 34 |
summary = long_text
|
| 35 |
+
container_summarization.markdown(summary)
|
| 36 |
+
container_summarization.select_slider('What do you think about the summary?', options=['Bad', 'Good', 'Excellent'], value=('Good'))
|
| 37 |
+
|
| 38 |
#end start_summarize
|
| 39 |
|
| 40 |
st.title ("Text Summarization")
|
|
|
|
| 44 |
# increment = st.button('Increment', on_click=increment_counter,
|
| 45 |
# args=(increment_value, ))
|
| 46 |
|
| 47 |
+
if start:
|
| 48 |
+
container_summarization.markdown("Summary")
|
| 49 |
# st.success(summary)
|
| 50 |
# time.sleep(10)
|
| 51 |
+
# container_summarization.select_slider('What do you think about the summary?', options=['Bad', 'Good', 'Excellent'], value=('Good'))
|
| 52 |
|
| 53 |
with st.spinner('Please wait...'):
|
| 54 |
time.sleep(10)
|