awacke1 commited on
Commit
5e62602
·
1 Parent(s): 22070cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -37,21 +37,21 @@ JSONOBJ_MAP=datasetLOINC.filter(lambda example: example["Description"].startswit
37
  def fn( text1, text2, single_checkbox, checkboxes, radio, im4, file, df1, df2,):
38
  searchTerm = text1
39
  searchTermSentence = text2
40
- start_with_searchTermLOINC = datasetLOINC.filter(lambda example: example["Description"].startswith(searchTerm)) #Allergy
41
- start_with_searchTermSNOMED = datasetSNOMED.filter(lambda example: example["Description"].startswith(searchTerm)) #Hospital
42
- start_with_searchTermCQM = dataseteCQM.filter(lambda example: example["Description"].startswith(searchTerm)) #Bathing
43
- len(start_with_ar)
44
 
45
  return (
46
- (text1 if single_checkbox else text2) + ", selected:" + ", ".join(checkboxes), # Text
 
47
  # {"positive": num / (num + slider1 + slider2),"negative": slider1 / (num + slider1 + slider2),"neutral": slider2 / (num + slider1 + slider2),}, # Label
48
  # (audio1[0], np.flipud(audio1[1])) if audio1 is not None else os.path.join(os.path.dirname(__file__), "files/cantina.wav"), # Audio
49
  # np.flipud(im1) if im1 is not None else os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), # Image
50
  # video if video is not None else os.path.join(os.path.dirname(__file__), "files/world.mp4"), # Video
51
  [
52
- (searchTerm, start_with_searchTermLOINC),
53
- (searchTerm, start_with_searchTermSNOMED ),
54
- (searchTerm, start_with_searchTermCQM ),
55
  ("The", "art"),
56
  ("quick brown", "adj"),
57
  ("fox", "nn"),
@@ -65,9 +65,9 @@ def fn( text1, text2, single_checkbox, checkboxes, radio, im4,
65
  (".", "punc"),
66
  ] + [(f"test {x}", f"test {x}") for x in range(10)], # HighlightedText
67
  [
68
- (start_with_searchTermLOINC, 0.8 ),
69
- (start_with_searchTermSNOMED, 0.8 ),
70
- (start_with_searchTermCQM, 0.8 ),
71
  ("The testing testing testing", None),
72
  ("over", 0.6),
73
  ("the", 0.2),
 
37
  def fn( text1, text2, single_checkbox, checkboxes, radio, im4, file, df1, df2,):
38
  searchTerm = text1
39
  searchTermSentence = text2
40
+ start_with_searchTermLOINC = datasetLOINC.filter(lambda example: example["Description"].startswith('Allergy')) #Allergy
41
+ start_with_searchTermSNOMED = datasetSNOMED.filter(lambda example: example["Description"].startswith('Hospital')) #Hospital
42
+ start_with_searchTermCQM = dataseteCQM.filter(lambda example: example["Description"].startswith('Bathing')) #Bathing
 
43
 
44
  return (
45
+ #(text1 if single_checkbox else text2) + ", selected:" + ", ".join(checkboxes), # Text
46
+ (start_with_searchTermLOINC[0] if single_checkbox else start_with_searchTermSNOMED[0]) + ", selected:" + ", ".join(checkboxes), # Text
47
  # {"positive": num / (num + slider1 + slider2),"negative": slider1 / (num + slider1 + slider2),"neutral": slider2 / (num + slider1 + slider2),}, # Label
48
  # (audio1[0], np.flipud(audio1[1])) if audio1 is not None else os.path.join(os.path.dirname(__file__), "files/cantina.wav"), # Audio
49
  # np.flipud(im1) if im1 is not None else os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), # Image
50
  # video if video is not None else os.path.join(os.path.dirname(__file__), "files/world.mp4"), # Video
51
  [
52
+ (searchTerm, start_with_searchTermLOINC[0]),
53
+ (searchTerm, start_with_searchTermSNOMED[0] ),
54
+ (searchTerm, start_with_searchTermCQM[0] ),
55
  ("The", "art"),
56
  ("quick brown", "adj"),
57
  ("fox", "nn"),
 
65
  (".", "punc"),
66
  ] + [(f"test {x}", f"test {x}") for x in range(10)], # HighlightedText
67
  [
68
+ (start_with_searchTermLOINC[0], 0.8 ),
69
+ (start_with_searchTermSNOMED[0], 0.8 ),
70
+ (start_with_searchTermCQM[0], 0.8 ),
71
  ("The testing testing testing", None),
72
  ("over", 0.6),
73
  ("the", 0.2),