Spaces:
Sleeping
Sleeping
Jesse Liu commited on
Commit ·
abdcec5
1
Parent(s): 345cecc
Feature: Add evaluation group selection for 5 groups
Browse files- chatgpt.py +23 -0
- eval_groups_5groups_pairwise.json +218 -0
chatgpt.py
CHANGED
|
@@ -928,6 +928,14 @@ with gr.Blocks() as app:
|
|
| 928 |
)
|
| 929 |
|
| 930 |
with gr.TabItem("Expert Evaluation"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 931 |
with gr.Row():
|
| 932 |
with gr.Column(scale=1):
|
| 933 |
# Patient Sample Selection for Evaluation
|
|
@@ -935,6 +943,21 @@ with gr.Blocks() as app:
|
|
| 935 |
gr.Markdown("## Select Patient Sample")
|
| 936 |
gr.Markdown("**Tip:** Same patients may have multiple admissions - each is a separate evaluation case")
|
| 937 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 938 |
option_titles = [option["title"] for option in options]
|
| 939 |
|
| 940 |
# Replace single radio with two-stage selection: Patient -> Admission
|
|
|
|
| 928 |
)
|
| 929 |
|
| 930 |
with gr.TabItem("Expert Evaluation"):
|
| 931 |
+
# Load evaluation groups
|
| 932 |
+
eval_groups = {}
|
| 933 |
+
eval_groups_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'eval_groups_5groups_pairwise.json')
|
| 934 |
+
if os.path.exists(eval_groups_file):
|
| 935 |
+
with open(eval_groups_file, 'r') as f:
|
| 936 |
+
eval_groups_data = json.load(f)
|
| 937 |
+
eval_groups = eval_groups_data.get('groups', {})
|
| 938 |
+
|
| 939 |
with gr.Row():
|
| 940 |
with gr.Column(scale=1):
|
| 941 |
# Patient Sample Selection for Evaluation
|
|
|
|
| 943 |
gr.Markdown("## Select Patient Sample")
|
| 944 |
gr.Markdown("**Tip:** Same patients may have multiple admissions - each is a separate evaluation case")
|
| 945 |
|
| 946 |
+
# Group selection
|
| 947 |
+
if eval_groups:
|
| 948 |
+
gr.Markdown("### Evaluation Group")
|
| 949 |
+
group_choices = ["All Patients"] + sorted(eval_groups.keys())
|
| 950 |
+
eval_group_dropdown = gr.Dropdown(
|
| 951 |
+
choices=group_choices,
|
| 952 |
+
label="Select Your Group",
|
| 953 |
+
value="All Patients",
|
| 954 |
+
interactive=True
|
| 955 |
+
)
|
| 956 |
+
group_info_display = gr.Markdown(
|
| 957 |
+
value="Select a group to see your assigned patients",
|
| 958 |
+
visible=True
|
| 959 |
+
)
|
| 960 |
+
|
| 961 |
option_titles = [option["title"] for option in options]
|
| 962 |
|
| 963 |
# Replace single radio with two-stage selection: Patient -> Admission
|
eval_groups_5groups_pairwise.json
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"groups": {
|
| 3 |
+
"Group_A": {
|
| 4 |
+
"unique_patients": [],
|
| 5 |
+
"overlap_patients": [
|
| 6 |
+
"10004764",
|
| 7 |
+
"10003400",
|
| 8 |
+
"10002976",
|
| 9 |
+
"10008100",
|
| 10 |
+
"10005817",
|
| 11 |
+
"10002221",
|
| 12 |
+
"10002155",
|
| 13 |
+
"10003203",
|
| 14 |
+
"10003019",
|
| 15 |
+
"10004401",
|
| 16 |
+
"10002557",
|
| 17 |
+
"10007818"
|
| 18 |
+
],
|
| 19 |
+
"all_patients": [
|
| 20 |
+
"10004764",
|
| 21 |
+
"10003400",
|
| 22 |
+
"10002976",
|
| 23 |
+
"10008100",
|
| 24 |
+
"10005817",
|
| 25 |
+
"10002221",
|
| 26 |
+
"10002155",
|
| 27 |
+
"10003203",
|
| 28 |
+
"10003019",
|
| 29 |
+
"10004401",
|
| 30 |
+
"10002557",
|
| 31 |
+
"10007818"
|
| 32 |
+
],
|
| 33 |
+
"total_count": 12
|
| 34 |
+
},
|
| 35 |
+
"Group_B": {
|
| 36 |
+
"unique_patients": [],
|
| 37 |
+
"overlap_patients": [
|
| 38 |
+
"10004764",
|
| 39 |
+
"10003400",
|
| 40 |
+
"10002976",
|
| 41 |
+
"10010429",
|
| 42 |
+
"10005348",
|
| 43 |
+
"10004422",
|
| 44 |
+
"10008628",
|
| 45 |
+
"10000980",
|
| 46 |
+
"10003372",
|
| 47 |
+
"10004719",
|
| 48 |
+
"10001401",
|
| 49 |
+
"10004457"
|
| 50 |
+
],
|
| 51 |
+
"all_patients": [
|
| 52 |
+
"10004764",
|
| 53 |
+
"10003400",
|
| 54 |
+
"10002976",
|
| 55 |
+
"10010429",
|
| 56 |
+
"10005348",
|
| 57 |
+
"10004422",
|
| 58 |
+
"10008628",
|
| 59 |
+
"10000980",
|
| 60 |
+
"10003372",
|
| 61 |
+
"10004719",
|
| 62 |
+
"10001401",
|
| 63 |
+
"10004457"
|
| 64 |
+
],
|
| 65 |
+
"total_count": 12
|
| 66 |
+
},
|
| 67 |
+
"Group_C": {
|
| 68 |
+
"unique_patients": [],
|
| 69 |
+
"overlap_patients": [
|
| 70 |
+
"10008100",
|
| 71 |
+
"10005817",
|
| 72 |
+
"10002221",
|
| 73 |
+
"10010429",
|
| 74 |
+
"10005348",
|
| 75 |
+
"10004422",
|
| 76 |
+
"10010058",
|
| 77 |
+
"10001884",
|
| 78 |
+
"10006431",
|
| 79 |
+
"10002428",
|
| 80 |
+
"10002495",
|
| 81 |
+
"10006029"
|
| 82 |
+
],
|
| 83 |
+
"all_patients": [
|
| 84 |
+
"10008100",
|
| 85 |
+
"10005817",
|
| 86 |
+
"10002221",
|
| 87 |
+
"10010429",
|
| 88 |
+
"10005348",
|
| 89 |
+
"10004422",
|
| 90 |
+
"10010058",
|
| 91 |
+
"10001884",
|
| 92 |
+
"10006431",
|
| 93 |
+
"10002428",
|
| 94 |
+
"10002495",
|
| 95 |
+
"10006029"
|
| 96 |
+
],
|
| 97 |
+
"total_count": 12
|
| 98 |
+
},
|
| 99 |
+
"Group_D": {
|
| 100 |
+
"unique_patients": [],
|
| 101 |
+
"overlap_patients": [
|
| 102 |
+
"10002155",
|
| 103 |
+
"10003203",
|
| 104 |
+
"10003019",
|
| 105 |
+
"10008628",
|
| 106 |
+
"10000980",
|
| 107 |
+
"10003372",
|
| 108 |
+
"10010058",
|
| 109 |
+
"10001884",
|
| 110 |
+
"10006431",
|
| 111 |
+
"10000635",
|
| 112 |
+
"10001492",
|
| 113 |
+
"10005236"
|
| 114 |
+
],
|
| 115 |
+
"all_patients": [
|
| 116 |
+
"10002155",
|
| 117 |
+
"10003203",
|
| 118 |
+
"10003019",
|
| 119 |
+
"10008628",
|
| 120 |
+
"10000980",
|
| 121 |
+
"10003372",
|
| 122 |
+
"10010058",
|
| 123 |
+
"10001884",
|
| 124 |
+
"10006431",
|
| 125 |
+
"10000635",
|
| 126 |
+
"10001492",
|
| 127 |
+
"10005236"
|
| 128 |
+
],
|
| 129 |
+
"total_count": 12
|
| 130 |
+
},
|
| 131 |
+
"Group_E": {
|
| 132 |
+
"unique_patients": [],
|
| 133 |
+
"overlap_patients": [
|
| 134 |
+
"10004401",
|
| 135 |
+
"10002557",
|
| 136 |
+
"10007818",
|
| 137 |
+
"10004719",
|
| 138 |
+
"10001401",
|
| 139 |
+
"10004457",
|
| 140 |
+
"10002428",
|
| 141 |
+
"10002495",
|
| 142 |
+
"10006029",
|
| 143 |
+
"10000635",
|
| 144 |
+
"10001492",
|
| 145 |
+
"10005236"
|
| 146 |
+
],
|
| 147 |
+
"all_patients": [
|
| 148 |
+
"10004401",
|
| 149 |
+
"10002557",
|
| 150 |
+
"10007818",
|
| 151 |
+
"10004719",
|
| 152 |
+
"10001401",
|
| 153 |
+
"10004457",
|
| 154 |
+
"10002428",
|
| 155 |
+
"10002495",
|
| 156 |
+
"10006029",
|
| 157 |
+
"10000635",
|
| 158 |
+
"10001492",
|
| 159 |
+
"10005236"
|
| 160 |
+
],
|
| 161 |
+
"total_count": 12
|
| 162 |
+
}
|
| 163 |
+
},
|
| 164 |
+
"pair_overlaps": {
|
| 165 |
+
"Group_A-Group_B": [
|
| 166 |
+
"10004764",
|
| 167 |
+
"10003400",
|
| 168 |
+
"10002976"
|
| 169 |
+
],
|
| 170 |
+
"Group_A-Group_C": [
|
| 171 |
+
"10008100",
|
| 172 |
+
"10005817",
|
| 173 |
+
"10002221"
|
| 174 |
+
],
|
| 175 |
+
"Group_A-Group_D": [
|
| 176 |
+
"10002155",
|
| 177 |
+
"10003203",
|
| 178 |
+
"10003019"
|
| 179 |
+
],
|
| 180 |
+
"Group_A-Group_E": [
|
| 181 |
+
"10004401",
|
| 182 |
+
"10002557",
|
| 183 |
+
"10007818"
|
| 184 |
+
],
|
| 185 |
+
"Group_B-Group_C": [
|
| 186 |
+
"10010429",
|
| 187 |
+
"10005348",
|
| 188 |
+
"10004422"
|
| 189 |
+
],
|
| 190 |
+
"Group_B-Group_D": [
|
| 191 |
+
"10008628",
|
| 192 |
+
"10000980",
|
| 193 |
+
"10003372"
|
| 194 |
+
],
|
| 195 |
+
"Group_B-Group_E": [
|
| 196 |
+
"10004719",
|
| 197 |
+
"10001401",
|
| 198 |
+
"10004457"
|
| 199 |
+
],
|
| 200 |
+
"Group_C-Group_D": [
|
| 201 |
+
"10010058",
|
| 202 |
+
"10001884",
|
| 203 |
+
"10006431"
|
| 204 |
+
],
|
| 205 |
+
"Group_C-Group_E": [
|
| 206 |
+
"10002428",
|
| 207 |
+
"10002495",
|
| 208 |
+
"10006029"
|
| 209 |
+
],
|
| 210 |
+
"Group_D-Group_E": [
|
| 211 |
+
"10000635",
|
| 212 |
+
"10001492",
|
| 213 |
+
"10005236"
|
| 214 |
+
]
|
| 215 |
+
},
|
| 216 |
+
"total_patients": 30,
|
| 217 |
+
"pairwise_overlap_size": 3
|
| 218 |
+
}
|