taka-yamakoshi commited on
Commit
340640b
1 Parent(s): 4ce3a07
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -74,8 +74,8 @@ def annotate_mask(sent_id,sent):
74
  st.session_state[f'mask_locs_{sent_id}'].append(word_id)
75
  else:
76
  st.session_state[f'mask_locs_{sent_id}'].remove(word_id)
77
- st.markdown(show_annotated_sentence(decoded_sent,
78
- mask_locs=st.session_state[f'mask_locs_{sent_id}']), unsafe_allow_html = True)
79
 
80
  def annotate_options(sent_id,sent):
81
  st.write(f'Sentence {sent_id}')
@@ -92,9 +92,9 @@ def annotate_options(sent_id,sent):
92
  st.session_state[f'option_locs_{sent_id}'].append(word_id)
93
  else:
94
  st.session_state[f'option_locs_{sent_id}'].remove(word_id)
95
- st.markdown(show_annotated_sentence(decoded_sent,
96
- option_locs=st.session_state[f'option_locs_{sent_id}'],
97
- mask_locs=st.session_state[f'mask_locs_{sent_id}']), unsafe_allow_html = True)
98
 
99
  def show_annotated_sentence(sent,option_locs=[],mask_locs=[]):
100
  disp_style = '"font-family:san serif; color:Black; font-size: 20px"'
 
74
  st.session_state[f'mask_locs_{sent_id}'].append(word_id)
75
  else:
76
  st.session_state[f'mask_locs_{sent_id}'].remove(word_id)
77
+ show_annotated_sentence(decoded_sent,
78
+ mask_locs=st.session_state[f'mask_locs_{sent_id}'])
79
 
80
  def annotate_options(sent_id,sent):
81
  st.write(f'Sentence {sent_id}')
 
92
  st.session_state[f'option_locs_{sent_id}'].append(word_id)
93
  else:
94
  st.session_state[f'option_locs_{sent_id}'].remove(word_id)
95
+ show_annotated_sentence(decoded_sent,
96
+ option_locs=st.session_state[f'option_locs_{sent_id}'],
97
+ mask_locs=st.session_state[f'mask_locs_{sent_id}'])
98
 
99
  def show_annotated_sentence(sent,option_locs=[],mask_locs=[]):
100
  disp_style = '"font-family:san serif; color:Black; font-size: 20px"'