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