danielhajialigol commited on
Commit
b3e501a
1 Parent(s): 94c41db

changing layout

Browse files
Files changed (1) hide show
  1. app.py +16 -24
app.py CHANGED
@@ -125,15 +125,6 @@ def load_example(example_id):
125
  return prettify_text(related_chosen)
126
  # return related_chosen
127
 
128
- def generate_similar_summeries():
129
- if random.random() > 0.5:
130
- return [[ex1], [ex3]]
131
- else:
132
- return [[ex2], [ex4]]
133
-
134
- def remove_info(c1, c2):
135
- return gr.ClearButton.update(visible=False)
136
-
137
  def prettify_text(nested_list):
138
  idx = 1
139
  string = ''
@@ -159,16 +150,16 @@ def main():
159
  This interface outlines DRGCoder, an explainable clinical coding for the early prediction of diagnostic-related groups (DRGs). Please note all summaries will be truncated to 512 words if longer.
160
  """)
161
  with gr.Row() as row:
162
- with gr.Column(scale=2) as col:
163
- input = gr.Textbox(label="Input Discharge Summary Here", placeholder='sample discharge summary')
164
- btn = gr.Button(value="Submit")
165
- with gr.Column(scale=3) as col:
166
- gr.Examples(examples, [input])
167
  with gr.Row() as row:
168
- with gr.Column() as col:
169
- attn_viz = gr.HTML()
170
- attn_clr_btn = gr.ClearButton(value='Remove output', visible=False, components=[attn_viz])
171
- attn_clr_btn.click(clr_btn, outputs=[attn_clr_btn])
 
 
 
 
172
 
173
  # related row 1
174
  with gr.Row() as row:
@@ -199,12 +190,13 @@ def main():
199
 
200
  # input to related summaries
201
  with gr.Row() as row:
202
- with gr.Column(scale=4) as col:
203
- input_related = gr.TextArea(label="Input up to 3 Related Discharge Summary/Summaries Here", visible=False)
204
- rmv_related_btn = gr.Button(value='Remove Related Summary', visible=False)
205
- with gr.Column(scale=4) as col:
206
- related = gr.Dataset(samples=[], components=[input_related], visible=False, type='index')
207
- sbm_btn = gr.Button(value="Submit Related Summaries", components=[input_related], visible=False)
 
208
 
209
  # initial run
210
  btn.click(run, inputs=[input], outputs=[attn_viz, related, attn_clr_btn, input_related, sbm_btn, rmv_related_btn])
 
125
  return prettify_text(related_chosen)
126
  # return related_chosen
127
 
 
 
 
 
 
 
 
 
 
128
  def prettify_text(nested_list):
129
  idx = 1
130
  string = ''
 
150
  This interface outlines DRGCoder, an explainable clinical coding for the early prediction of diagnostic-related groups (DRGs). Please note all summaries will be truncated to 512 words if longer.
151
  """)
152
  with gr.Row() as row:
153
+ input = gr.Textbox(label="Input Discharge Summary Here", placeholder='sample discharge summary')
 
 
 
 
154
  with gr.Row() as row:
155
+ gr.Examples(examples, [input])
156
+ with gr.Row() as row:
157
+ btn = gr.Button(value="Submit")
158
+ with gr.Row() as row:
159
+ attn_viz = gr.HTML()
160
+ with gr.Row() as row:
161
+ attn_clr_btn = gr.ClearButton(value='Remove output', visible=False, components=[attn_viz])
162
+ attn_clr_btn.click(clr_btn, outputs=[attn_clr_btn])
163
 
164
  # related row 1
165
  with gr.Row() as row:
 
190
 
191
  # input to related summaries
192
  with gr.Row() as row:
193
+ input_related = gr.TextArea(label="Input up to 3 Related Discharge Summary/Summaries Here", visible=False)
194
+ with gr.Row() as row:
195
+ rmv_related_btn = gr.Button(value='Remove Related Summary', visible=False)
196
+ sbm_btn = gr.Button(value="Submit Related Summaries", components=[input_related], visible=False)
197
+
198
+ with gr.Row() as row:
199
+ related = gr.Dataset(samples=[], components=[input_related], visible=False, type='index')
200
 
201
  # initial run
202
  btn.click(run, inputs=[input], outputs=[attn_viz, related, attn_clr_btn, input_related, sbm_btn, rmv_related_btn])