NikosKprl commited on
Commit
10758e0
·
verified ·
1 Parent(s): ba542de

Update ✨Entity Linking Application✨.py

Browse files
Files changed (1) hide show
  1. ✨Entity Linking Application✨.py +13 -13
✨Entity Linking Application✨.py CHANGED
@@ -285,24 +285,24 @@ async def main(name):
285
  def main_cli():
286
  st.title("✨ Entity Linking Application ✨")
287
  st.caption("This web application is part of my master’s dissertation.")
288
-
289
-
290
- input_sentence_user = st.text_input("Enter a sentence:", "")
291
- input_mention_user = st.text_input("Enter a textural reference (mention) that is inside the sentence:", "")
292
- single = st.selectbox("Search each word individually? (Useful for difficult mentions)", ['Yes', 'No'], index=1)
293
- combi = st.selectbox("Make combinations of each word? (Useful for difficult mentions)", ['Yes', 'No'], index=1)
294
- disambi = st.selectbox("Run acronym disambiguation? (Enable it if the mention include an acronym or if it is nested)", ['Yes', 'No'], index=0)
295
-
 
 
 
 
296
 
297
  if st.button("Run Entity Linking"):
298
  if input_sentence_user and input_mention_user:
299
  # check if the mention is in the sentence
300
  if input_mention_user in input_sentence_user:
301
- st.text_input("Enter a sentence:", value=input_sentence_user, disabled=True)
302
- st.text_input("Enter a textural reference (mention) that is inside the sentence:", value=input_mention_user, disabled=True)
303
- st.selectbox("Search each word individually? (Useful for difficult mentions)", options=['Yes', 'No'], index=['Yes', 'No'].index(single), disabled=True)
304
- st.selectbox("Make combinations of each word? (Useful for difficult mentions)", options=['Yes', 'No'], index=['Yes', 'No'].index(combi), disabled=True)
305
- st.selectbox("Run acronym disambiguation? (Enable it if the mention include an acronym or if it is nested)", options=['Yes', 'No'], index=['Yes', 'No'].index(disambi), disabled=True)
306
  with st.spinner("Applying Data Normalization module... (1/5)"):
307
  # Data Normalization
308
  start_time = time.time()
 
285
  def main_cli():
286
  st.title("✨ Entity Linking Application ✨")
287
  st.caption("This web application is part of my master’s dissertation.")
288
+
289
+ if "Run Entity Linking" not in st.session_state:
290
+ st.session_state.disabled = False
291
+
292
+ def disable_inputs():
293
+ st.session_state.disabled = True
294
+
295
+ input_sentence_user = st.text_input("Enter a sentence:", "", disabled=st.session_state.disabled)
296
+ input_mention_user = st.text_input("Enter a textural reference (mention) that is inside the sentence:", "", disabled=st.session_state.disabled)
297
+ single = st.selectbox("Search each word individually? (Useful for difficult mentions)", ['Yes', 'No'], index=1, disabled=st.session_state.disabled)
298
+ combi = st.selectbox("Make combinations of each word? (Useful for difficult mentions)", ['Yes', 'No'], index=1, disabled=st.session_state.disabled)
299
+ disambi = st.selectbox("Run acronym disambiguation? (Enable it if the mention include an acronym or if it is nested)", ['Yes', 'No'], index=0, disabled=st.session_state.disabled)
300
 
301
  if st.button("Run Entity Linking"):
302
  if input_sentence_user and input_mention_user:
303
  # check if the mention is in the sentence
304
  if input_mention_user in input_sentence_user:
305
+ disable_inputs()
 
 
 
 
306
  with st.spinner("Applying Data Normalization module... (1/5)"):
307
  # Data Normalization
308
  start_time = time.time()