awacke1 commited on
Commit
044421b
1 Parent(s): c7a05ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -6
app.py CHANGED
@@ -40,10 +40,18 @@ def fn( text1, text2, single_checkbox, checkboxes, radio, im4,
40
  #my_dataset_dictionary['train'][0]
41
  start_with_searchTermLOINC = datasetLOINC.filter(lambda example: example["Description"].startswith('Allergy')) #Allergy
42
  start_with_searchTermSNOMED = datasetSNOMED.filter(lambda example: example["Description"].startswith('Hospital')) #Hospital
43
- #start_with_searchTermCQM = dataseteCQM.filter(lambda example: example["Description"].startswith('Admission')) #Admission
44
- top1matchLOINC = start_with_searchTermLOINC['train'][0]
45
- top1matchSNOMED = start_with_searchTermSNOMED['train'][0]
46
- #print(start_with_searchTermCQM['train'][0] )
 
 
 
 
 
 
 
 
47
  return (
48
  #(text1 if single_checkbox else text2) + ", selected:" + ", ".join(checkboxes), # Text
49
  #(start_with_searchTermLOINC if single_checkbox else start_with_searchTermSNOMED) + ", selected:" + ", ".join(checkboxes), # Text
@@ -137,8 +145,8 @@ demo = gr.Interface(
137
  ],
138
  examples=[
139
  [
140
- "the quick brown fox",
141
- "jumps over the lazy dog",
142
  #10,
143
  #12,
144
  #4,
 
40
  #my_dataset_dictionary['train'][0]
41
  start_with_searchTermLOINC = datasetLOINC.filter(lambda example: example["Description"].startswith('Allergy')) #Allergy
42
  start_with_searchTermSNOMED = datasetSNOMED.filter(lambda example: example["Description"].startswith('Hospital')) #Hospital
43
+ start_with_searchTermCQM = dataseteCQM.filter(lambda example: example["Description"].startswith('Telephone')) #Telephone
44
+
45
+ try:
46
+ top1matchLOINC = json.loads(start_with_searchTermLOINC['train'][0])
47
+ top1matchSNOMED = json.loads(start_with_searchTermSNOMED['train'][0])
48
+ top1matchCQM = json.loads(start_with_searchTermCQM['train'][0])
49
+ catch:
50
+ print(start_with_searchTermLOINC)
51
+ print(start_with_searchTermSNOMED )
52
+ print(start_with_searchTermCQM )
53
+
54
+
55
  return (
56
  #(text1 if single_checkbox else text2) + ", selected:" + ", ".join(checkboxes), # Text
57
  #(start_with_searchTermLOINC if single_checkbox else start_with_searchTermSNOMED) + ", selected:" + ", ".join(checkboxes), # Text
 
145
  ],
146
  examples=[
147
  [
148
+ "Allergy",
149
+ "Admission",
150
  #10,
151
  #12,
152
  #4,