Home

Awesome

Text-to-SQL Generation for Question Answering on Electronic Medical Records

image image image

Citation

Ping Wang, Tian Shi, and Chandan K. Reddy. "Text-to-SQL Generation for Question Answering on Electronic Medical Records." In Proceedings of The Web Conference 2020 (WWW’20), pp. 350-361, 2020.

@inproceedings{wang2020text,
  title={Text-to-SQL Generation for Question Answering on Electronic Medical Records},
  author={Wang, Ping and Shi, Tian and Reddy, Chandan K},
  booktitle={Proceedings of The Web Conference 2020},
  pages={350--361},
  year={2020}
}

Dataset

MIMICSQL is created based on the publicly available real-world de-identified Medical Information Mart for Intensive Care III (MIMIC III) dataset. In order to generated more realistic questions, each patient is randomly assigned a synthetic name, which should not be used to identify any patients.

{
  "key": "a81dae5ff42498734e857c5b7dc46deb",
  "format": {
    "table": [
      0,
      2
    ],
    "cond": [
      [
        0,
        6,
        0,
        "F"
      ],
      [
        2,
        3,
        0,
        "Abdomen artery incision"
      ]
    ],
    "agg_col": [
      [
        0,
        0
      ]
    ],
    "sel": 1
  },
  "question_refine": "how many female patients underwent the procedure of abdomen artery incision?",
  "sql": "SELECT COUNT ( DISTINCT DEMOGRAPHIC.\"SUBJECT_ID\" ) FROM DEMOGRAPHIC INNER JOIN PROCEDURES on DEMOGRAPHIC.HADM_ID = PROCEDURES.HADM_ID WHERE DEMOGRAPHIC.\"GENDER\" = \"F\" AND PROCEDURES.\"SHORT_TITLE\" = \"Abdomen artery incision\"",
  "question_refine_tok": [],
  "sql_tok": []
}

The meaning of each elements are as follows:

Usage

Evaluation

The codes for evaluation are provided in folder evaluation. You can follow the following steps to evaluate the generated queries.

Results

Here we provide the results on the new version of natural language questions provided in mimicsql_data/mimicsql_natual_v2.

<table> <thead> <tr> <th>Dataset</th> <th colspan="2">Overall Evaluation</th> <th colspan="6">Breakdown Evaluation</th> </tr> </thead> <tbody> <tr> <td></td><td>Acc_LF</td><td>Acc_EX</td><td>Agg_op</td><td>Agg_col</td><td>Table</td><td>Con_col+op</td><td>Con_val</td><td>Average</td> </tr> <tr> <td>Testing</td><td>0.482</td><td>0.611</td><td>0.993</td><td>0.970</td><td>0.954</td><td>0.857</td><td>0.630</td><td>0.881</td> </tr> <tr> <td>Testing+recover</td><td>0.547</td><td>0.690</td><td>0.992</td><td>0.969</td><td>0.953</td><td>0.863</td><td>0.729</td><td>0.901</td> </tr> <tr> <td>Development</td><td>0.432</td><td>0.636</td><td>0.997</td><td>0.988</td><td>0.956</td><td>0.845</td><td>0.524</td><td>0.862</td> </tr> <tr> <td>Development+recover</td><td>0.526</td><td>0.741</td><td>0.997</td><td>0.988</td><td>0.956</td><td>0.837</td><td>0.639</td><td>0.883</td> </tr> </tbody> </table>