Wootang01 commited on
Commit
0b51283
1 Parent(s): a28b188

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -39,11 +39,11 @@ elif model_checkpoint == "xlm-roberta-large":
39
 
40
  st.subheader("Select Text Input Method")
41
  input_method = st.radio("", ('Select from examples', 'Write or paste text'))
42
- if input_method == 'Select from Examples':
43
  selected_text = st.selectbox('Select example from list', example_list, index=0, key=1)
44
  st.subheader("Text to Run")
45
  input_text = st.text_area("Selected example", selected_text, height=128, max_chars=None, key=2)
46
- elif input_method == "Write or Paste New Text":
47
  st.subheader("Text Input")
48
  input_text = st.text_area('Write or paste text below', value="", height=128, max_chars=None, key=2)
49
 
@@ -59,7 +59,7 @@ def get_html(html: str):
59
  html = html.replace("\n", " ")
60
  return WRAPPER.format(html)
61
 
62
- Run_Button = st.button("Submit", key=None)
63
  if Run_Button == True:
64
 
65
  ner_pipeline = setModel(model_checkpoint, aggregation)
@@ -72,7 +72,7 @@ if Run_Button == True:
72
  cols_to_keep = ['word','entity','score','start','end']
73
  df_final = df[cols_to_keep]
74
 
75
- st.subheader("Recognized Entities")
76
  st.dataframe(df_final)
77
 
78
  st.subheader("Spacy Style Display")
 
39
 
40
  st.subheader("Select Text Input Method")
41
  input_method = st.radio("", ('Select from examples', 'Write or paste text'))
42
+ if input_method == 'Select from examples':
43
  selected_text = st.selectbox('Select example from list', example_list, index=0, key=1)
44
  st.subheader("Text to Run")
45
  input_text = st.text_area("Selected example", selected_text, height=128, max_chars=None, key=2)
46
+ elif input_method == "Write or paste text":
47
  st.subheader("Text Input")
48
  input_text = st.text_area('Write or paste text below', value="", height=128, max_chars=None, key=2)
49
 
 
59
  html = html.replace("\n", " ")
60
  return WRAPPER.format(html)
61
 
62
+ Run_Button = st.button("Run", key=None)
63
  if Run_Button == True:
64
 
65
  ner_pipeline = setModel(model_checkpoint, aggregation)
 
72
  cols_to_keep = ['word','entity','score','start','end']
73
  df_final = df[cols_to_keep]
74
 
75
+ st.subheader("Recognized Nouns")
76
  st.dataframe(df_final)
77
 
78
  st.subheader("Spacy Style Display")