Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -10,8 +10,7 @@ print(datasetSNOMED)
|
|
10 |
print(dataseteCQM)
|
11 |
|
12 |
# play with some dataset tools before the show:
|
13 |
-
|
14 |
-
len(start_with_ar)
|
15 |
#print(start_with_ar["Description"])
|
16 |
|
17 |
#---
|
@@ -36,6 +35,12 @@ JSONOBJ_MAP=datasetLOINC.filter(lambda example: example["Description"].startswit
|
|
36 |
#def fn( text1, text2, num, slider1, slider2, single_checkbox, checkboxes, radio, dropdown, im1, im2, im3, im4,
|
37 |
# video, audio1, audio2, file, df1, df2,):
|
38 |
def fn( text1, text2, single_checkbox, checkboxes, radio, im4, file, df1, df2,):
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
return (
|
41 |
(text1 if single_checkbox else text2) + ", selected:" + ", ".join(checkboxes), # Text
|
@@ -44,6 +49,9 @@ def fn( text1, text2, single_checkbox, checkboxes, radio, im4,
|
|
44 |
# np.flipud(im1) if im1 is not None else os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), # Image
|
45 |
# video if video is not None else os.path.join(os.path.dirname(__file__), "files/world.mp4"), # Video
|
46 |
[
|
|
|
|
|
|
|
47 |
("The", "art"),
|
48 |
("quick brown", "adj"),
|
49 |
("fox", "nn"),
|
@@ -57,6 +65,9 @@ def fn( text1, text2, single_checkbox, checkboxes, radio, im4,
|
|
57 |
(".", "punc"),
|
58 |
] + [(f"test {x}", f"test {x}") for x in range(10)], # HighlightedText
|
59 |
[
|
|
|
|
|
|
|
60 |
("The testing testing testing", None),
|
61 |
("over", 0.6),
|
62 |
("the", 0.2),
|
|
|
10 |
print(dataseteCQM)
|
11 |
|
12 |
# play with some dataset tools before the show:
|
13 |
+
|
|
|
14 |
#print(start_with_ar["Description"])
|
15 |
|
16 |
#---
|
|
|
35 |
#def fn( text1, text2, num, slider1, slider2, single_checkbox, checkboxes, radio, dropdown, im1, im2, im3, im4,
|
36 |
# video, audio1, audio2, file, df1, df2,):
|
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
|
|
|
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 |
(".", "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),
|