File size: 5,466 Bytes
f148f5c
7049651
f148f5c
4e276c7
 
7119601
2dff845
 
 
 
 
 
 
 
fd682f1
d2267e4
cb50a17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8707f10
904e222
 
8707f10
2780b9a
cb50a17
 
2780b9a
 
 
 
cb50a17
 
7049651
2ef7606
7049651
cb50a17
 
7049651
2ef7606
a05f093
 
7049651
2ef7606
 
30c0c41
2ef7606
 
 
74777ee
2ef7606
 
 
7049651
2ef7606
 
 
 
 
cb50a17
 
7e127c1
2ef7606
 
255e4cf
 
 
 
 
 
3fba49a
e331677
255e4cf
e331677
f148f5c
2ef7606
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import gradio as gr
import json

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."

CITATION_BUTTON_TEXT = """@article{2022,
   title={Healthsheet: Development of a Transparency Artifact for Health Datasets},
   url={http://dx.doi.org/10.1145/3531146.3533239},
   DOI={10.1145/3531146.3533239},
   journal={2022 ACM Conference on Fairness, Accountability, and Transparency},
   publisher={ACM},
   author={Rostamzadeh, Negar and Mincu, Diana and Roy, Subhrajit and Smart, Andrew and Wilcox, Lauren and Pushkarna, Mahima and Schrouff, Jessica and Amironesei, Razvan and Moorosi, Nyalleng and Heller, Katherine},
   year={2022},
   month={Jun} }
"""               

def initialize_healthsheet(json_data):
    healthsheet_dict = {}
    for header in json_data:
        healthsheet_dict[header] = {}
        for var_name, question in json_data[header].items():
            healthsheet_dict[header][var_name] = {
                'question': question,
                'answer': None
            }
    return healthsheet_dict

def print_healthsheet(healthsheet_dict):
    healthsheet = ""
    for header in healthsheet_dict:
        healthsheet += f"# {header}\n\n"
        for var_name in healthsheet_dict[header]:
            question = healthsheet_dict[header][var_name]['question']
            answer = healthsheet_dict[header][var_name]['answer']
            healthsheet += f"## {question}\n\n"
            healthsheet += f"`{answer}`\n\n"            
    return healthsheet

def update_healthsheet(healthsheet_dict, header, var_name, answer):
    healthsheet_dict[header][var_name]['answer'] = answer
    healthsheet = print_healthsheet(healthsheet_dict)
    return healthsheet_dict, healthsheet


with open('healthsheet.json', 'r') as file:
    json_data = json.load(file)

healthsheet_dict = initialize_healthsheet(json_data)
healthsheet = print_healthsheet(healthsheet_dict)

with gr.Blocks() as demo:
    gr.HTML("<h1><center>Healthsheet Creator for Healthcare AI Datasets! πŸͺ„πŸ“„βœ¨<h1><center>")
    gr.HTML('<h3><center>Create a healthsheet for your dataset 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>')

    with gr.Row():
        with gr.Accordion("πŸ“ Abstract", open=False):
            abstract_button = gr.Markdown(ABSTRACT_TEXT)
    with gr.Row():
            with gr.Accordion("πŸ“˜ Citation", open=False):
                citation_button = gr.Textbox(
                    label = '',
                    value=CITATION_BUTTON_TEXT,
                    lines=9,
                ).style(show_copy_button=True)

    with gr.Row():
        with gr.Column():
            for tab_name in json_data:
                with gr.Tab(tab_name):
                    for var_name, label_text in json_data[tab_name].items():
                        answer = gr.Textbox(label=label_text, lines=3)
                        update_btn = gr.Button("Update")
                        #update_btn.click(fn=update_healthsheet, inputs=[healthsheet_dict, tab_name, var_name, answer], outputs=[healthsheet_dict, healthsheet])
        
        with gr.Column():
            gr.Markdown("This is where your healthsheet will appear! You can copy and paste it into your dataset card.")
            with gr.Accordion("Progress Tracker", open=True):
                for header in healthsheet_dict:
                    gr.Markdown(f"❌ {header}")
            
            with gr.Accordion("Preview your Healthsheet", open=False):
                gr.Markdown(healthsheet)

            with gr.Accordion("Markdown Text (for copying)", open=False):
                gr.Textbox(healthsheet, label='Your Healthsheet', show_copy_button=True)
    
if __name__ == "__main__":
    demo.launch()