<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.0 20040830//EN" "http://dtd.nlm.nih.gov/publishing/2.0/journalpublishing.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article" dtd-version="2.0">
  <front>
    <journal-meta>
      <journal-id journal-id-type="publisher-id">JMI</journal-id>
      <journal-id journal-id-type="nlm-ta">JMIR Med Inform</journal-id>
      <journal-title>JMIR Medical Informatics</journal-title>
      <issn pub-type="epub">2291-9694</issn>
      <publisher>
        <publisher-name>JMIR Publications</publisher-name>
        <publisher-loc>Toronto, Canada</publisher-loc>
      </publisher>
    </journal-meta>
    <article-meta>
      <article-id pub-id-type="publisher-id">v9i12e32698</article-id>
      <article-id pub-id-type="pmid">34889749</article-id>
      <article-id pub-id-type="doi">10.2196/32698</article-id>
      <article-categories>
        <subj-group subj-group-type="heading">
          <subject>Original Paper</subject>
        </subj-group>
        <subj-group subj-group-type="article-type">
          <subject>Original Paper</subject>
        </subj-group>
      </article-categories>
      <title-group>
        <article-title>A BERT-Based Generation Model to Transform Medical Texts to SQL Queries for Electronic Medical Records: Model Development and Validation</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="editor">
          <name>
            <surname>Eysenbach</surname>
            <given-names>Gunther</given-names>
          </name>
        </contrib>
      </contrib-group>
      <contrib-group>
        <contrib contrib-type="reviewer">
          <name>
            <surname>Kim</surname>
            <given-names>Yoojoong</given-names>
          </name>
        </contrib>
        <contrib contrib-type="reviewer">
          <name>
            <surname>Jia</surname>
            <given-names>Qi</given-names>
          </name>
        </contrib>
      </contrib-group>
      <contrib-group>
        <contrib id="contrib1" contrib-type="author">
          <name name-style="western">
            <surname>Pan</surname>
            <given-names>Youcheng</given-names>
          </name>
          <degrees>MEng</degrees>
          <xref rid="aff1" ref-type="aff">1</xref>
          <ext-link ext-link-type="orcid">https://orcid.org/0000-0002-8270-5455</ext-link>
        </contrib>
        <contrib id="contrib2" contrib-type="author">
          <name name-style="western">
            <surname>Wang</surname>
            <given-names>Chenghao</given-names>
          </name>
          <degrees>MSc</degrees>
          <xref rid="aff1" ref-type="aff">1</xref>
          <ext-link ext-link-type="orcid">https://orcid.org/0000-0001-8761-1215</ext-link>
        </contrib>
        <contrib id="contrib3" contrib-type="author" corresp="yes">
          <name name-style="western">
            <surname>Hu</surname>
            <given-names>Baotian</given-names>
          </name>
          <degrees>PhD</degrees>
          <xref rid="aff1" ref-type="aff">1</xref>
          <address>
            <institution>Intelligent Computing Research Center</institution>
            <institution>Harbin Institute of Technology</institution>
            <addr-line>No. 6, Pingshan 1st Road</addr-line>
            <addr-line>Shenzhen, 518055</addr-line>
            <country>China</country>
            <phone>86 136 9164 0856</phone>
            <email>hubaotian@hit.edu.cn</email>
          </address>
          <ext-link ext-link-type="orcid">https://orcid.org/0000-0001-7490-684X</ext-link>
        </contrib>
        <contrib id="contrib4" contrib-type="author">
          <name name-style="western">
            <surname>Xiang</surname>
            <given-names>Yang</given-names>
          </name>
          <degrees>PhD</degrees>
          <xref rid="aff2" ref-type="aff">2</xref>
          <ext-link ext-link-type="orcid">https://orcid.org/0000-0003-1395-6805</ext-link>
        </contrib>
        <contrib id="contrib5" contrib-type="author">
          <name name-style="western">
            <surname>Wang</surname>
            <given-names>Xiaolong</given-names>
          </name>
          <degrees>PhD</degrees>
          <xref rid="aff1" ref-type="aff">1</xref>
          <ext-link ext-link-type="orcid">https://orcid.org/0000-0001-9003-4252</ext-link>
        </contrib>
        <contrib id="contrib6" contrib-type="author">
          <name name-style="western">
            <surname>Chen</surname>
            <given-names>Qingcai</given-names>
          </name>
          <degrees>PhD</degrees>
          <xref rid="aff1" ref-type="aff">1</xref>
          <xref rid="aff2" ref-type="aff">2</xref>
          <ext-link ext-link-type="orcid">https://orcid.org/0000-0001-8473-7293</ext-link>
        </contrib>
        <contrib id="contrib7" contrib-type="author">
          <name name-style="western">
            <surname>Chen</surname>
            <given-names>Junjie</given-names>
          </name>
          <degrees>PhD</degrees>
          <xref rid="aff1" ref-type="aff">1</xref>
          <ext-link ext-link-type="orcid">https://orcid.org/0000-0002-0483-303X</ext-link>
        </contrib>
        <contrib id="contrib8" contrib-type="author">
          <name name-style="western">
            <surname>Du</surname>
            <given-names>Jingcheng</given-names>
          </name>
          <degrees>PhD</degrees>
          <xref rid="aff3" ref-type="aff">3</xref>
          <ext-link ext-link-type="orcid">https://orcid.org/0000-0002-0322-4566</ext-link>
        </contrib>
      </contrib-group>
      <aff id="aff1">
        <label>1</label>
        <institution>Intelligent Computing Research Center</institution>
        <institution>Harbin Institute of Technology</institution>
        <addr-line>Shenzhen</addr-line>
        <country>China</country>
      </aff>
      <aff id="aff2">
        <label>2</label>
        <institution>Peng Cheng Laboratory</institution>
        <addr-line>Shenzhen</addr-line>
        <country>China</country>
      </aff>
      <aff id="aff3">
        <label>3</label>
        <institution>University of Texas Health Science Center at Houston</institution>
        <addr-line>Houston, TX</addr-line>
        <country>United States</country>
      </aff>
      <author-notes>
        <corresp>Corresponding Author: Baotian Hu <email>hubaotian@hit.edu.cn</email></corresp>
      </author-notes>
      <pub-date pub-type="collection">
        <month>12</month>
        <year>2021</year>
      </pub-date>
      <pub-date pub-type="epub">
        <day>8</day>
        <month>12</month>
        <year>2021</year>
      </pub-date>
      <volume>9</volume>
      <issue>12</issue>
      <elocation-id>e32698</elocation-id>
      <history>
        <date date-type="received">
          <day>6</day>
          <month>8</month>
          <year>2021</year>
        </date>
        <date date-type="rev-request">
          <day>27</day>
          <month>8</month>
          <year>2021</year>
        </date>
        <date date-type="rev-recd">
          <day>23</day>
          <month>10</month>
          <year>2021</year>
        </date>
        <date date-type="accepted">
          <day>27</day>
          <month>10</month>
          <year>2021</year>
        </date>
      </history>
      <copyright-statement>©Youcheng Pan, Chenghao Wang, Baotian Hu, Yang Xiang, Xiaolong Wang, Qingcai Chen, Junjie Chen, Jingcheng Du. Originally published in JMIR Medical Informatics (https://medinform.jmir.org), 08.12.2021.</copyright-statement>
      <copyright-year>2021</copyright-year>
      <license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by/4.0/">
        <p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work, first published in JMIR Medical Informatics, is properly cited. The complete bibliographic information, a link to the original publication on https://medinform.jmir.org/, as well as this copyright and license information must be included.</p>
      </license>
      <self-uri xlink:href="https://medinform.jmir.org/2021/12/e32698" xlink:type="simple"/>
      <abstract>
        <sec sec-type="background">
          <title>Background</title>
          <p>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.</p>
        </sec>
        <sec sec-type="objective">
          <title>Objective</title>
          <p>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.</p>
        </sec>
        <sec sec-type="methods">
          <title>Methods</title>
          <p>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.</p>
        </sec>
        <sec sec-type="results">
          <title>Results</title>
          <p>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.</p>
        </sec>
        <sec sec-type="conclusions">
          <title>Conclusions</title>
          <p>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.</p>
        </sec>
      </abstract>
      <kwd-group>
        <kwd>electronic medical record</kwd>
        <kwd>text-to-SQL generation</kwd>
        <kwd>BERT</kwd>
        <kwd>grammar-based decoding</kwd>
        <kwd>tree-structured intermediate representation</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec sec-type="introduction">
      <title>Introduction</title>
      <p>Electronic medical records (EMRs) contain abundant medical information on patients and are usually stored in structured relational databases with multiple relational tables [<xref ref-type="bibr" rid="ref1">1</xref>]. Using EMRs, patient data can be traced back over an extended period of time and by multiple health care providers. EMRs can help identify those who are due for preventive checkups, screenings, or vaccinations. They also can record whether a patient’s vital signs (eg, blood pressure, weight) fall within normal limits [<xref ref-type="bibr" rid="ref2">2</xref>,<xref ref-type="bibr" rid="ref3">3</xref>]. However, retrieving EMRs from databases may not be easy for medical experts. They usually lack specific training on using SQL to perform queries on relational databases. Even for experienced informaticians, it could be troublesome to deal with massive SQL queries from databases of different structures and applicable scenarios, especially if complex SQL grammars were involved. Therefore, automating the transformation of textual questions written in natural language into SQL queries has great potential to facilitate clinical information retrieval and improve the efficiency of medical diagnosis and treatment decisions.</p>
      <p>Text-to-SQL generation [<xref ref-type="bibr" rid="ref4">4</xref>,<xref ref-type="bibr" rid="ref5">5</xref>] is the task of transforming natural language questions into SQL queries. As shown in <xref rid="figure1" ref-type="fig">Figure 1</xref>, given the medical textual question “Tell me the insurance and primary disease of James Sloan,” a text-to-SQL model can transform the question into a SQL query. It is then used to retrieve the corresponding EMR information that is stored in structured medical databases. This task has attracted widespread attention from different domains. The representative studies include automatic terminal information service [<xref ref-type="bibr" rid="ref6">6</xref>-<xref ref-type="bibr" rid="ref8">8</xref>] for a flight booking system, GeoQuery [<xref ref-type="bibr" rid="ref9">9</xref>,<xref ref-type="bibr" rid="ref10">10</xref>] for a US geography query, WikiSQL [<xref ref-type="bibr" rid="ref5">5</xref>] for querying Wikipedia, and Spider [<xref ref-type="bibr" rid="ref11">11</xref>] for realistic applications of several different domains. In many studies, the text-to-SQL generation is regarded as a task similar to natural language generation. Deep neural networks are often adopted as encoders and decoders (eg, the sequence-to-sequence [Seq2Seq] [<xref ref-type="bibr" rid="ref12">12</xref>] framework with an attention [<xref ref-type="bibr" rid="ref13">13</xref>,<xref ref-type="bibr" rid="ref14">14</xref>] or copy mechanism) [<xref ref-type="bibr" rid="ref15">15</xref>]. The input of the model is the textual question and the output is the SQL query that is viewed as an ordinary word sequence [<xref ref-type="bibr" rid="ref16">16</xref>,<xref ref-type="bibr" rid="ref17">17</xref>]. However, the same SQL query can be represented by multiple word sequences, which may affect the training effectiveness of Seq2Seq models. For example, the order of the 2 column names in the Select clause shown in <xref rid="figure1" ref-type="fig">Figure 1</xref> may not influence the execution result of the query, but the Seq2Seq models may treat them as 2 different sequences. To solve this problem, several methods were proposed by incorporating the syntactical structure of SQL [<xref ref-type="bibr" rid="ref18">18</xref>,<xref ref-type="bibr" rid="ref19">19</xref>]. For instance, SQLNet [<xref ref-type="bibr" rid="ref18">18</xref>] proposed a sketch-based sequence-to-set method. A generic sketch highly in line with the SQL grammar was first used and then it only needed to predict the slots in the sketch instead of generating the entire sequence in order.</p>
      <fig id="figure1" position="float">
        <label>Figure 1</label>
        <caption>
          <p>Application scenario of medical text–to-SQL generation.</p>
        </caption>
        <graphic xlink:href="medinform_v9i12e32698_fig1.png" alt-version="no" mimetype="image" position="float" xlink:type="simple"/>
      </fig>
      <p>Compared with other domains, corresponding explorations in the medical domain are insufficient. Due to the privacy requirements of medical data, a large-scale training corpus is still lacking. Furthermore, jargon and specialized phrases often occur in the medical text. They cannot be represented well by the models trained on other domains. But these terms are sometimes the key points of a medical question. In the limited relevant research, rule-based or those verified on small-scale datasets are most often found, such as methods of translating the medical questions into SPARQL Protocol and RDF Query Language (SPARQL) queries [<xref ref-type="bibr" rid="ref20">20</xref>] and converting the clinical questions into EMR-dependent structured queries [<xref ref-type="bibr" rid="ref21">21</xref>]. To push this forward, Yu et al [<xref ref-type="bibr" rid="ref22">22</xref>] introduced a new criteria-to-SQL generation dataset for clinical trials. However, the targeted free text is quite different from other query text in terms of length and content. Wang et al [<xref ref-type="bibr" rid="ref23">23</xref>] constructed the first large-scale text-to-SQL generation dataset, MIMICSQL, in the medical domain based on the widely used Medical Information Mart for Intensive Care (MIMIC III) dataset [<xref ref-type="bibr" rid="ref24">24</xref>]. They also proposed a Seq2Seq-based model, Translate-Edit Model for Question-to-SQL (TREQS), to directly generate the SQL query for a given medical question by using the dynamic and temporal attention mechanism and controlled copying technique. But these works are preliminary explorations and do not integrate much intrinsic information related to the SQL itself (eg, the tree structure of SQL). Therefore, there is still much room left for further progress.</p>
      <p>In this study, we propose a novel model for medical text–to-SQL generation named MedTS for the medical text–to-SQL generation task. First, the medical entities (ie, the table and column names) are recognized via schema linking. A pretrained Bidirectional Encoder Representations From Transformers (BERT) [<xref ref-type="bibr" rid="ref25">25</xref>] model is then used as an encoder to enhance the question representation. The BERT-based encoder can exploit the relationship of entities between medical text question and database schema. Second, a grammar-based long short-term memory (LSTM) [<xref ref-type="bibr" rid="ref26">26</xref>] decoder is adopted to generate the tree-structured intermediate representation instead of directly transforming a medical question into SQL query. It is in accordance with the chronological order of the syntax tree of SQL and can reduce the search space at each decoding step. Finally, according to the predefined set of context-free grammar, the intermediate representation is transformed into the corresponding SQL query. Experiments were conducted on the MIMICSQL dataset. We compared the proposed model with 5 competitor methods and further analyzed the performance of each component of the generated SQL query. An online system is accessible to better demonstrate the application of MedTS [<xref ref-type="bibr" rid="ref27">27</xref>].</p>
    </sec>
    <sec sec-type="methods">
      <title>Methods</title>
      <sec>
        <title>Dataset</title>
        <p>We evaluated our proposed method on MIMICSQL [<xref ref-type="bibr" rid="ref23">23</xref>], which is the first large-scale medical dataset for text-to-SQL generation task in the health care domain. The medical information in MIMICSQL is derived from MIMIC III. All of the medical information was first anonymized to protect patient privacy and then stored in 5 tables in the medical database (<xref rid="figure1" ref-type="fig">Figure 1</xref>), including demographic (Demo), laboratory tests (Lab), diagnosis (Diag), procedures (Pro), and prescriptions (Pres). The questions and corresponding SQL queries in MIMICSQL were automatically generated based on fixed templates [<xref ref-type="bibr" rid="ref28">28</xref>]. Next, 8 freelancers with medical domain knowledge were recruited from a crowd-sourcing platform to validate the question as realistic and reasonable or rephrase the generated question. The information of the MIMICSQL dataset is summarized in <xref ref-type="table" rid="table1">Table 1</xref>. We adopted the same data partition as in the TREQS [<xref ref-type="bibr" rid="ref23">23</xref>], in which all the question-SQL pairs were randomly split into training, validation, and test sets in the ratio of 0.8:0.1:0.1, respectively.</p>
        <table-wrap position="float" id="table1">
          <label>Table 1</label>
          <caption>
            <p>The summary of the MIMICSQL dataset.</p>
          </caption>
          <table width="1000" cellpadding="5" cellspacing="0" border="1" rules="groups" frame="hsides">
            <col width="500"/>
            <col width="500"/>
            <thead>
              <tr valign="top">
                <td>Type</td>
                <td>Count</td>
              </tr>
            </thead>
            <tbody>
              <tr valign="top">
                <td>Patients, n</td>
                <td>46,520</td>
              </tr>
              <tr valign="top">
                <td>Tables, n</td>
                <td>5</td>
              </tr>
              <tr valign="top">
                <td>Columns in tables<sup>a</sup>, n</td>
                <td>23/5/5/7/9</td>
              </tr>
              <tr valign="top">
                <td>Question-SQL pairs, n</td>
                <td>10,000</td>
              </tr>
              <tr valign="top">
                <td>Template question length (in words), mean</td>
                <td>18.39</td>
              </tr>
              <tr valign="top">
                <td>Rephrased question length (in words), mean</td>
                <td>16.45</td>
              </tr>
              <tr valign="top">
                <td>SQL query length, mean</td>
                <td>21.14</td>
              </tr>
              <tr valign="top">
                <td>Aggregation columns, mean</td>
                <td>1.1</td>
              </tr>
              <tr valign="top">
                <td>Conditions, mean</td>
                <td>1.76</td>
              </tr>
            </tbody>
          </table>
          <table-wrap-foot>
            <fn id="table1fn1">
              <p><sup>a</sup>The 23/5/5/7/9 correspond to the numbers of columns in the Demographics/Diagnosis/Procedure/Prescriptions/Laboratory tests tables.</p>
            </fn>
          </table-wrap-foot>
        </table-wrap>
      </sec>
      <sec>
        <title>Overview of the Proposed Method</title>
        <p>Given a textual question <italic>X</italic>={<italic>x</italic><sub>1</sub>,<italic>x</italic><sub>2</sub>,<italic>x</italic><sub>3</sub>,...} and the database schema, the goal of this work was to transform the textual question into a SQL query, while ensuring the SQL query retained the same semantic meaning as the textual question.</p>
        <p>An overview of MedTS is shown in <xref rid="figure2" ref-type="fig">Figure 2</xref>. In the first step, schema linking recognized the database schema information and added corresponding linking marks into the question. Second, the textual question along with linking marks and the database schema information were fed into the pretrained encoder and grammar-based decoder to generate an intermediate representation. Third, the final SQL query was generated based on the intermediate representation.</p>
        <fig id="figure2" position="float">
          <label>Figure 2</label>
          <caption>
            <p>Overview of our proposed method of medical text–to-SQL task. LSTM: long short-term memory.</p>
          </caption>
          <graphic xlink:href="medinform_v9i12e32698_fig2.png" alt-version="no" mimetype="image" position="float" xlink:type="simple"/>
        </fig>
      </sec>
      <sec>
        <title>Schema Linking</title>
        <p>Similar to the method in IRNet [<xref ref-type="bibr" rid="ref19">19</xref>], the purpose of schema linking was to recognize the mentioned entities in the medical question and assign a linking mark, which referred to recognizing the column names and table names in the medical database. We enumerated all the <italic>n</italic>-grams (<italic>n</italic>∈[1,5]) in a question and arranged them in descending order based on the length. If an <italic>n</italic>-gram exactly matched a column name or was a subset of a column name, we marked this <italic>n</italic>-gram as a column. The recognition of a table followed the same way. If an <italic>n</italic>-gram was recognized as both a column and a table, we marked it as a column because the column mark has higher priority than the table mark. Once an <italic>n</italic>-gram was identified, we removed other n-grams that overlapped with it. By doing this, we obtained all the entities mentioned in the question. Once an entity was recognized and linked with a mark, it became a span and was encoded into one vector in the encoding process, such as the insurance recognized as a column in <xref rid="figure2" ref-type="fig">Figure 2</xref>.</p>
      </sec>
      <sec>
        <title>Attention-Based Encoder Using Pretrained BERT</title>
        <p>After schema linking, we identified the entities and assigned linking marks. The given medical question <italic>X</italic> was transformed to [(<italic>x</italic><sub>1</sub>,τ<sub>1</sub>),...,(<italic>x</italic><sub>m</sub>,τ<sub>m</sub>)] where <italic>x<sub>i</sub></italic> was the <italic>i<sup>th</sup></italic> span and <italic>τ<sub>i</sub></italic> was the mark of <italic>x<sub>i</sub></italic> assigned during schema linking. If <italic>x<sub>i</sub></italic> was not an entity, <italic>τ<sub>i</sub></italic> was <italic>None</italic>. Let <italic>C</italic>={<italic>c</italic><sub>1</sub>,<italic>c</italic><sub>2</sub>,...} and <italic>T</italic>={<italic>t</italic><sub>1</sub>,<italic>t</italic><sub>2</sub>,...} denote the set of all column names and table names. In order to enhance the relationship between the question and database schema, we concatenated the question <italic>X</italic> and database schema [<italic>C</italic>,<italic>T</italic>] with special tokens, where one classification token [CLS] was used as the first token and several separation tokens [SEP] were used as separators of different information, as follows:</p>
        <disp-formula>
          <graphic xlink:href="medinform_v9i12e32698_fig4.png" alt-version="no" mimetype="image" position="float" xlink:type="simple"/>
        </disp-formula>
        <p>In this work, we first used a pretrained BERT as the encoder. The purpose was to convert the textual question with marks assigned by schema linking and database schema into hidden representations via the multihead attention mechanism [<xref ref-type="bibr" rid="ref29">29</xref>]. Then, for each span, we took the average of the hidden representations of word and mark as the span representation. Last, through a fully connected pooling layer, we obtained the final hidden representations of question <italic>H<sub>X</sub></italic>, column names <italic>H<sub>C</sub></italic>, and table names <italic>H<sub>T</sub></italic>. The nonlinear transformation of [CLS] representation <italic>tanh</italic>(<italic>WH<sub>CLS</sub></italic>+<italic>b</italic>) was used to initialize the decoder, where <italic>W</italic> and <italic>b</italic> were trainable parameters.</p>
      </sec>
      <sec>
        <title>Tree-Structured Intermediate Representation</title>
        <p>Tree-structured intermediate representation refers to a syntax tree that bridges the question and the SQL query. It contains SQL information implicated in the textual question and could be transformed to a SQL query more intuitively due to the nature of the tree structure of SQL. <xref rid="figure3" ref-type="fig">Figure 3</xref> demonstrates an example of generating an intermediate tree from an input question. Different from the previous works that used the grammar to assist the SQL generation [<xref ref-type="bibr" rid="ref19">19</xref>,<xref ref-type="bibr" rid="ref22">22</xref>], we designed the grammatical rules based on the MIMICSQL dataset. Specifically, we kept only the necessary rules occurring in the dataset to make the prediction more accurately and added a new rule for predicting the condition value.</p>
        <fig id="figure3" position="float">
          <label>Figure 3</label>
          <caption>
            <p>Example of tree-structured intermediate representation: (a) grammar rules that transform the SQL query into an abstract syntax tree, (b) example of the action sequence generated by the grammar-based decoder with 4 types of actions, and (c) intermediate tree constructed from the action sequence in b following the grammar rules in a.</p>
          </caption>
          <graphic xlink:href="medinform_v9i12e32698_fig3.png" alt-version="no" mimetype="image" position="float" xlink:type="simple"/>
        </fig>
        <p>To construct the intermediate tree from a SQL query, we first defined a set of grammar rules, as shown in <xref rid="figure3" ref-type="fig">Figure 3</xref>a. The intermediate tree starts from a root node <italic>Z</italic>. Since there are no complicated SQL components such as <italic>Union</italic> in this task, a single node <italic>R</italic> was directly attached to <italic>Z</italic>. Then, we attached a node <italic>Select</italic> or <italic>Filter</italic> under <italic>R</italic>, which was determined by the <italic>Select</italic> clause or <italic>Where</italic> clause, respectively. For the subtree of node <italic>Select</italic>, according to the number of columns in the <italic>Select</italic> clause, the same number of nodes <italic>A</italic> were attached to node <italic>Select</italic>. Each node <italic>A</italic> comprised an aggregation function node, a node <italic>C</italic>, and a node <italic>T</italic>. The aggregation function could be either of <italic>none</italic>, <italic>max</italic>, <italic>min</italic>, <italic>count</italic>, etc, while node <italic>C</italic> denoted the column name and node <italic>T</italic> denoted the table name. For the subtree of node <italic>Filter</italic>, it was determined by the conditions in the <italic>Where</italic> clause. If there was more than one condition, the corresponding number of <italic>Filter</italic> nodes would be attached. Next, for each <italic>Filter</italic> node, it attached a relational operator, a node <italic>A</italic>, and a node <italic>V</italic>. Relational operators include <italic>more than</italic> (<italic>mt</italic>), <italic>less than</italic> (<italic>lt</italic>), <italic>equal</italic> (<italic>e</italic>), etc. Node <italic>V</italic> denotes the condition value. The intermediate tree in <xref rid="figure3" ref-type="fig">Figure 3</xref>c was generated by the action sequence in <xref rid="figure3" ref-type="fig">Figure 3</xref>b following the grammar rules defined in <xref rid="figure3" ref-type="fig">Figure 3</xref>a. The generation process was in the depth-first, left-to-right order.</p>
      </sec>
      <sec>
        <title>Grammar-Based Decoder</title>
        <p>The generation process of the intermediate tree was formalized into sequential applications of actions. The actions either applied a production rule on the derivation tree or produced a terminal node. According to the grammar rules, we defined 4 types of actions (ie, <italic>ApplyRule</italic>, <italic>SelectColumn</italic>, <italic>SelectTable</italic>, and <italic>SelectValue</italic>) and adopted the grammar-based decoding strategy [<xref ref-type="bibr" rid="ref30">30</xref>,<xref ref-type="bibr" rid="ref31">31</xref>]. <italic>ApplyRule</italic>(<italic>r</italic>) applied a production rule <italic>r</italic> to construct the skeleton of the intermediate tree, and the other 3 types of actions were designed to produce the terminal tokens. Thus, the goal of the decoder was to generate an action sequence <italic>A</italic> based on the outputs of the encoder. Formally, the decoding process was formalized as follows:</p>
        <disp-formula>
          <graphic xlink:href="medinform_v9i12e32698_fig5.png" alt-version="no" mimetype="image" position="float" xlink:type="simple"/>
        </disp-formula>
        <p>where <italic>a<sub>i</sub></italic> was the action taken at time step <italic>i</italic>, <italic>a</italic><sub>&#60;</sub><italic><sub>i</sub></italic> was the sequence of actions before <italic>i</italic>, and <italic>n</italic> was the number of total time steps of the whole action sequence.</p>
        <p>The probability of selecting a rule <italic>r</italic> as the current action <italic>a<sub>i</sub></italic> was calculated as follows:</p>
        <disp-formula>
          <graphic xlink:href="medinform_v9i12e32698_fig6.png" alt-version="no" mimetype="image" position="float" xlink:type="simple"/>
        </disp-formula>
        <p>where <inline-graphic xlink:href="medinform_v9i12e32698_fig7.png" xlink:type="simple" mimetype="image"/> denoted the current hidden state of LSTM, <italic>v<sub>i</sub></italic> and <italic>u<sub>i</sub></italic> denoted the context vectors that were obtained by performing attention over <italic>H<sub>X</sub></italic> and [<italic>H<sub>C</sub></italic>;<italic>H<sub>T</sub></italic>], <italic>e</italic>(<italic>r</italic>) was the one-hot vector for rule <italic>r</italic>.</p>
        <p>The <italic>SelectColumn</italic> action was implemented via a memory-enhanced pointer network to select a column <italic>c</italic>, in which the memory was used to record the selected columns [<xref ref-type="bibr" rid="ref32">32</xref>]. Once a column was selected, it was removed from the schema and recorded in the memory. The probability of selecting a column <italic>c</italic> was calculated as follows:</p>
        <disp-formula>
          <graphic xlink:href="medinform_v9i12e32698_fig8.png" alt-version="no" mimetype="image" position="float" xlink:type="simple"/>
        </disp-formula>
        <p> where SCH denoted selecting from the schema, MEM denoted selecting from memory, and <inline-graphic xlink:href="medinform_v9i12e32698_fig9.png" xlink:type="simple" mimetype="image"/> and <inline-graphic xlink:href="medinform_v9i12e32698_fig10.png" xlink:type="simple" mimetype="image"/> denoted the corresponding hidden representations of columns.</p>
        <p>For the <italic>SelectTable</italic> action, we leveraged the relationship between columns and tables to prune irrelevant tables. Thus, the decoder predicted the table <italic>t</italic> that the selected columns belong to. The probability of choosing a table <italic>t</italic> was calculated as follows:</p>
        <disp-formula>
          <graphic xlink:href="medinform_v9i12e32698_fig11.png" alt-version="no" mimetype="image" position="float" xlink:type="simple"/>
        </disp-formula>
        <p>As for <italic>SelectValue</italic>, since the value was always mentioned in the textual question, the decoder extracted a condition value <italic>v</italic> by finding a start position and an end position from the question via 2 different pointer networks, respectively, as follows:</p>
        <disp-formula>
          <graphic xlink:href="medinform_v9i12e32698_fig12.png" alt-version="no" mimetype="image" position="float" xlink:type="simple"/>
        </disp-formula>
        <p>where <italic>p<sub>start</sub></italic> and <italic>p<sub>end</sub></italic> denoted the probabilities of the start and end positions.</p>
        <p>Afterward, in order to keep the extracted value consistent with the value in the database, we also adopted the condition-value-recover technique proposed in TREQS [<xref ref-type="bibr" rid="ref23">23</xref>] to find the most similar value in the look-up table content by computing the ROUGE-L (Recall-Oriented Understudy for Gisting Evaluation based on the Longest Common Subsequence) [<xref ref-type="bibr" rid="ref33">33</xref>] score between them.</p>
      </sec>
      <sec>
        <title>SQL Query Generation</title>
        <p>According to the grammar rules in <xref rid="figure3" ref-type="fig">Figure 3</xref>, when inferring a SQL query from an intermediate tree, we traversed the whole intermediate tree and mapped each node to the corresponding SQL component. The production rule applied on node <italic>Z</italic> denoted that it was just a single SQL query. The node <italic>R</italic> represented the start point. Following the child nodes of node <italic>R</italic>, we generated the skeleton of a SQL query, such as whether the SQL query had a <italic>Select</italic> clause or <italic>Where</italic> clause corresponding to the node <italic>Select</italic> and <italic>Filter</italic>, respectively. The node <italic>Select</italic> indicated how many columns the <italic>Select</italic> clause had. The node <italic>Filter</italic> indicated how many different conditions were in the <italic>Where</italic> clause. Based on the subtree of node <italic>Select</italic> or <italic>Filter</italic>, we filled in the details (ie, the aggregation function, relational operator, column name, table name, and condition value). The <italic>From</italic> clause was generated from the nodes of selected tables by identifying the shortest path that connected these tables in the schema.</p>
      </sec>
      <sec>
        <title>Experimental Settings</title>
        <p>We adopted the pretrained uncased base BERT as our encoder, and the hidden size was set as 768. For the decoder module, the hidden size of LSTM was set as 300. The maximum length of the action sequence was set as 128. The size of the attention vector was set as 300. The coarse-to-fine framework [<xref ref-type="bibr" rid="ref34">34</xref>-<xref ref-type="bibr" rid="ref36">36</xref>] was used to model the generation process. The Adam optimizer [<xref ref-type="bibr" rid="ref37">37</xref>] was adopted to train the model parameters for 100 epochs. The learning rate was set as 1e-06, and gradient clipping was used with a maximum gradient norm of 5.0. During training, we set the batch size as 8. The numbers of <italic>ApplyRule</italic>, <italic>SelectColumn</italic>, and <italic>SelectTable</italic> candidate actions were 24, 39, and 5 respectively. The size of the <italic>SelectValue</italic> candidate action was based on the length of the input textual question. We selected the model which achieved the best performance on the validation set. The MedTS was implemented with PyTorch [<xref ref-type="bibr" rid="ref38">38</xref>] and trained on a Tesla V100 GPU (NVIDIA Corp). Our code has been shared on GitHub to facilitate other researchers [<xref ref-type="bibr" rid="ref39">39</xref>].</p>
        <p>We compared our proposed MedTS with 5 competitor methods. Seq2Seq [<xref ref-type="bibr" rid="ref14">14</xref>] is an LSTM-based model with the attention mechanism, in which the SQL query is regarded as an ordinary word sequence. PtrGen [<xref ref-type="bibr" rid="ref15">15</xref>] is a Seq2Seq-based pointer-generator network, which can directly copy the word from the input question to alleviate the repetition and out-of-vocabulary (OOV) phenomenon. SQLNet [<xref ref-type="bibr" rid="ref18">18</xref>] is a sketch-based text-to-SQL model to avoid the order problems that occurred in the Seq2Seq model. Coarse2Fine [<xref ref-type="bibr" rid="ref36">36</xref>] is a 2-stage neural architecture for text-to-SQL. A classifier is first used to obtain a rough sketch of the SQL query and then the details of SQL are filled in based on the input and the sketch individually. TREQS [<xref ref-type="bibr" rid="ref23">23</xref>] is also a 2-stage text-to-SQL model, including an attentive-copying mechanism and condition value recovery mechanism.</p>
        <p>All text-to-SQL methods were evaluated with 2 popular metrics [<xref ref-type="bibr" rid="ref5">5</xref>], execution accuracy (<italic>Acc<sub>EX</sub></italic>) and logic form accuracy (<italic>Acc<sub>LF</sub></italic>), which are complementary to evaluate the quality of the generation of SQL queries.</p>
        <list list-type="bullet">
          <list-item>
            <p><italic>Acc<sub>EX</sub></italic>=<italic>N<sub>EX</sub></italic>⁄<italic>N</italic>, where <italic>N</italic> denotes the total number of question-SQL pairs and <italic>N<sub>EX</sub></italic> denotes the number of SQL queries that can be executed and achieve the correct answers</p>
          </list-item>
          <list-item>
            <p><italic>Acc<sub>LF</sub></italic>=<italic>N<sub>LF</sub></italic>⁄<italic>N</italic>, where <italic>N<sub>LF</sub></italic> denotes the number of queries that match exactly with the ground truth of the SQL query</p>
          </list-item>
        </list>
      </sec>
    </sec>
    <sec sec-type="results">
      <title>Results</title>
      <sec>
        <title>Quantitative Evaluation</title>
        <p><xref ref-type="table" rid="table2">Table 2</xref> provides the quantitative results on the validation and test sets. Seq2Seq achieved 0.103 <italic>Acc<sub>LF</sub></italic> and 0.173 <italic>Acc<sub>EX</sub></italic> on the test set. SQLNet performed better than Seq2Seq, since it considered the dependencies between the components of SQL query based on a graph derived from the sketch. But it was not easy to cover all the queries. PtrGen performed much better than SQLNet with 0.180 <italic>Acc<sub>LF</sub></italic> and 0.292 <italic>Acc<sub>EX</sub></italic> on the test set because it directly extracted words from textual questions to reduce the OOV words, especially when most values occurred in the original question. Coarse2Fine achieved decent performance since it incorporated the schema information into question encoding, but it was limited by the number of sketches and had difficulty handling more complex SQL. TREQS further improved the performance via several effective mechanisms, such as controlled generation and placeholder replacement. But it is just based on the Seq2Seq framework and did not consider the intrinsic structure information of SQL itself. Compared to all the methods mentioned above, MedTS achieved the best performance with 0.681 <italic>Acc<sub>LF</sub></italic> and 0.880 <italic>Acc<sub>EX</sub></italic> on the validation set and 0.784 <italic>Acc<sub>LF</sub></italic> and 0.899 <italic>Acc<sub>EX</sub></italic> on the test set, which outperformed the best competitor method by at least 29% and 27% in terms of <italic>Acc<sub>LF</sub></italic> and <italic>Acc<sub>EX</sub></italic>, respectively, on the test set.</p>
        <table-wrap position="float" id="table2">
          <label>Table 2</label>
          <caption>
            <p>The logic form accuracy (<italic>Acc<sub>LF</sub></italic>) and execution accuracy (<italic>Acc<sub>EX</sub></italic>) of SQL query generated by various methods.</p>
          </caption>
          <table width="1000" cellpadding="5" cellspacing="0" border="1" rules="groups" frame="hsides">
            <col width="200"/>
            <col width="200"/>
            <col width="200"/>
            <col width="200"/>
            <col width="200"/>
            <thead>
              <tr valign="bottom">
                <td>Methods</td>
                <td colspan="2">Validation</td>
                <td colspan="2">Test</td>
              </tr>
              <tr valign="bottom">
                <td>
                  <break/>
                </td>
                <td>
                  <italic>Acc<sub>LF</sub></italic>
                  <sup>a</sup>
                </td>
                <td>
                  <italic>Acc<sub>EX</sub></italic>
                  <sup>b</sup>
                </td>
                <td>
                  <italic>Acc<sub>LF</sub></italic>
                </td>
                <td>
                  <italic>Acc<sub>EX</sub></italic>
                </td>
              </tr>
            </thead>
            <tbody>
              <tr valign="top">
                <td>Seq2Seq</td>
                <td>0.092</td>
                <td>0.195</td>
                <td>0.103</td>
                <td>0.173</td>
              </tr>
              <tr valign="top">
                <td>SQLNet</td>
                <td>0.086</td>
                <td>0.225</td>
                <td>0.142</td>
                <td>0.260</td>
              </tr>
              <tr valign="top">
                <td>PtrGen</td>
                <td>0.181</td>
                <td>0.325</td>
                <td>0.180</td>
                <td>0.292</td>
              </tr>
              <tr valign="top">
                <td>Coarse2Fine</td>
                <td>0.217</td>
                <td>0.309</td>
                <td>0.378</td>
                <td>0.496</td>
              </tr>
              <tr valign="top">
                <td>TREQS</td>
                <td>0.562</td>
                <td>0.675</td>
                <td>0.556</td>
                <td>0.654</td>
              </tr>
              <tr valign="top">
                <td>MedTS</td>
                <td>0.681</td>
                <td>0.880</td>
                <td>0.784</td>
                <td>0.899</td>
              </tr>
            </tbody>
          </table>
          <table-wrap-foot>
            <fn id="table2fn1">
              <p><sup>a</sup><italic>Acc<sub>LF</sub></italic>: logic form accuracy.</p>
            </fn>
            <fn id="table2fn2">
              <p><sup>b</sup><italic>Acc<sub>EX</sub></italic>: execution accuracy.</p>
            </fn>
          </table-wrap-foot>
        </table-wrap>
      </sec>
      <sec>
        <title>Performance on Each Component of SQL</title>
        <p>In order to further analyze the generation result, we broke down the SQL queries into 5 components according to the SQL grammar structure, including aggregation operation, aggregation column, table, condition column along with its operation, and condition value. The experimental results are shown in <xref ref-type="table" rid="table3">Table 3</xref>. Since Coarse2Fine cannot handle multitable questions and is limited by table-aware assumption, its performance cannot be compared to other methods. Aggregation operation refers to the operations in the <italic>Select</italic> clause used to aggregate all the values of a column and return a single value, such as <italic>Count</italic>, <italic>Sum</italic>, <italic>Avg</italic>, etc. All methods except for Coarse2Fine achieved a very high accuracy of more than 97%. Aggregation column was the target column in the <italic>Select</italic> clause for the aggregation operation. MedTS outperformed other methods significantly by at least 5% and 12% on validation and test sets, respectively. Table was the target table in the <italic>From</italic> clause. Except for the Coarse2Fine, the other methods achieved similar accuracy. MedTS achieved the best performance. Condition column along with its operation represented the column and operation in the <italic>Where</italic> clause. Compared to the other competitor methods, MedTS achieved a large improvement by at least 8% on the test set. Condition value refers to the condition value in the <italic>Where</italic> clause. It was observable that the performance on condition value primarily played a vital role in the overall SQL generation performance. MedTS achieved improvement by at least 11% on the test set. In summary, the experimental results of MedTS on each component of SQL were relatively balanced and better, especially the performance on aggregation column and condition value.</p>
        <table-wrap position="float" id="table3">
          <label>Table 3</label>
          <caption>
            <p>Accuracy of each component of SQL query.</p>
          </caption>
          <table width="1000" cellpadding="5" cellspacing="0" border="1" rules="groups" frame="hsides">
            <col width="140"/>
            <col width="100"/>
            <col width="80"/>
            <col width="80"/>
            <col width="100"/>
            <col width="80"/>
            <col width="0"/>
            <col width="80"/>
            <col width="80"/>
            <col width="80"/>
            <col width="80"/>
            <col width="100"/>
            <thead>
              <tr valign="top">
                <td>Methods</td>
                <td colspan="6">Validation</td>
                <td colspan="5">Test</td>
              </tr>
              <tr valign="bottom">
                <td>
                  <break/>
                </td>
                <td>
                  <italic>Agg</italic>
                  <sup>a</sup>
                  <italic>
                    <sub>op</sub>
                  </italic>
                  <sup>b</sup>
                </td>
                <td>
                  <italic>Agg<sub>col</sub></italic>
                  <sup>c</sup>
                </td>
                <td>
                  <italic>Table</italic>
                </td>
                <td>
                  <italic>Con</italic>
                  <sup>d</sup>
                  <italic>
                    <sub>c+o</sub>
                  </italic>
                  <sup>e</sup>
                </td>
                <td>
                  <italic>Con<sub>val</sub></italic>
                  <sup>f</sup>
                </td>
                <td colspan="2">
                  <italic>Agg<sub>op</sub></italic>
                </td>
                <td>
                  <italic>Agg<sub>col</sub></italic>
                </td>
                <td>
                  <italic>Table</italic>
                </td>
                <td>
                  <italic>Con<sub>c+o</sub></italic>
                </td>
                <td>
                  <italic>Con<sub>val</sub></italic>
                </td>
              </tr>
            </thead>
            <tbody>
              <tr valign="top">
                <td>Coarse2Fine</td>
                <td>0.321</td>
                <td>0.313</td>
                <td>0.321</td>
                <td>0.260</td>
                <td>0.214</td>
                <td colspan="2">0.524</td>
                <td>0.490</td>
                <td>0.528</td>
                <td>0.448</td>
                <td>0.413</td>
              </tr>
              <tr valign="top">
                <td>Seq2Seq</td>
                <td>0.978</td>
                <td>0.872</td>
                <td>0.926</td>
                <td>0.471</td>
                <td>0.174</td>
                <td colspan="2">0.970</td>
                <td>0.696</td>
                <td>0.892</td>
                <td>0.565</td>
                <td>0.296</td>
              </tr>
              <tr valign="top">
                <td>SQLNet</td>
                <td>0.994</td>
                <td>0.939</td>
                <td>0.933</td>
                <td>0.722</td>
                <td>0.080</td>
                <td colspan="2">0.989</td>
                <td>0.873</td>
                <td>0.941</td>
                <td>0.749</td>
                <td>0.140</td>
              </tr>
              <tr valign="top">
                <td>PtrGen</td>
                <td>0.987</td>
                <td>0.917</td>
                <td>0.944</td>
                <td>0.795</td>
                <td>0.236</td>
                <td colspan="2">0.987</td>
                <td>0.830</td>
                <td>0.926</td>
                <td>0.824</td>
                <td>0.235</td>
              </tr>
              <tr valign="top">
                <td>TREQS</td>
                <td>0.990</td>
                <td>0.912</td>
                <td>0.942</td>
                <td>0.834</td>
                <td>0.694</td>
                <td colspan="2">0.993</td>
                <td>0.827</td>
                <td>0.941</td>
                <td>0.844</td>
                <td>0.763</td>
              </tr>
              <tr valign="top">
                <td>MedTS</td>
                <td>0.994</td>
                <td>0.988</td>
                <td>0.971</td>
                <td>0.893</td>
                <td>0.785</td>
                <td colspan="2">0.991</td>
                <td>0.985</td>
                <td>0.951</td>
                <td>0.919</td>
                <td>0.851</td>
              </tr>
            </tbody>
          </table>
          <table-wrap-foot>
            <fn id="table3fn1">
              <p><sup>a</sup><italic>Agg</italic>: aggregation.</p>
            </fn>
            <fn id="table3fn2">
              <p><sup>b</sup><italic>Op</italic>: operation.</p>
            </fn>
            <fn id="table3fn3">
              <p><sup>c</sup><italic>Col</italic>: column.</p>
            </fn>
            <fn id="table3fn4">
              <p><sup>d</sup><italic>Con</italic>: condition.</p>
            </fn>
            <fn id="table3fn5">
              <p><sup>e</sup><italic>c</italic>+<italic>o</italic>: column and operation.</p>
            </fn>
            <fn id="table3fn6">
              <p><sup>f</sup><italic>Val</italic>: value.</p>
            </fn>
          </table-wrap-foot>
        </table-wrap>
      </sec>
      <sec>
        <title>Ablation Study</title>
        <p>We also conducted an ablation study to analyze the impact of schema linking as well as the use of different types of pretrained representations on question encoding and show the results in <xref ref-type="table" rid="table4">Table 4</xref>. When the schema linking was not used, the performance of MedTS dropped by 1.4% on <italic>Acc<sub>LF</sub></italic> and 1.3% on <italic>Acc<sub>EX</sub></italic> on the test set, which demonstrated the effectiveness of schema linking. The tested pretrained representations included a recurrent neural network (RNN)-based encoder (ie, BioWord2Vec [<xref ref-type="bibr" rid="ref40">40</xref>]) and two BERT-based encoders (ie, ClinicalBERT [<xref ref-type="bibr" rid="ref41">41</xref>] and BioBERT [<xref ref-type="bibr" rid="ref42">42</xref>]). As shown in <xref ref-type="table" rid="table4">Table 4</xref>, the RNN-based encoder with pretrained BioWord2Vec performed far worse than the BERT-based encoder by at least 21.0% on <italic>Acc<sub>LF</sub></italic> and 17.9% on <italic>Acc<sub>EX</sub></italic> on the test set. We argue that the main reason is that the LSTM encoder cannot model the interaction of the entire sequence itself. As for the BERT-based encoders, we observed that the performance of ClinicalBERT was inferior to the others since it specializes in clinical notes that are obviously different from the natural language text. Compared to MedTS (with uncased base BERT), BioBERT achieved slightly better performance since it uses the medical literature for pretraining which is more beneficial to the representations of medical questions.</p>
        <table-wrap position="float" id="table4">
          <label>Table 4</label>
          <caption>
            <p>The experimental results of the ablation study.</p>
          </caption>
          <table width="1000" cellpadding="5" cellspacing="0" border="1" rules="groups" frame="hsides">
            <col width="30"/>
            <col width="250"/>
            <col width="0"/>
            <col width="180"/>
            <col width="0"/>
            <col width="180"/>
            <col width="0"/>
            <col width="180"/>
            <col width="0"/>
            <col width="180"/>
            <thead>
              <tr valign="top">
                <td colspan="3">Methods</td>
                <td colspan="4">Validation</td>
                <td colspan="3">Test</td>
              </tr>
              <tr valign="bottom">
                <td colspan="3">
                  <break/>
                </td>
                <td colspan="2">
                  <italic>Acc<sub>LF</sub></italic>
                  <sup>a</sup>
                </td>
                <td>
                  <italic>Acc<sub>EX</sub></italic>
                  <sup>b</sup>
                </td>
                <td colspan="3">
                  <italic>Acc<sub>LF</sub></italic>
                </td>
                <td>
                  <italic>Acc<sub>EX</sub></italic>
                </td>
              </tr>
            </thead>
            <tbody>
              <tr valign="top">
                <td colspan="3">
                  <bold>MedTS</bold>
                </td>
                <td colspan="2">0.681</td>
                <td>0.880</td>
                <td colspan="3">0.784</td>
                <td>0.899</td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>w/o SL</td>
                <td colspan="2">0.669</td>
                <td colspan="2">0.870</td>
                <td colspan="2">0.773</td>
                <td colspan="2">0.887</td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>w/ BioWord2Vec</td>
                <td colspan="2">0.472</td>
                <td colspan="2">0.690</td>
                <td colspan="2">0.501</td>
                <td colspan="2">0.644</td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>w/ ClinicalBERT</td>
                <td colspan="2">0.556</td>
                <td colspan="2">0.771</td>
                <td colspan="2">0.634</td>
                <td colspan="2">0.784</td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>w/ BioBERT</td>
                <td colspan="2">0.684</td>
                <td colspan="2">0.882</td>
                <td colspan="2">0.790</td>
                <td colspan="2">0.904</td>
              </tr>
            </tbody>
          </table>
          <table-wrap-foot>
            <fn id="table4fn1">
              <p><sup>a</sup><italic>Acc<sub>LF</sub></italic>: logic form accuracy.</p>
            </fn>
            <fn id="table4fn2">
              <p><sup>b</sup><italic>Acc<sub>EX</sub></italic>: execution accuracy.</p>
            </fn>
          </table-wrap-foot>
        </table-wrap>
      </sec>
    </sec>
    <sec sec-type="discussion">
      <title>Discussion</title>
      <sec>
        <title>Principal Findings</title>
        <p>Our proposed model MedTS achieved the best <italic>Acc<sub>LF</sub></italic> and <italic>Acc<sub>EX</sub></italic> on the validation and test sets, with pretrained encoder and grammar-based decoder. The abstract syntax tree was introduced as the intermediate representation to bridge the gap between medical text and the SQL query. The primary outcomes of this study were (1) a new state-of-the-art model for medical text-to-SQL generation task was proposed and validated and (2) an online demonstration system with the capabilities of transforming the medical text to SQL query and further returning the query results was provided. Experimental results demonstrated that MedTS has great potential to help medical experts facilitate clinical information retrieval and improve the efficiency of decision-making for medical diagnosis and treatment.</p>
      </sec>
      <sec>
        <title>Model Performance</title>
        <p>MedTS has the ability to capture the semantic relationship between words within textual questions and the dependency relationship between the text and database schema, benefitting from the multihead attention mechanism adopted by the pretrained encoder. It is difficult for competitor methods to obtain information as rich using the RNN-based encoder. Meanwhile, MedTS can effectively reduce the search space via the grammar-based decoding strategy, which predefines grammatical rules and introduces the tree-structured intermediate representation. Although several mechanisms were designed in the competitor methods to make the generated SQL query more accurate, they still view the SQL query as an ordinary word sequence and ignore the intrinsic structure characteristic of SQL itself, which makes them perform worse than MedTS.</p>
      </sec>
      <sec>
        <title>Case Study</title>
        <p>In addition to quantitative evaluations, we conducted an extensive set of qualitative case studies on the test data to analyze the generated SQL query. We manually analyzed all 1000 text-SQL pairs in the test set. Among them, 784 generated SQL queries that were entirely consistent with the ground truth, and 115 generated SQL queries that were not identical to the ground truth in the logical form but also achieved accurate execution results. Most of them were caused by the different positions of the 2 tables connected by the <italic>join</italic> operation (eg, example 1 in <xref ref-type="table" rid="table5">Table 5</xref>). This phenomenon also explains why the quantitative evaluation results of <italic>Acc<sub>EX</sub></italic> are higher than <italic>Acc<sub>LF</sub></italic> in <xref ref-type="table" rid="table2">Table 2</xref>. In addition, 5 generated SQL queries were correct but considered wrong by the <italic>Acc<sub>EX</sub></italic> because of the various orders of column in the <italic>select</italic> clause (eg, example 2 in <xref ref-type="table" rid="table5">Table 5</xref>). The remaining 96 pairs generated incorrect SQL queries. We grouped their errors into different categories from 2 perspectives: clause and element. The clauses included <italic>select</italic>, <italic>join</italic>, and <italic>where</italic>, and the elements included operator, table, column, value, and others. The statistical results are shown in <xref ref-type="table" rid="table6">Table 6</xref>. Note that there was no operator in the <italic>join</italic> clause. Similarly, since the value only presented in the <italic>where</italic> clause, the value error of <italic>select</italic> and <italic>join</italic> clauses was none. When there was a table error in the <italic>where</italic> clause, it was usually due to the wrong decision in the <italic>select</italic> or <italic>join</italic> clauses, so we did not count these types of errors again. The rest of the errors, such as more or less conditions, are grouped into other categories.</p>
        <p>From the element’s perspective, we observed that the prediction errors of <italic>column</italic> and <italic>value</italic> account for the majority. From the perspective of the clause, more than 50% of clause errors were in <italic>where</italic> clauses, while most <italic>where</italic> clause errors were due to incorrect values or columns. Example 3 in <xref ref-type="table" rid="table5">Table 5</xref> is a representative case of <italic>where</italic> clause error due to the incorrect value. The value of <italic>expire_flag</italic> is a numeric type in SQL but a text description in the question. Example 4 in <xref ref-type="table" rid="table5">Table 5</xref> shows a case of <italic>where</italic> clause error due to the wrong column, in which the <italic>admityear</italic> and <italic>dob_year</italic> are semantically close, leading to the wrong choice. It was challenging to achieve high accuracy in these cases, since MedTS is based on the pointer network that selects terms from textual questions to generate SQL queries. The <italic>operation</italic> error means that the condition column and value in the <italic>where</italic> clause are correct but the operator is wrong, which may return completely opposite results, as shown by example 5 in <xref ref-type="table" rid="table5">Table 5</xref>.</p>
        <table-wrap position="float" id="table5">
          <label>Table 5</label>
          <caption>
            <p>Five representative examples of qualitative case study.</p>
          </caption>
          <table width="1000" cellpadding="5" cellspacing="0" border="1" rules="groups" frame="hsides">
            <col width="30"/>
            <col width="970"/>
            <thead>
              <tr valign="top">
                <td colspan="2">Examples</td>
              </tr>
            </thead>
            <tbody>
              <tr valign="top">
                <td colspan="2">
                  <bold>Example 1</bold>
                </td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>Q<sup>a</sup>: Let me know the short title and ICD-9<sup>b</sup> codes of diagnoses for patient John Gartman.</td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>G<sup>c</sup>: Select diagnoses.“icd9_code,” diagnoses.“short_title” from demographic inner join diagnoses on demographic.hadm_id = diagnoses.hadm_id where demographic.“name” = “john gartman”</td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>P<sup>d</sup>: Select diagnoses.“icd9_code,” diagnoses.“short_title” from diagnoses inner join demographic on diagnoses.hadm_id = demographic.hadm_id where demographic.“name” = “john gartman”</td>
              </tr>
              <tr valign="top">
                <td colspan="2">
                  <bold>Example 2</bold>
                </td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>Q: Tell me which primary disease the patient Walter Locher is suffering from and whether he is still alive or not.</td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>G: Select demographic.“expire_flag,” demographic.“diagnosis” from demographic where demographic.“name” = “walter locher”</td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>P: Select demographic.“diagnosis,” demographic.“expire_flag” from demographic where demographic.“name” = “walter locher”</td>
              </tr>
              <tr valign="top">
                <td colspan="2">
                  <bold>Example 3</bold>
                </td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>Q: Calculate the number of dead patients who were admitted to hospital before 2123.</td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>G: Select count (distinct demographic.“subject_id”) from demographic where demographic.“expire_flag” = “1” and demographic.“admityear” &#60; “2123”</td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>P: Select count (distinct demographic.“subject_id”) from demographic where demographic.“expire_flag” = “0” and demographic.“admityear” &#60; “2123”</td>
              </tr>
              <tr valign="top">
                <td colspan="2">
                  <bold>Example 4</bold>
                </td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>Q: How many American Indian/Alaska Native ethnic background patients were born before 2148?</td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>G: Select count (distinct demographic.“subject_id”) from demographic where demographic.“ethnicity” = “american indian/alaska native” and demographic.“admityear” &#60; “2148”</td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>P: Select count (distinct demographic.“subject_id”) from demographic where demographic.“ethnicity” = “american indian/alaska native” and demographic.“dob_year” &#60; “2184”</td>
              </tr>
              <tr valign="top">
                <td colspan="2">
                  <bold>Example 5</bold>
                </td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>Q: Find the minimum number of days of hospital stay for patients born before the year 2200.</td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>G: Select min (demographic.“days_stay”) from demographic where demographic.“dob_year” &#62; “2200”</td>
              </tr>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>P: Select min (demographic.“days_stay”) from demographic where demographic.“dob_year” &#60; “2200”</td>
              </tr>
            </tbody>
          </table>
          <table-wrap-foot>
            <fn id="table5fn1">
              <p><sup>a</sup>Q: textual question.</p>
            </fn>
            <fn id="table5fn2">
              <p><sup>b</sup>ICD-9: International Classification of Diseases Clinical Modification, 9th Revision.</p>
            </fn>
            <fn id="table5fn3">
              <p><sup>c</sup>G: golden truth.</p>
            </fn>
            <fn id="table5fn4">
              <p><sup>d</sup>P: predicted result.</p>
            </fn>
          </table-wrap-foot>
        </table-wrap>
        <table-wrap position="float" id="table6">
          <label>Table 6</label>
          <caption>
            <p>Statistical analysis of error categories.</p>
          </caption>
          <table width="1000" cellpadding="5" cellspacing="0" border="1" rules="groups" frame="hsides">
            <col width="200"/>
            <col width="200"/>
            <col width="200"/>
            <col width="200"/>
            <col width="200"/>
            <thead>
              <tr valign="top">
                <td>
                  <break/>
                </td>
                <td>Select</td>
                <td>Join</td>
                <td>Where</td>
                <td>#Element Error (%)</td>
              </tr>
            </thead>
            <tbody>
              <tr valign="top">
                <td>Operator, n</td>
                <td>9</td>
                <td>—<sup>a</sup></td>
                <td>3</td>
                <td>12 (10.6)</td>
              </tr>
              <tr valign="top">
                <td>Table, n</td>
                <td>8</td>
                <td>6</td>
                <td>—</td>
                <td>14 (12.4)</td>
              </tr>
              <tr valign="top">
                <td>Column, n</td>
                <td>17</td>
                <td>—</td>
                <td>10</td>
                <td>27 (23.9)</td>
              </tr>
              <tr valign="top">
                <td>Value, n</td>
                <td>—</td>
                <td>—</td>
                <td>44</td>
                <td>44 (38.9)</td>
              </tr>
              <tr valign="top">
                <td>Other, n</td>
                <td>4</td>
                <td>9</td>
                <td>3</td>
                <td>16 (14.2)</td>
              </tr>
              <tr valign="top">
                <td>#Clause Error (%)</td>
                <td>38 (33.6)</td>
                <td>15 (13.3)</td>
                <td>60 (53.1)</td>
                <td>113 (100)</td>
              </tr>
            </tbody>
          </table>
          <table-wrap-foot>
            <fn id="table6fn1">
              <p><sup>a</sup>Not applicable.</p>
            </fn>
          </table-wrap-foot>
        </table-wrap>
      </sec>
      <sec>
        <title>Comparison With Prior Work</title>
        <p>In the medical field, a few studies have focused on the text-to-SQL task, but most of them either proposed rule-based methods [<xref ref-type="bibr" rid="ref20">20</xref>,<xref ref-type="bibr" rid="ref21">21</xref>] or validated on the small-scale datasets [<xref ref-type="bibr" rid="ref22">22</xref>]. Wang et al [<xref ref-type="bibr" rid="ref23">23</xref>] constructed the first large-scale medical text–to-SQL dataset and proposed a neural model TREQS to undertake this task. However, TREQS focused on solving the OOV problem and condition value generation. Compared with the rule-based methods, our proposed model has better applicability and can be extended to other datasets. Compared with the previous neural models, our model adapts more advanced deep learning methods to this task and achieves the optimal experimental performance on a large-scale dataset.</p>
      </sec>
      <sec>
        <title>Limitations and Future Work</title>
        <p>As discussed above, several problems are still to be solved, such as improving the accuracy of the <italic>condition</italic> <italic>column</italic> and <italic>value</italic> in the <italic>where</italic> clause, especially the gap between natural language description and the value stored in the database. In future work, we will continue to improve the accuracy and robustness of the model (eg, introducing more schema information such as the data type of column to achieve the goal of practical deployment). In addition, the form of question and SQL in MIMICSQL is relatively simple, which is not enough to cover various situations in the practical applications. Therefore, we plan to keep exploring different data forms for more practical scenarios, such as generating SQL queries containing more complex clauses.</p>
      </sec>
      <sec>
        <title>Conclusion</title>
        <p>In this work, we proposed a medical text–to-SQL method named MedTS, which incorporates a BERT-based attention encoder to obtain schema-enhanced text representation and a grammar-based LSTM decoder to generate the intermediate action sequence before generating a SQL query. By introducing the intermediate representation, MedTS can reduce the search space during decoding and mitigate the mismatch problem between the medical question and the SQL query. Experiments on the MIMICSQL dataset demonstrate that MedTS substantially outperforms the state-of-the-art methods. Further analyses on each component of SQL query and the case study confirm MedTS’s effectiveness and robustness, demonstrating its strong potential.</p>
      </sec>
    </sec>
  </body>
  <back>
    <app-group/>
    <glossary>
      <title>Abbreviations</title>
      <def-list>
        <def-item>
          <term id="abb1">
            <italic>Acc<sub>EX</sub></italic>
          </term>
          <def>
            <p>execution accuracy</p>
          </def>
        </def-item>
        <def-item>
          <term id="abb2">
            <italic>Acc<sub>LF</sub></italic>
          </term>
          <def>
            <p>logic form accuracy</p>
          </def>
        </def-item>
        <def-item>
          <term id="abb3">BERT</term>
          <def>
            <p>Bidirectional Encoder Representations from Transformers</p>
          </def>
        </def-item>
        <def-item>
          <term id="abb4">EMR</term>
          <def>
            <p>electronic medical record</p>
          </def>
        </def-item>
        <def-item>
          <term id="abb5">LSTM</term>
          <def>
            <p>long short-term memory</p>
          </def>
        </def-item>
        <def-item>
          <term id="abb6">MedTS</term>
          <def>
            <p>medical text–to-SQL</p>
          </def>
        </def-item>
        <def-item>
          <term id="abb7">MIMIC III</term>
          <def>
            <p>Medical Information Mart for Intensive Care III</p>
          </def>
        </def-item>
        <def-item>
          <term id="abb8">OOV</term>
          <def>
            <p>out-of-vocabulary</p>
          </def>
        </def-item>
        <def-item>
          <term id="abb9">RNN</term>
          <def>
            <p>recurrent neural network</p>
          </def>
        </def-item>
        <def-item>
          <term id="abb10">Seq2Seq</term>
          <def>
            <p>sequence-to-sequence</p>
          </def>
        </def-item>
        <def-item>
          <term id="abb11">SPARQL</term>
          <def>
            <p>SPARQL Protocol and RDF Query Language</p>
          </def>
        </def-item>
        <def-item>
          <term id="abb12">TREQS</term>
          <def>
            <p>Translate-Edit Model for Question-to-SQL</p>
          </def>
        </def-item>
        <def-item>
          <term id="abb13">ROUGE-L</term>
          <def>
            <p>Recall-Oriented Understudy for Gisting Evaluation based on the Longest Common Subsequence</p>
          </def>
        </def-item>
      </def-list>
    </glossary>
    <ack>
      <p>This work was jointly supported by grants 62006061, 61872113, 62106115, and 62102118 from the Natural Science Foundation of China; grants JCYJ20190806112210067, JCYJ20200109113403826, and JCYJ20200109113441941 from the Strategic Emerging Industry Development Special Funds of Shenzhen; grant CCF-BAIDUOF2020004 from the CCF-Baidu Open Fund; and grant GXWD20201230155427003-20200824155011001 from the Stable Support Program for Higher Education Institutions of Shenzhen.</p>
    </ack>
    <fn-group>
      <fn fn-type="con">
        <p>YP and CW proposed the methods, designed and performed the experiments, and drafted the manuscript. BH supervised the research and participated in the study design. YX critically revised the manuscript and made substantial contributions to interpreting the results. XW and QC provided guidance and reviewed the manuscript. JC and JD participated in the manuscript review. All authors provided feedback and approved the final version of the manuscript.</p>
      </fn>
      <fn fn-type="conflict">
        <p>None declared.</p>
      </fn>
    </fn-group>
    <ref-list>
      <ref id="ref1">
        <label>1</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Shao</surname>
              <given-names>S</given-names>
            </name>
            <name name-style="western">
              <surname>Chan</surname>
              <given-names>Y</given-names>
            </name>
            <name name-style="western">
              <surname>Kao Yang</surname>
              <given-names>Y</given-names>
            </name>
            <name name-style="western">
              <surname>Lin</surname>
              <given-names>S</given-names>
            </name>
            <name name-style="western">
              <surname>Hung</surname>
              <given-names>M</given-names>
            </name>
            <name name-style="western">
              <surname>Chien</surname>
              <given-names>R</given-names>
            </name>
            <name name-style="western">
              <surname>Lai</surname>
              <given-names>C</given-names>
            </name>
            <name name-style="western">
              <surname>Lai</surname>
              <given-names>EC</given-names>
            </name>
          </person-group>
          <article-title>The Chang Gung Research Database: a multi-institutional electronic medical records database for real-world epidemiological studies in Taiwan</article-title>
          <source>Pharmacoepidemiol Drug Saf</source>
          <year>2019</year>
          <month>05</month>
          <volume>28</volume>
          <issue>5</issue>
          <fpage>593</fpage>
          <lpage>600</lpage>
          <pub-id pub-id-type="doi">10.1002/pds.4713</pub-id>
          <pub-id pub-id-type="medline">30648314</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref2">
        <label>2</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Garies</surname>
              <given-names>S</given-names>
            </name>
            <name name-style="western">
              <surname>Birtwhistle</surname>
              <given-names>R</given-names>
            </name>
            <name name-style="western">
              <surname>Drummond</surname>
              <given-names>N</given-names>
            </name>
            <name name-style="western">
              <surname>Queenan</surname>
              <given-names>J</given-names>
            </name>
            <name name-style="western">
              <surname>Williamson</surname>
              <given-names>T</given-names>
            </name>
          </person-group>
          <article-title>Data resource profile: national electronic medical record data from the Canadian Primary Care Sentinel Surveillance Network (CPCSSN)</article-title>
          <source>Int J Epidemiol</source>
          <year>2017</year>
          <month>08</month>
          <day>01</day>
          <volume>46</volume>
          <issue>4</issue>
          <fpage>1091</fpage>
          <lpage>1092</lpage>
          <pub-id pub-id-type="doi">10.1093/ije/dyw248</pub-id>
          <pub-id pub-id-type="medline">28338877</pub-id>
          <pub-id pub-id-type="pii">3058732</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref3">
        <label>3</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Garies</surname>
              <given-names>S</given-names>
            </name>
            <name name-style="western">
              <surname>Cummings</surname>
              <given-names>M</given-names>
            </name>
            <name name-style="western">
              <surname>Quan</surname>
              <given-names>H</given-names>
            </name>
            <name name-style="western">
              <surname>McBrien</surname>
              <given-names>K</given-names>
            </name>
            <name name-style="western">
              <surname>Drummond</surname>
              <given-names>N</given-names>
            </name>
            <name name-style="western">
              <surname>Manca</surname>
              <given-names>D</given-names>
            </name>
            <name name-style="western">
              <surname>Williamson</surname>
              <given-names>T</given-names>
            </name>
          </person-group>
          <article-title>Methods to improve the quality of smoking records in a primary care EMR database: exploring multiple imputation and pattern-matching algorithms</article-title>
          <source>BMC Med Inform Decis Mak</source>
          <year>2020</year>
          <month>03</month>
          <day>14</day>
          <volume>20</volume>
          <issue>1</issue>
          <fpage>56</fpage>
          <comment>
            <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="https://bmcmedinformdecismak.biomedcentral.com/articles/10.1186/s12911-020-1068-5"/>
          </comment>
          <pub-id pub-id-type="doi">10.1186/s12911-020-1068-5</pub-id>
          <pub-id pub-id-type="medline">32171301</pub-id>
          <pub-id pub-id-type="pii">10.1186/s12911-020-1068-5</pub-id>
          <pub-id pub-id-type="pmcid">PMC7071570</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref4">
        <label>4</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Yaghmazadeh</surname>
              <given-names>N</given-names>
            </name>
            <name name-style="western">
              <surname>Wang</surname>
              <given-names>Y</given-names>
            </name>
            <name name-style="western">
              <surname>Dillig</surname>
              <given-names>I</given-names>
            </name>
            <name name-style="western">
              <surname>Dillig</surname>
              <given-names>T</given-names>
            </name>
          </person-group>
          <article-title>SQLizer: query synthesis from natural language</article-title>
          <source>Proc ACM Program Lang</source>
          <year>2017</year>
          <month>10</month>
          <day>12</day>
          <volume>1</volume>
          <issue>OOPSLA</issue>
          <fpage>1</fpage>
          <lpage>26</lpage>
          <pub-id pub-id-type="doi">10.1145/3133887</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref5">
        <label>5</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Zhong</surname>
              <given-names>V</given-names>
            </name>
            <name name-style="western">
              <surname>Xiong</surname>
              <given-names>C</given-names>
            </name>
            <name name-style="western">
              <surname>Socher</surname>
              <given-names>R</given-names>
            </name>
          </person-group>
          <article-title>Seq2sql: generating structured queries from natural language using reinforcement learning</article-title>
          <source>ArXiv.</source>
          <comment>Preprint posted online on August 30, 2017.
            <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="https://arxiv.org/abs/1709.00103"/>
          </comment>
        </nlm-citation>
      </ref>
      <ref id="ref6">
        <label>6</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Price</surname>
              <given-names>P</given-names>
            </name>
          </person-group>
          <article-title>Evaluation of spoken language systems: the ATIS domain</article-title>
          <source>Proc Workshop Speech Natural Lang</source>
          <year>1990</year>
          <month>06</month>
          <fpage>91</fpage>
          <lpage>95</lpage>
          <pub-id pub-id-type="doi">10.3115/116580.116612</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref7">
        <label>7</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Dahl</surname>
              <given-names>D</given-names>
            </name>
            <name name-style="western">
              <surname>Bates</surname>
              <given-names>M</given-names>
            </name>
            <name name-style="western">
              <surname>Brown</surname>
              <given-names>M</given-names>
            </name>
          </person-group>
          <article-title>Expanding the scope of the ATIS task: the ATIS-3 corpus</article-title>
          <source>Proc Workshop Human Lang Technol</source>
          <year>1994</year>
          <fpage>43</fpage>
          <lpage>48</lpage>
          <pub-id pub-id-type="doi">10.3115/1075812.1075823</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref8">
        <label>8</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Iyer</surname>
              <given-names>S</given-names>
            </name>
            <name name-style="western">
              <surname>Konstas</surname>
              <given-names>I</given-names>
            </name>
            <name name-style="western">
              <surname>Cheung</surname>
              <given-names>A</given-names>
            </name>
          </person-group>
          <article-title>Learning a neural semantic parser from user feedback</article-title>
          <year>2017</year>
          <conf-name>Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics; -Aug 4; Vancouver, Canada</conf-name>
          <conf-date>2017 Jul 30</conf-date>
          <conf-loc>Vancouver</conf-loc>
          <pub-id pub-id-type="doi">10.18653/v1/p17-1089</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref9">
        <label>9</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Zelle</surname>
              <given-names>J</given-names>
            </name>
            <name name-style="western">
              <surname>Mooney</surname>
              <given-names>R</given-names>
            </name>
          </person-group>
          <article-title>Learning to parse database queries using inductive logic programming</article-title>
          <year>1996</year>
          <conf-name>The Thirteenth National Conference on Artificial Intelligence</conf-name>
          <conf-date>1996</conf-date>
          <conf-loc>Portland</conf-loc>
          <comment>
            <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="https://www.cs.utexas.edu/~ml/papers/chill-aaai-96.pdf"/>
          </comment>
        </nlm-citation>
      </ref>
      <ref id="ref10">
        <label>10</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Finegan-Dollak</surname>
              <given-names>C</given-names>
            </name>
            <name name-style="western">
              <surname>Kummerfeld</surname>
              <given-names>J</given-names>
            </name>
            <name name-style="western">
              <surname>Zhang</surname>
              <given-names>L</given-names>
            </name>
          </person-group>
          <article-title>Improving text-to-SQL evaluation methodology</article-title>
          <year>2018</year>
          <conf-name>Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics;  Jul ; Melbourne, Australia</conf-name>
          <conf-date>2018</conf-date>
          <conf-loc>Melbourne</conf-loc>
          <pub-id pub-id-type="doi">10.18653/v1/p18-1033</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref11">
        <label>11</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Yu</surname>
              <given-names>T</given-names>
            </name>
            <name name-style="western">
              <surname>Zhang</surname>
              <given-names>R</given-names>
            </name>
            <name name-style="western">
              <surname>Yang</surname>
              <given-names>K</given-names>
            </name>
          </person-group>
          <article-title>Spider: a large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-SQL task</article-title>
          <year>2018</year>
          <conf-name>Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing</conf-name>
          <conf-date>2018</conf-date>
          <conf-loc>Brussels</conf-loc>
          <pub-id pub-id-type="doi">10.18653/v1/d18-1425</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref12">
        <label>12</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Sutskever</surname>
              <given-names>I</given-names>
            </name>
            <name name-style="western">
              <surname>Vinyals</surname>
              <given-names>O</given-names>
            </name>
            <name name-style="western">
              <surname>Le</surname>
              <given-names>QV</given-names>
            </name>
          </person-group>
          <article-title>Sequence to sequence learning with neural networks</article-title>
          <source>Adv Neural Inf Process Syst</source>
          <year>2014</year>
          <fpage>3104</fpage>
          <lpage>3112</lpage>
          <comment>
            <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="https://proceedings.neurips.cc/paper/2014/file/a14ac55a4f27472c5d894ec1c3c743d2-Paper.pdf"/>
          </comment>
        </nlm-citation>
      </ref>
      <ref id="ref13">
        <label>13</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Bahdanau</surname>
              <given-names>D</given-names>
            </name>
            <name name-style="western">
              <surname>Cho</surname>
              <given-names>K</given-names>
            </name>
            <name name-style="western">
              <surname>Bengio</surname>
              <given-names>Y</given-names>
            </name>
          </person-group>
          <article-title>Neural machine translation by jointly learning to align and translate</article-title>
          <year>2015</year>
          <conf-name>The 3rd International Conference on Learning Representations</conf-name>
          <conf-date>2015</conf-date>
          <conf-loc>San Diego</conf-loc>
        </nlm-citation>
      </ref>
      <ref id="ref14">
        <label>14</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Luong</surname>
              <given-names>M</given-names>
            </name>
            <name name-style="western">
              <surname>Pham</surname>
              <given-names>H</given-names>
            </name>
            <name name-style="western">
              <surname>Manning</surname>
              <given-names>C</given-names>
            </name>
          </person-group>
          <article-title>Effective approaches to attention-based neural machine translation</article-title>
          <year>2015</year>
          <conf-name>Proceedings of the  Conference on Empirical Methods in Natural Language Processing</conf-name>
          <conf-date>2015</conf-date>
          <conf-loc>Lisbon</conf-loc>
          <pub-id pub-id-type="doi">10.18653/v1/d15-1166</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref15">
        <label>15</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>See</surname>
              <given-names>A</given-names>
            </name>
            <name name-style="western">
              <surname>Liu</surname>
              <given-names>P</given-names>
            </name>
            <name name-style="western">
              <surname>Manning</surname>
              <given-names>C</given-names>
            </name>
          </person-group>
          <article-title>Get to the point: summarization with pointer-generator networks</article-title>
          <year>2017</year>
          <conf-name>Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics</conf-name>
          <conf-date>2017</conf-date>
          <conf-loc>Vancouver</conf-loc>
          <publisher-loc>Get to the point</publisher-loc>
          <publisher-name>summarization with pointer-generator networks. Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics</publisher-name>
          <pub-id pub-id-type="doi">10.18653/v1/p17-1099</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref16">
        <label>16</label>
        <nlm-citation citation-type="web">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Vinyals</surname>
              <given-names>O</given-names>
            </name>
            <name name-style="western">
              <surname>Kaiser</surname>
              <given-names>L</given-names>
            </name>
            <name name-style="western">
              <surname>Koo</surname>
              <given-names>T</given-names>
            </name>
          </person-group>
          <article-title>Grammar as a foreign language</article-title>
          <source>Adv Neural Inf Process Syst</source>
          <year>2015</year>
          <access-date>2021-11-11</access-date>
          <comment>
            <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="https://proceedings.neurips.cc/paper/2015/file/277281aada22045c03945dcb2ca6f2ec-Paper.pdf">https://proceedings.neurips.cc/paper/2015/file/277281aada22045c03945dcb2ca6f2ec-Paper.pdf</ext-link>
          </comment>
        </nlm-citation>
      </ref>
      <ref id="ref17">
        <label>17</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Dong</surname>
              <given-names>L</given-names>
            </name>
            <name name-style="western">
              <surname>Lapata</surname>
              <given-names>M</given-names>
            </name>
          </person-group>
          <article-title>Language to logical form with neural attention</article-title>
          <year>2016</year>
          <conf-name>Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics;  Aug ; Berlin, Germany</conf-name>
          <conf-date>2016</conf-date>
          <conf-loc>Berlin</conf-loc>
          <pub-id pub-id-type="doi">10.18653/v1/p16-1004</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref18">
        <label>18</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Xu</surname>
              <given-names>X</given-names>
            </name>
            <name name-style="western">
              <surname>Liu</surname>
              <given-names>C</given-names>
            </name>
            <name name-style="western">
              <surname>Song</surname>
              <given-names>D</given-names>
            </name>
          </person-group>
          <article-title>SQLnet: generating structured queries from natural language without reinforcement learning</article-title>
          <source>ArXiv.</source>
          <comment>Preprint posted online on November 13, 2017.
            <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="https://arxiv.org/abs/1711.04436"/>
          </comment>
        </nlm-citation>
      </ref>
      <ref id="ref19">
        <label>19</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Guo</surname>
              <given-names>J</given-names>
            </name>
            <name name-style="western">
              <surname>Zhan</surname>
              <given-names>Z</given-names>
            </name>
            <name name-style="western">
              <surname>Gao</surname>
              <given-names>Y</given-names>
            </name>
          </person-group>
          <article-title>Towards complex text-to-SQL in cross-domain database with intermediate representation</article-title>
          <year>2019</year>
          <conf-name>Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics</conf-name>
          <conf-date>2019</conf-date>
          <conf-loc>Florence</conf-loc>
          <pub-id pub-id-type="doi">10.18653/v1/p19-1444</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref20">
        <label>20</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Ben</surname>
              <given-names>AA</given-names>
            </name>
            <name name-style="western">
              <surname>Zweigenbaum</surname>
              <given-names>P</given-names>
            </name>
          </person-group>
          <article-title>Medical question answering: translating medical questions into SPARQL queries</article-title>
          <year>2012</year>
          <conf-name>Proceedings of the 2nd ACM SIGHIT international health informatics symposium</conf-name>
          <conf-date>2012</conf-date>
          <conf-loc>Miami</conf-loc>
          <pub-id pub-id-type="doi">10.1145/2110363.2110372</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref21">
        <label>21</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Roberts</surname>
              <given-names>K</given-names>
            </name>
            <name name-style="western">
              <surname>Patra</surname>
              <given-names>BG</given-names>
            </name>
          </person-group>
          <article-title>A semantic parsing method for mapping clinical questions to logical forms</article-title>
          <source>AMIA Annu Symp Proc</source>
          <year>2017</year>
          <volume>2017</volume>
          <fpage>1478</fpage>
          <lpage>1487</lpage>
          <comment>
            <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="http://europepmc.org/abstract/MED/29854217"/>
          </comment>
          <pub-id pub-id-type="medline">29854217</pub-id>
          <pub-id pub-id-type="pmcid">PMC5977685</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref22">
        <label>22</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Yu</surname>
              <given-names>X</given-names>
            </name>
            <name name-style="western">
              <surname>Chen</surname>
              <given-names>T</given-names>
            </name>
            <name name-style="western">
              <surname>Yu</surname>
              <given-names>Z</given-names>
            </name>
          </person-group>
          <article-title>Dataset and enhanced model for eligibility criteria-to-SQL semantic parsing</article-title>
          <year>2020</year>
          <conf-name>The 12th International Conference on Language Resources and Evaluation</conf-name>
          <conf-date>2020</conf-date>
          <conf-loc>Marseille</conf-loc>
        </nlm-citation>
      </ref>
      <ref id="ref23">
        <label>23</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Wang</surname>
              <given-names>P</given-names>
            </name>
            <name name-style="western">
              <surname>Shi</surname>
              <given-names>T</given-names>
            </name>
            <name name-style="western">
              <surname>Reddy</surname>
              <given-names>C</given-names>
            </name>
          </person-group>
          <article-title>Text-to-SQL generation for question answering on electronic medical records</article-title>
          <year>2020</year>
          <conf-name>Proceedings of The Web Conference</conf-name>
          <conf-date>2020</conf-date>
          <conf-loc>Taipei</conf-loc>
          <pub-id pub-id-type="doi">10.1145/3366423.3380120</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref24">
        <label>24</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Johnson</surname>
              <given-names>AEW</given-names>
            </name>
            <name name-style="western">
              <surname>Pollard</surname>
              <given-names>TJ</given-names>
            </name>
            <name name-style="western">
              <surname>Shen</surname>
              <given-names>L</given-names>
            </name>
            <name name-style="western">
              <surname>Lehman</surname>
              <given-names>LH</given-names>
            </name>
            <name name-style="western">
              <surname>Feng</surname>
              <given-names>M</given-names>
            </name>
            <name name-style="western">
              <surname>Ghassemi</surname>
              <given-names>M</given-names>
            </name>
            <name name-style="western">
              <surname>Moody</surname>
              <given-names>B</given-names>
            </name>
            <name name-style="western">
              <surname>Szolovits</surname>
              <given-names>P</given-names>
            </name>
            <name name-style="western">
              <surname>Celi</surname>
              <given-names>LA</given-names>
            </name>
            <name name-style="western">
              <surname>Mark</surname>
              <given-names>RG</given-names>
            </name>
          </person-group>
          <article-title>MIMIC-III, a freely accessible critical care database</article-title>
          <source>Sci Data</source>
          <year>2016</year>
          <volume>3</volume>
          <fpage>160035</fpage>
          <comment>
            <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="http://europepmc.org/abstract/MED/27219127"/>
          </comment>
          <pub-id pub-id-type="doi">10.1038/sdata.2016.35</pub-id>
          <pub-id pub-id-type="medline">27219127</pub-id>
          <pub-id pub-id-type="pii">sdata201635</pub-id>
          <pub-id pub-id-type="pmcid">PMC4878278</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref25">
        <label>25</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Devlin</surname>
              <given-names>J</given-names>
            </name>
            <name name-style="western">
              <surname>Chang</surname>
              <given-names>M</given-names>
            </name>
            <name name-style="western">
              <surname>Lee</surname>
              <given-names>K</given-names>
            </name>
          </person-group>
          <article-title>Bert: Pre-training of deep bidirectional transformers for language understanding</article-title>
          <year>2019</year>
          <conf-name>Proceedings of the 2019 Annual Conference of the North American Chapter of the Association for Computational Linguistics</conf-name>
          <conf-date>2019</conf-date>
          <conf-loc>Minneapolis</conf-loc>
        </nlm-citation>
      </ref>
      <ref id="ref26">
        <label>26</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Hochreiter</surname>
              <given-names>S</given-names>
            </name>
            <name name-style="western">
              <surname>Schmidhuber</surname>
              <given-names>J</given-names>
            </name>
          </person-group>
          <article-title>Long short-term memory</article-title>
          <source>Neural Comput</source>
          <year>1997</year>
          <month>11</month>
          <day>15</day>
          <volume>9</volume>
          <issue>8</issue>
          <fpage>1735</fpage>
          <lpage>1780</lpage>
          <pub-id pub-id-type="doi">10.1162/neco.1997.9.8.1735</pub-id>
          <pub-id pub-id-type="medline">9377276</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref27">
        <label>27</label>
        <nlm-citation citation-type="web">
          <source>MedTS: a BERT-based generation model to transform medical texts to SQL queries for electronic medical records</source>
          <access-date>2021-11-06</access-date>
          <comment>
            <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="http://112.74.48.115:9201/">http://112.74.48.115:9201/</ext-link>
          </comment>
        </nlm-citation>
      </ref>
      <ref id="ref28">
        <label>28</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Pampari</surname>
              <given-names>A</given-names>
            </name>
            <name name-style="western">
              <surname>Raghavan</surname>
              <given-names>P</given-names>
            </name>
            <name name-style="western">
              <surname>Liang</surname>
              <given-names>J</given-names>
            </name>
          </person-group>
          <article-title>emrQA: a large corpus for question answering on electronic medical records</article-title>
          <year>2018</year>
          <conf-name>Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing</conf-name>
          <conf-date>2018</conf-date>
          <conf-loc>Brussels</conf-loc>
          <pub-id pub-id-type="doi">10.18653/v1/d18-1258</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref29">
        <label>29</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Vaswani</surname>
              <given-names>A</given-names>
            </name>
            <name name-style="western">
              <surname>Shazeer</surname>
              <given-names>N</given-names>
            </name>
            <name name-style="western">
              <surname>Parmar</surname>
              <given-names>N</given-names>
            </name>
          </person-group>
          <article-title>Attention is all you need</article-title>
          <source>ArXiv.</source>
          <comment>Preprint posted online on June 12, 2017.
            <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="https://arxiv.org/abs/1706.03762"/>
          </comment>
        </nlm-citation>
      </ref>
      <ref id="ref30">
        <label>30</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Yin</surname>
              <given-names>P</given-names>
            </name>
            <name name-style="western">
              <surname>Neubig</surname>
              <given-names>G</given-names>
            </name>
          </person-group>
          <article-title>A syntactic neural model for general-purpose code generation</article-title>
          <year>2017</year>
          <conf-name>Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics</conf-name>
          <conf-date>2017</conf-date>
          <conf-loc>Vancouver</conf-loc>
          <pub-id pub-id-type="doi">10.18653/v1/p17-1041</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref31">
        <label>31</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Yin</surname>
              <given-names>P</given-names>
            </name>
            <name name-style="western">
              <surname>Neubig</surname>
              <given-names>G</given-names>
            </name>
          </person-group>
          <article-title>A transition-based neural abstract syntax parser for semantic parsing and code generation</article-title>
          <year>2018</year>
          <conf-name>Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing</conf-name>
          <conf-date>2018</conf-date>
          <conf-loc>Brussels</conf-loc>
          <pub-id pub-id-type="doi">10.18653/v1/d18-2002</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref32">
        <label>32</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Liang</surname>
              <given-names>C</given-names>
            </name>
            <name name-style="western">
              <surname>Berant</surname>
              <given-names>J</given-names>
            </name>
          </person-group>
          <article-title>Neural symbolic machines: learning semantic parsers on freebase with weak supervision</article-title>
          <year>2017</year>
          <conf-name>Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics</conf-name>
          <conf-date>2017</conf-date>
          <conf-loc>Vancouver</conf-loc>
          <pub-id pub-id-type="doi">10.18653/v1/p17-1003</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref33">
        <label>33</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Lin</surname>
              <given-names>C</given-names>
            </name>
            <name name-style="western">
              <surname>Hovy</surname>
              <given-names>E</given-names>
            </name>
          </person-group>
          <article-title>Manual and automatic evaluation of summaries</article-title>
          <year>2002</year>
          <conf-name>Proceedings of the ACL-02 Workshop on Automatic Summarization</conf-name>
          <conf-date>2002</conf-date>
          <conf-loc>Phildadelphia</conf-loc>
          <pub-id pub-id-type="doi">10.3115/1118162.1118168</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref34">
        <label>34</label>
        <nlm-citation citation-type="book">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Solar-Lezama</surname>
              <given-names>A</given-names>
            </name>
          </person-group>
          <source>Program synthesis by sketching [Thesis]</source>
          <year>2008</year>
          <month>12</month>
          <day>18</day>
          <publisher-loc>Berkeley</publisher-loc>
          <publisher-name>University of California, Berkeley</publisher-name>
        </nlm-citation>
      </ref>
      <ref id="ref35">
        <label>35</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Bornholt</surname>
              <given-names>J</given-names>
            </name>
            <name name-style="western">
              <surname>Torlak</surname>
              <given-names>E</given-names>
            </name>
            <name name-style="western">
              <surname>Grossman</surname>
              <given-names>D</given-names>
            </name>
          </person-group>
          <article-title>Optimizing synthesis with metasketches</article-title>
          <year>2016</year>
          <conf-name>Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages</conf-name>
          <conf-date>2016</conf-date>
          <conf-loc>St. Petersburg</conf-loc>
          <pub-id pub-id-type="doi">10.1145/2837614.2837666</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref36">
        <label>36</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Dong</surname>
              <given-names>L</given-names>
            </name>
            <name name-style="western">
              <surname>Lapata</surname>
              <given-names>M</given-names>
            </name>
          </person-group>
          <article-title>Coarse-to-fine decoding for neural semantic parsing</article-title>
          <year>2018</year>
          <conf-name>Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics</conf-name>
          <conf-date>2018</conf-date>
          <conf-loc>Melbourne</conf-loc>
          <pub-id pub-id-type="doi">10.18653/v1/p18-1068</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref37">
        <label>37</label>
        <nlm-citation citation-type="confproc">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Kingma</surname>
              <given-names>D</given-names>
            </name>
            <name name-style="western">
              <surname>Ba</surname>
              <given-names>J</given-names>
            </name>
          </person-group>
          <article-title>Adam: a method for stochastic optimization</article-title>
          <year>2015</year>
          <conf-name>The 3rd International Conference on Learning Representations</conf-name>
          <conf-date>2015</conf-date>
          <conf-loc>San Diego</conf-loc>
        </nlm-citation>
      </ref>
      <ref id="ref38">
        <label>38</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Paszke</surname>
              <given-names>A</given-names>
            </name>
            <name name-style="western">
              <surname>Gross</surname>
              <given-names>S</given-names>
            </name>
            <name name-style="western">
              <surname>Massa</surname>
              <given-names>F</given-names>
            </name>
          </person-group>
          <article-title>Pytorch: an imperative style, high-performance deep learning library</article-title>
          <source>ArXiv.</source>
          <comment>Preprint posted online on December 3, 2019.
            <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="https://arxiv.org/abs/1912.01703"/>
          </comment>
        </nlm-citation>
      </ref>
      <ref id="ref39">
        <label>39</label>
        <nlm-citation citation-type="web">
          <source>Code at GitHub: pan915/MedTS</source>
          <access-date>2021-11-06</access-date>
          <comment>
            <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="https://github.com/pan915/MedTS">https://github.com/pan915/MedTS</ext-link>
          </comment>
        </nlm-citation>
      </ref>
      <ref id="ref40">
        <label>40</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Zhang</surname>
              <given-names>Y</given-names>
            </name>
            <name name-style="western">
              <surname>Chen</surname>
              <given-names>Q</given-names>
            </name>
            <name name-style="western">
              <surname>Yang</surname>
              <given-names>Z</given-names>
            </name>
            <name name-style="western">
              <surname>Lin</surname>
              <given-names>H</given-names>
            </name>
            <name name-style="western">
              <surname>Lu</surname>
              <given-names>Z</given-names>
            </name>
          </person-group>
          <article-title>BioWordVec: improving biomedical word embeddings with subword information and MeSH</article-title>
          <source>Sci Data</source>
          <year>2019</year>
          <month>05</month>
          <day>10</day>
          <volume>6</volume>
          <issue>1</issue>
          <fpage>1</fpage>
          <lpage>9</lpage>
          <comment>
            <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="https://doi.org/10.1038/s41597-019-0055-0"/>
          </comment>
          <pub-id pub-id-type="doi">10.1038/s41597-019-0055-0</pub-id>
          <pub-id pub-id-type="medline">31076572</pub-id>
          <pub-id pub-id-type="pii">10.1038/s41597-019-0055-0</pub-id>
          <pub-id pub-id-type="pmcid">PMC6510737</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref41">
        <label>41</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Huang</surname>
              <given-names>K</given-names>
            </name>
            <name name-style="western">
              <surname>Altosaar</surname>
              <given-names>J</given-names>
            </name>
            <name name-style="western">
              <surname>Ranganath</surname>
              <given-names>R</given-names>
            </name>
          </person-group>
          <article-title>ClinicalBERT: modeling clinical notes and predicting hospital readmission</article-title>
          <source>ArXiv.</source>
          <comment>Preprint posted online on April 10, 2019.
            <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="https://arxiv.org/abs/1904.05342"/>
          </comment>
          <pub-id pub-id-type="doi">10.1090/mbk/121/79</pub-id>
        </nlm-citation>
      </ref>
      <ref id="ref42">
        <label>42</label>
        <nlm-citation citation-type="journal">
          <person-group person-group-type="author">
            <name name-style="western">
              <surname>Lee</surname>
              <given-names>J</given-names>
            </name>
            <name name-style="western">
              <surname>Yoon</surname>
              <given-names>W</given-names>
            </name>
            <name name-style="western">
              <surname>Kim</surname>
              <given-names>S</given-names>
            </name>
            <name name-style="western">
              <surname>Kim</surname>
              <given-names>D</given-names>
            </name>
            <name name-style="western">
              <surname>Kim</surname>
              <given-names>S</given-names>
            </name>
            <name name-style="western">
              <surname>So</surname>
              <given-names>CH</given-names>
            </name>
            <name name-style="western">
              <surname>Kang</surname>
              <given-names>J</given-names>
            </name>
          </person-group>
          <article-title>BioBERT: a pre-trained biomedical language representation model for biomedical text mining</article-title>
          <source>Bioinformatics</source>
          <year>2020</year>
          <month>02</month>
          <day>15</day>
          <volume>36</volume>
          <issue>4</issue>
          <fpage>1234</fpage>
          <lpage>1240</lpage>
          <pub-id pub-id-type="doi">10.1093/bioinformatics/btz682</pub-id>
          <pub-id pub-id-type="medline">31501885</pub-id>
          <pub-id pub-id-type="pii">5566506</pub-id>
        </nlm-citation>
      </ref>
    </ref-list>
  </back>
</article>
