Spaces:
Runtime error
Runtime error
taka-yamakoshi
commited on
Commit
·
1f8519e
1
Parent(s):
51362de
fontsize
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ def clear_data():
|
|
58 |
del st.session_state[key]
|
59 |
|
60 |
def annotate_mask(sent_id,sent):
|
61 |
-
show_instruction(f'Sentence {sent_id}',fontsize=
|
62 |
input_sent = tokenizer(sent).input_ids
|
63 |
decoded_sent = [tokenizer.decode([token]) for token in input_sent[1:-1]]
|
64 |
st.session_state[f'decoded_sent_{sent_id}'] = decoded_sent
|
@@ -77,7 +77,7 @@ def annotate_mask(sent_id,sent):
|
|
77 |
mask_locs=st.session_state[f'mask_locs_{sent_id}'])
|
78 |
|
79 |
def annotate_options(sent_id,sent):
|
80 |
-
show_instruction(f'Sentence {sent_id}',fontsize=
|
81 |
input_sent = tokenizer(sent).input_ids
|
82 |
decoded_sent = [tokenizer.decode([token]) for token in input_sent[1:-1]]
|
83 |
char_nums = [len(word)+2 for word in decoded_sent]
|
@@ -203,7 +203,7 @@ if __name__=='__main__':
|
|
203 |
sent_1 = st.session_state['sent_1']
|
204 |
sent_2 = st.session_state['sent_2']
|
205 |
|
206 |
-
show_instruction('3. Select options and click "Confirm"')
|
207 |
show_instruction('------------------------------',fontsize=32)
|
208 |
annotate_options(1,sent_1)
|
209 |
show_instruction('------------------------------',fontsize=32)
|
@@ -262,7 +262,7 @@ if __name__=='__main__':
|
|
262 |
index=['Sentence 1','Sentence 2'])
|
263 |
cols = st.columns(3)
|
264 |
with cols[1]:
|
265 |
-
show_instruction('
|
266 |
st.dataframe(df.style.highlight_max(axis=1),use_container_width=True)
|
267 |
|
268 |
compare_1 = np.array(masked_ids_option_1['sent_1'])!=np.array(masked_ids_option_1['sent_2'])
|
|
|
58 |
del st.session_state[key]
|
59 |
|
60 |
def annotate_mask(sent_id,sent):
|
61 |
+
show_instruction(f'Sentence {sent_id}',fontsize=16)
|
62 |
input_sent = tokenizer(sent).input_ids
|
63 |
decoded_sent = [tokenizer.decode([token]) for token in input_sent[1:-1]]
|
64 |
st.session_state[f'decoded_sent_{sent_id}'] = decoded_sent
|
|
|
77 |
mask_locs=st.session_state[f'mask_locs_{sent_id}'])
|
78 |
|
79 |
def annotate_options(sent_id,sent):
|
80 |
+
show_instruction(f'Sentence {sent_id}',fontsize=16)
|
81 |
input_sent = tokenizer(sent).input_ids
|
82 |
decoded_sent = [tokenizer.decode([token]) for token in input_sent[1:-1]]
|
83 |
char_nums = [len(word)+2 for word in decoded_sent]
|
|
|
203 |
sent_1 = st.session_state['sent_1']
|
204 |
sent_2 = st.session_state['sent_2']
|
205 |
|
206 |
+
show_instruction('3. Select options and click "Confirm"',fontsize=16)
|
207 |
show_instruction('------------------------------',fontsize=32)
|
208 |
annotate_options(1,sent_1)
|
209 |
show_instruction('------------------------------',fontsize=32)
|
|
|
262 |
index=['Sentence 1','Sentence 2'])
|
263 |
cols = st.columns(3)
|
264 |
with cols[1]:
|
265 |
+
show_instruction('Probability of predicting each option in each sentence',fontsize=12)
|
266 |
st.dataframe(df.style.highlight_max(axis=1),use_container_width=True)
|
267 |
|
268 |
compare_1 = np.array(masked_ids_option_1['sent_1'])!=np.array(masked_ids_option_1['sent_2'])
|