A BERT-Based Generation Model to Transform Medical Texts to SQL Queries for Electronic Medical Records: Model Development and Validation

被引:7
|
作者
Pan, Youcheng [1 ]
Wang, Chenghao [1 ]
Hu, Baotian [1 ]
Xiang, Yang [2 ]
Wang, Xiaolong [1 ]
Chen, Qingcai [1 ,2 ]
Chen, Junjie [1 ]
Du, Jingcheng [3 ]
机构
[1] Harbin Inst Technol, Intelligent Comp Res Ctr, 6,Pingshan 1st Rd, Shenzhen 518055, Peoples R China
[2] Peng Cheng Lab, Shenzhen, Peoples R China
[3] Univ Texas Hlth Sci Ctr Houston, Houston, TX 77030 USA
关键词
electronic medical record; text-to-SQL generation; BERT; grammar-based decoding; tree-structured intermediate representation;
D O I
10.2196/32698
中图分类号
R-058 [];
学科分类号
摘要
Background: Electronic medical records (EMRs) are usually stored in relational databases that require SQL queries to retrieve information of interest. Effectively completing such queries can be a challenging task for medical experts due to the barriers in expertise. Existing text-to-SQL generation studies have not been fully embraced in the medical domain. Objective: The objective of this study was to propose a neural generation model that can jointly consider the characteristics of medical text and the SQL structure to automatically transform medical texts to SQL queries for EMRs. Methods: We proposed a medical text-to-SQL model (MedTS), which employed a pretrained Bidirectional Encoder Representations From Transformers model as the encoder and leveraged a grammar-based long short-term memory network as the decoder to predict the intermediate representation that can easily be transformed into the final SQL query. We adopted the syntax tree as the intermediate representation rather than directly regarding the SQL query as an ordinary word sequence, which is more in line with the tree-structure nature of SQL and can also effectively reduce the search space during generation. Experiments were conducted on the MIMICSQL dataset, and 5 competitor methods were compared. Results: Experimental results demonstrated that MedTS achieved the accuracy of 0.784 and 0.899 on the test set in terms of logic form and execution, respectively, which significantly outperformed the existing state-of-the-art methods. Further analyses proved that the performance on each component of the generated SQL was relatively balanced and offered substantial improvements. Conclusions: The proposed MedTS was effective and robust for improving the performance of medical text-to-SQL generation, indicating strong potential to be applied in the real medical scenario.
引用
收藏
页数:14
相关论文
共 26 条
  • [1] EHR-BERT: A BERT-based model for effective anomaly detection in electronic health records
    Niu, Haoran
    Omitaomu, Olufemi A.
    Langston, Michael A.
    Olama, Mohammad
    Ozmen, Ozgur
    Klasky, Hilda B.
    Laurio, Angela
    Ward, Merry
    Nebeker, Jonathan
    JOURNAL OF BIOMEDICAL INFORMATICS, 2024, 150
  • [2] Integration of natural and deep artificial cognitive models in medical images: BERT-based NER and relation extraction for electronic medical records
    Guo, Bo
    Liu, Huaming
    Niu, Lei
    FRONTIERS IN NEUROSCIENCE, 2023, 17
  • [3] A BERT-based review helpfulness prediction model utilizing consistency of ratings and texts
    Li, Xinzhe
    Li, Qinglong
    Ryu, Dongyeop
    Kim, Jaekyeong
    APPLIED INTELLIGENCE, 2025, 55 (06)
  • [4] Enhancing Sentiment Analysis for Chinese Texts Using a BERT-Based Model with a Custom Attention Mechanism
    Ding, Linlin
    Han, Yiming
    Li, Mo
    Li, Dong
    WEB INFORMATION SYSTEMS AND APPLICATIONS, WISA 2024, 2024, 14883 : 172 - 179
  • [5] An Electronic Medical Record-Based Prognostic Model forInpatient Falls:Development and Internal-ExternalCross-Validation
    Parsons, Rex
    Blythe, Robin
    Cramb, Susanna
    Abdel-Hafez, Ahmad
    McPhail, Steven
    JOURNAL OF MEDICAL INTERNET RESEARCH, 2024, 26
  • [6] The model of "taking electronic medical records as the core for information construction in hospitals"
    Wu Tao
    Xu Ke
    Li Ping
    Li Xian-feng
    Xu Wei-guo
    CHINESE MEDICAL JOURNAL, 2013, 126 (02) : 373 - 377
  • [7] Diagnosing crop diseases based on domain-adaptive pre-training BERT of electronic medical records
    Ding, Junqi
    Li, Bo
    Xu, Chang
    Qiao, Yan
    Zhang, Lingxian
    APPLIED INTELLIGENCE, 2023, 53 (12) : 15979 - 15992
  • [8] Masked Sentence Model Based on BERT for Move Recognition in Medical Scientific Abstracts
    Gaihong Yu
    Zhixiong Zhang
    Huan Liu
    Liangping Ding
    Journal of Data and Information Science, 2019, (04) : 42 - 55
  • [9] Feature Selection Model for Diagnosis, Electronic Medical Records and Geographical Data Correlation
    Canino, Giovanni
    Suo, Qiulings
    Guzzi, Pietro H.
    Tradigo, Giuseppe
    Zhang, Aidong
    Veltri, Pierangelo
    PROCEEDINGS OF THE 7TH ACM INTERNATIONAL CONFERENCE ON BIOINFORMATICS, COMPUTATIONAL BIOLOGY, AND HEALTH INFORMATICS, 2016, : 616 - 621
  • [10] Diagnosing crop diseases based on domain-adaptive pre-training BERT of electronic medical records
    Junqi Ding
    Bo Li
    Chang Xu
    Yan Qiao
    Lingxian Zhang
    Applied Intelligence, 2023, 53 : 15979 - 15992