Spaces:
Paused
Paused
Commit
·
fa32459
1
Parent(s):
173edcf
return thank you message after feedback
Browse files
app.py
CHANGED
|
@@ -166,7 +166,7 @@ def load_df_example(df, event: gr.SelectData):
|
|
| 166 |
return prettify_text(related_chosen)
|
| 167 |
|
| 168 |
def save_results(text):
|
| 169 |
-
return
|
| 170 |
|
| 171 |
def prettify_text(nested_list):
|
| 172 |
string = ''
|
|
@@ -206,10 +206,10 @@ def main():
|
|
| 206 |
with gr.Row() as row:
|
| 207 |
with gr.Column() as col:
|
| 208 |
correct_drg_text = gr.Textbox(visible=False, label="Input Correct DRG", interactive=True)
|
| 209 |
-
correct_drg_text.submit(save_results, inputs=correct_drg_text)
|
| 210 |
with gr.Column() as col:
|
| 211 |
salient_words_box = gr.Textbox(visible=False, label="Input Salient Words (comma separated)", interactive=True)
|
| 212 |
-
salient_words_box.submit(save_results, inputs=salient_words_box)
|
| 213 |
attn_clr_btn = gr.ClearButton(value='Remove DRG Results', visible=False, components=[attn_viz])
|
| 214 |
attn_clr_btn.click(clr_btn, outputs=[attn_clr_btn, correct_drg_text, salient_words_box])
|
| 215 |
|
|
@@ -220,11 +220,11 @@ def main():
|
|
| 220 |
with gr.Row() as row:
|
| 221 |
with gr.Column() as col:
|
| 222 |
correct_drg_text_1 = gr.Textbox(visible=False, label="Input Correct DRG", interactive=True)
|
| 223 |
-
correct_drg_text_1.submit(save_results, inputs=correct_drg_text_1)
|
| 224 |
correct_drg_text_list.append(correct_drg_text_1)
|
| 225 |
with gr.Column() as col:
|
| 226 |
salient_words_box_1 = gr.Textbox(visible=False, label="Input Salient Words (comma separated)", interactive=True)
|
| 227 |
-
salient_words_box_1.submit(save_results, inputs=salient_words_box_1)
|
| 228 |
correct_salient_words_list.append(salient_words_box_1)
|
| 229 |
attn_clr_1 = gr.ClearButton(value='Remove DRG Results', visible=False, components=[attn_1])
|
| 230 |
related_clr_bts.append(attn_clr_1)
|
|
@@ -237,11 +237,11 @@ def main():
|
|
| 237 |
with gr.Row() as row:
|
| 238 |
with gr.Column() as col:
|
| 239 |
correct_drg_text_2 = gr.Textbox(visible=False, label="Input Correct DRG", interactive=True)
|
| 240 |
-
correct_drg_text_2.submit(save_results, inputs=correct_drg_text_2)
|
| 241 |
correct_drg_text_list.append(correct_drg_text_2)
|
| 242 |
with gr.Column() as col:
|
| 243 |
salient_words_box_2 = gr.Textbox(visible=False, label="Input Salient Words (comma separated)", interactive=True)
|
| 244 |
-
salient_words_box_2.submit(save_results, inputs=salient_words_box_2)
|
| 245 |
correct_salient_words_list.append(salient_words_box_2)
|
| 246 |
attn_clr_2 = gr.ClearButton(value='Remove DRG Results', visible=False, components=[attn_2])
|
| 247 |
related_clr_bts.append(attn_clr_2)
|
|
@@ -255,11 +255,11 @@ def main():
|
|
| 255 |
with gr.Row() as row:
|
| 256 |
with gr.Column() as col:
|
| 257 |
correct_drg_text_3 = gr.Textbox(visible=False, label="Input Correct DRG", interactive=True)
|
| 258 |
-
correct_drg_text_3.submit(save_results, inputs=correct_drg_text_3)
|
| 259 |
correct_drg_text_list.append(correct_drg_text_3)
|
| 260 |
with gr.Column() as col:
|
| 261 |
salient_words_box_3 = gr.Textbox(visible=False, label="Input Salient Words (comma separated)", interactive=True)
|
| 262 |
-
salient_words_box_3.submit(save_results, inputs=salient_words_box_3)
|
| 263 |
correct_salient_words_list.append(salient_words_box_3)
|
| 264 |
attn_clr_3 = gr.ClearButton(value='Remove DRG Results', visible=False, components=[attn_3])
|
| 265 |
related_clr_bts.append(attn_clr_3)
|
|
|
|
| 166 |
return prettify_text(related_chosen)
|
| 167 |
|
| 168 |
def save_results(text):
|
| 169 |
+
return gr.Textbox.update(value='Thank you for your input!')
|
| 170 |
|
| 171 |
def prettify_text(nested_list):
|
| 172 |
string = ''
|
|
|
|
| 206 |
with gr.Row() as row:
|
| 207 |
with gr.Column() as col:
|
| 208 |
correct_drg_text = gr.Textbox(visible=False, label="Input Correct DRG", interactive=True)
|
| 209 |
+
correct_drg_text.submit(save_results, inputs=correct_drg_text, outputs=correct_drg_text)
|
| 210 |
with gr.Column() as col:
|
| 211 |
salient_words_box = gr.Textbox(visible=False, label="Input Salient Words (comma separated)", interactive=True)
|
| 212 |
+
salient_words_box.submit(save_results, inputs=salient_words_box, outputs=salient_words_box)
|
| 213 |
attn_clr_btn = gr.ClearButton(value='Remove DRG Results', visible=False, components=[attn_viz])
|
| 214 |
attn_clr_btn.click(clr_btn, outputs=[attn_clr_btn, correct_drg_text, salient_words_box])
|
| 215 |
|
|
|
|
| 220 |
with gr.Row() as row:
|
| 221 |
with gr.Column() as col:
|
| 222 |
correct_drg_text_1 = gr.Textbox(visible=False, label="Input Correct DRG", interactive=True)
|
| 223 |
+
correct_drg_text_1.submit(save_results, inputs=correct_drg_text_1, outputs=correct_drg_text_1)
|
| 224 |
correct_drg_text_list.append(correct_drg_text_1)
|
| 225 |
with gr.Column() as col:
|
| 226 |
salient_words_box_1 = gr.Textbox(visible=False, label="Input Salient Words (comma separated)", interactive=True)
|
| 227 |
+
salient_words_box_1.submit(save_results, inputs=salient_words_box_1, outputs=salient_words_box_1)
|
| 228 |
correct_salient_words_list.append(salient_words_box_1)
|
| 229 |
attn_clr_1 = gr.ClearButton(value='Remove DRG Results', visible=False, components=[attn_1])
|
| 230 |
related_clr_bts.append(attn_clr_1)
|
|
|
|
| 237 |
with gr.Row() as row:
|
| 238 |
with gr.Column() as col:
|
| 239 |
correct_drg_text_2 = gr.Textbox(visible=False, label="Input Correct DRG", interactive=True)
|
| 240 |
+
correct_drg_text_2.submit(save_results, inputs=correct_drg_text_2, outputs=correct_drg_text_2)
|
| 241 |
correct_drg_text_list.append(correct_drg_text_2)
|
| 242 |
with gr.Column() as col:
|
| 243 |
salient_words_box_2 = gr.Textbox(visible=False, label="Input Salient Words (comma separated)", interactive=True)
|
| 244 |
+
salient_words_box_2.submit(save_results, inputs=salient_words_box_2, outputs=salient_words_box_2)
|
| 245 |
correct_salient_words_list.append(salient_words_box_2)
|
| 246 |
attn_clr_2 = gr.ClearButton(value='Remove DRG Results', visible=False, components=[attn_2])
|
| 247 |
related_clr_bts.append(attn_clr_2)
|
|
|
|
| 255 |
with gr.Row() as row:
|
| 256 |
with gr.Column() as col:
|
| 257 |
correct_drg_text_3 = gr.Textbox(visible=False, label="Input Correct DRG", interactive=True)
|
| 258 |
+
correct_drg_text_3.submit(save_results, inputs=correct_drg_text_3, outputs=correct_drg_text_3)
|
| 259 |
correct_drg_text_list.append(correct_drg_text_3)
|
| 260 |
with gr.Column() as col:
|
| 261 |
salient_words_box_3 = gr.Textbox(visible=False, label="Input Salient Words (comma separated)", interactive=True)
|
| 262 |
+
salient_words_box_3.submit(save_results, inputs=salient_words_box_3, outputs=salient_words_box_3)
|
| 263 |
correct_salient_words_list.append(salient_words_box_3)
|
| 264 |
attn_clr_3 = gr.ClearButton(value='Remove DRG Results', visible=False, components=[attn_3])
|
| 265 |
related_clr_bts.append(attn_clr_3)
|