Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
ABSTRACT_TEXT = "Machine learning (ML) approaches have demonstrated promising results in a wide range of healthcare applications. Data plays a crucial role in developing ML-based healthcare systems that directly affect people's lives. Many of the ethical issues surrounding the use of ML in healthcare stem from structural inequalities underlying the way we collect, use, and handle data. Developing guidelines to improve documentation practices regarding the creation, use, and maintenance of ML healthcare datasets is therefore of critical importance. In this work, we introduce Healthsheet, a contextualized adaptation of the original datasheet questionnaire ~\cite{gebru2018datasheets} for health-specific applications. Through a series of semi-structured interviews, we adapt the datasheets for healthcare data documentation. As part of the Healthsheet development process and to understand the obstacles researchers face in creating datasheets, we worked with three publicly-available healthcare datasets as our case studies, each with different types of structured data: Electronic health Records (EHR), clinical trial study data, and smartphone-based performance outcome measures. Our findings from the interviewee study and case studies show 1) that datasheets should be contextualized for healthcare, 2) that despite incentives to adopt accountability practices such as datasheets, there is a lack of consistency in the broader use of these practices 3) how the ML for health community views datasheets and particularly \textit{Healthsheets} as diagnostic tool to surface the limitations and strength of datasets and 4) the relative importance of different fields in the datasheet to healthcare concerns."
|
4 |
|
@@ -13,42 +14,62 @@ CITATION_BUTTON_TEXT = """@article{2022,
|
|
13 |
month={Jun} }
|
14 |
"""
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
)
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
|
47 |
-
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
|
53 |
-
if __name__ == "__main__":
|
54 |
-
|
|
|
1 |
import gradio as gr
|
2 |
+
import json
|
3 |
|
4 |
ABSTRACT_TEXT = "Machine learning (ML) approaches have demonstrated promising results in a wide range of healthcare applications. Data plays a crucial role in developing ML-based healthcare systems that directly affect people's lives. Many of the ethical issues surrounding the use of ML in healthcare stem from structural inequalities underlying the way we collect, use, and handle data. Developing guidelines to improve documentation practices regarding the creation, use, and maintenance of ML healthcare datasets is therefore of critical importance. In this work, we introduce Healthsheet, a contextualized adaptation of the original datasheet questionnaire ~\cite{gebru2018datasheets} for health-specific applications. Through a series of semi-structured interviews, we adapt the datasheets for healthcare data documentation. As part of the Healthsheet development process and to understand the obstacles researchers face in creating datasheets, we worked with three publicly-available healthcare datasets as our case studies, each with different types of structured data: Electronic health Records (EHR), clinical trial study data, and smartphone-based performance outcome measures. Our findings from the interviewee study and case studies show 1) that datasheets should be contextualized for healthcare, 2) that despite incentives to adopt accountability practices such as datasheets, there is a lack of consistency in the broader use of these practices 3) how the ML for health community views datasheets and particularly \textit{Healthsheets} as diagnostic tool to surface the limitations and strength of datasets and 4) the relative importance of different fields in the datasheet to healthcare concerns."
|
5 |
|
|
|
14 |
month={Jun} }
|
15 |
"""
|
16 |
|
17 |
+
# Load the JSON data
|
18 |
+
with open('healthsheet.json', 'r') as file:
|
19 |
+
data = json.load(file)
|
20 |
+
|
21 |
+
def create_tab_interface(json_data):
|
22 |
+
tabs = []
|
23 |
+
|
24 |
+
for tab_name, fields in json_data.items():
|
25 |
+
with gr.Row() as row:
|
26 |
+
for field_name, label in fields.items():
|
27 |
+
gr.Textbox(name=field_name, label=label, lines=3)
|
28 |
+
tabs.append(gr.Tab(tab_name, row))
|
29 |
+
|
30 |
+
return gr.Interface(tabs=tabs)
|
31 |
+
|
32 |
+
interface = create_tab_interface(data)
|
33 |
+
|
34 |
+
if __name__ == "__main__":
|
35 |
+
interface.launch()
|
36 |
+
|
37 |
+
# with gr.Blocks() as demo:
|
38 |
+
# gr.HTML("<h1><center>Healthsheet Creator! πͺπβ¨<h1><center>")
|
39 |
+
# gr.HTML('<h3><center>Create a healthsheet based on <a href="https://arxiv.org/abs/2202.13028">Rostamzadeh et al. (2022) <i>"Healthsheet: Development of a Transparency Artifact for Health Datasets"</i></a><h4><center>')
|
40 |
+
|
41 |
+
# with gr.Row():
|
42 |
+
# with gr.Accordion("π Abstract", open=False):
|
43 |
+
# abstract_button = gr.Textbox(
|
44 |
+
# value = ABSTRACT_TEXT,
|
45 |
+
# lines = 5,
|
46 |
+
# )
|
47 |
+
# with gr.Row():
|
48 |
+
# with gr.Accordion("π Citation", open=False):
|
49 |
+
# citation_button = gr.Textbox(
|
50 |
+
# value=CITATION_BUTTON_TEXT,
|
51 |
+
# lines=9,
|
52 |
+
# elem_id="citation-button",
|
53 |
+
# ).style(show_copy_button=True)
|
54 |
+
|
55 |
+
# with gr.Row():
|
56 |
+
# with gr.Column():
|
57 |
|
58 |
+
# with gr.Tab("General Information"):
|
59 |
+
# gr.Markdown("If the answer to any of the questions in the questionnaire is N/A, please describe why the answer is N/A (e.g: data not being available).")
|
60 |
+
# summary = gr.Textbox(label='Provide a 2 sentence summary of this dataset.', lines=3)
|
61 |
+
# audit = gr.Textbox(label='Has the dataset been audited before? If yes, by whom and what are the results?', lines=3)
|
62 |
|
63 |
+
# with gr.Tab("Dataset Versioning"):
|
64 |
+
# gr.Markdown("Version: A dataset will be considered to have a new version if there are major differences from a previous release. Some examples are a change in the number of patients/participants, or an increase in the data modalities covered.")
|
65 |
+
# gr.Markdown("Sub-version: A sub-version tends to apply smaller scale changes to a given version. Some datasets in healthcare are released without labels and predefined tasks, or will be later labeled by researchers for specific tasks and problems, to form sub-versions of the dataset.")
|
66 |
+
# gr.Markdown("The following set of questions clarifies the information about the current (latest) version of the dataset. It is important to report the rationale for labeling the data in any of the versions and sub-versions that this datasheet addresses, funding resources, and motivations behind each released version of the dataset.")
|
67 |
|
68 |
+
# update = gr.Textbox(label='Does the dataset get released as static versions or is it dynamically updated? a. If static, how many versions of the dataset exist? b.If dynamic, how frequently is the dataset updated?')
|
69 |
|
70 |
+
# with gr.Column():
|
71 |
+
# gr.Markdown("This is where your healthsheet will appear!")
|
72 |
+
# gr.Textbox("Healthsheet")
|
73 |
|
74 |
+
# if __name__ == "__main__":
|
75 |
+
# demo.launch()
|