thbndi commited on
Commit
8822c4e
1 Parent(s): 46d884d

Update dataset_utils.py

Browse files
Files changed (1) hide show
  1. dataset_utils.py +8 -0
dataset_utils.py CHANGED
@@ -355,6 +355,8 @@ def generate_text(data,icd,items,feat_cond,feat_chart,feat_meds, feat_proc, feat
355
  text = template.format(mean_val,feat_label)
356
  chart_text.append(text)
357
  chart_text='The chart events mesured are :{}.' + ';'.join(chart_text)
 
 
358
  else:
359
  chart_text=''
360
 
@@ -375,6 +377,8 @@ def generate_text(data,icd,items,feat_cond,feat_chart,feat_meds, feat_proc, feat
375
  meds_text='The mean amounts of medications administered during the episode are :{}.' + ';'.join(meds_text)
376
  else:
377
  meds_text=''
 
 
378
 
379
  #proc
380
  if feat_proc:
@@ -383,6 +387,8 @@ def generate_text(data,icd,items,feat_cond,feat_chart,feat_meds, feat_proc, feat
383
  feat=proc.keys()
384
  feat_text = [(items[items['itemid']==f]['label']).to_string(index=False) for f in feat]
385
  proc_text='The procedures performed are :{}.' + ';'.join(feat_text)
 
 
386
  else:
387
  proc_text=''
388
 
@@ -393,6 +399,8 @@ def generate_text(data,icd,items,feat_cond,feat_chart,feat_meds, feat_proc, feat
393
  feat=out.keys()
394
  feat_text = [(items[items['itemid']==f]['label']).to_string(index=False) for f in feat]
395
  out_text='The outputs collected are :{}.' + ';'.join(feat_text)
 
 
396
  else:
397
  out_text=''
398
 
 
355
  text = template.format(mean_val,feat_label)
356
  chart_text.append(text)
357
  chart_text='The chart events mesured are :{}.' + ';'.join(chart_text)
358
+ else:
359
+ chart_text=''
360
  else:
361
  chart_text=''
362
 
 
377
  meds_text='The mean amounts of medications administered during the episode are :{}.' + ';'.join(meds_text)
378
  else:
379
  meds_text=''
380
+ else:
381
+ meds_text=''
382
 
383
  #proc
384
  if feat_proc:
 
387
  feat=proc.keys()
388
  feat_text = [(items[items['itemid']==f]['label']).to_string(index=False) for f in feat]
389
  proc_text='The procedures performed are :{}.' + ';'.join(feat_text)
390
+ else:
391
+ proc_text=''
392
  else:
393
  proc_text=''
394
 
 
399
  feat=out.keys()
400
  feat_text = [(items[items['itemid']==f]['label']).to_string(index=False) for f in feat]
401
  out_text='The outputs collected are :{}.' + ';'.join(feat_text)
402
+ else:
403
+ out_text=''
404
  else:
405
  out_text=''
406