Spaces:
Runtime error
Runtime error
Commit
·
d930cf3
1
Parent(s):
84f87ff
update time greneration feature
Browse files
app.py
CHANGED
@@ -35,11 +35,16 @@ whole_text = st.text_input("Enter the text Here: ")
|
|
35 |
|
36 |
try:
|
37 |
if st.button('Suggest topic'):
|
38 |
-
start
|
39 |
with st.spinner("Scanning content to suggest topics"):
|
40 |
topic_classifier = st.session_state.topic_model
|
41 |
predicted_topic = suggest_topic(topic_classifier,whole_text)
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
43 |
st.subheader('Top 10 Topics related to the content')
|
44 |
for i in predicted_topic[:10]:
|
45 |
st.write(i)
|
|
|
35 |
|
36 |
try:
|
37 |
if st.button('Suggest topic'):
|
38 |
+
start= time.time()
|
39 |
with st.spinner("Scanning content to suggest topics"):
|
40 |
topic_classifier = st.session_state.topic_model
|
41 |
predicted_topic = suggest_topic(topic_classifier,whole_text)
|
42 |
+
clk = time.time()-start
|
43 |
+
if clk> 60:
|
44 |
+
st.write(f'Generated in {(time.time()-start)} secs')
|
45 |
+
else
|
46 |
+
st.write(f'Generated in {(clk)/60} minutes')
|
47 |
+
|
48 |
st.subheader('Top 10 Topics related to the content')
|
49 |
for i in predicted_topic[:10]:
|
50 |
st.write(i)
|