lilingxi01 commited on
Commit
b4f5518
·
1 Parent(s): 154ca7b

[UI] Optimize the informations in result box.

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import streamlit as st
 
2
 
3
  from modules.prediction import prepare, predict
4
 
@@ -26,10 +27,10 @@ with livedemo_col1:
26
  st.subheader('Live Demo')
27
 
28
  with st.form("my_form"):
29
- entity = st.text_input('Entity Name', 'Jimmy')
30
- sentence = st.text_input('Text Input', 'Hey Jimmy.',
31
  help='The classifier is going to analyze this sentence.')
32
- if st.form_submit_button('Submit it'):
33
  st.session_state['running_status'] = STATUS_SUBMIT
34
 
35
  if st.session_state['running_status'] == STATUS_STOPPED:
@@ -39,6 +40,7 @@ with livedemo_col1:
39
  st.success('It is a **calling**!')
40
  else:
41
  st.success('It is a **mentioning**!')
 
42
 
43
  with livedemo_col2:
44
  st.empty()
 
1
  import streamlit as st
2
+ from datetime import datetime
3
 
4
  from modules.prediction import prepare, predict
5
 
 
27
  st.subheader('Live Demo')
28
 
29
  with st.form("my_form"):
30
+ entity = st.text_input('Entity Name:', 'Jimmy')
31
+ sentence = st.text_input('Sentence Input:', 'Are you feeling good, Jimmy?',
32
  help='The classifier is going to analyze this sentence.')
33
+ if st.form_submit_button('🚀 Submit'):
34
  st.session_state['running_status'] = STATUS_SUBMIT
35
 
36
  if st.session_state['running_status'] == STATUS_STOPPED:
 
40
  st.success('It is a **calling**!')
41
  else:
42
  st.success('It is a **mentioning**!')
43
+ st.caption(f'Submitted: `{sentence.lower()}` by `{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}`')
44
 
45
  with livedemo_col2:
46
  st.empty()