<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Fine-grained Complex Question Translation for KBQA</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Guangxi Ji</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Shujun Wang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ding Zhang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Xiaowang Zhang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Zhiyong Feng</string-name>
          <email>zyfengg@tju.edu.cn</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>College of Intelligence and Computing, Tianjin University</institution>
          ,
          <addr-line>Tianjin 300350</addr-line>
          ,
          <country country="CN">China</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>guangxiji</institution>
          ,
          <addr-line>shujunwang, zhangdingTJU, xiaowangzhang, zyfeng</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>Translating natural language questions into SPARQL queries is a signi cant challenge of semantic parsing based KBQA due to the gap between their representations. In this paper, we designed a ne-grained complex question answering framework for KBQA, including a semantic similarity model and a neural machine translation model. Based on the above two models, we present a complex question processing algorithm to transform questions into subqueries and then process them parallelly. The experiments evaluated on benchmark datasets show that our approach is signi cantly e ective.</p>
      </abstract>
      <kwd-group>
        <kwd>Question Answering</kwd>
        <kwd>Question Decomposition</kwd>
        <kwd>Semantic</kwd>
        <kwd>Textual Similarity</kwd>
        <kwd>Neural Machine Translation</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Knowledge Base Question=Answering(KBQA) system can automatically answer
questions asked in natural language over the knowledge base. A widely used
approach is to translate natural language questions into SPARQL queries so that
the question can be answered by executing its corresponding query. However, it
has become a challenge as there is a gap in their representation. The existing
methods based on semantic parsing or templates require a large number of
highquality rules or templates constructed manually or automatically. The matching
restrictions based on strings and structures are relatively strict [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ][
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Other
methods using neural machine translation models fail to identify and link unseen
entities to corresponding knowledge base entities [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>In this paper, we propose a semantic similarity model to decompose a
complex question into several simple subquestions to achieve ne-grained
translation. Here we nd the question pattern similar to subquestion on the semantic
level. Next, we translate these subquestions in parallel using our neural
machine translation(NMT) model and nally assemble the subqueries to obtain the
corresponding complete SPARQL query.</p>
    </sec>
    <sec id="sec-2">
      <title>Approach</title>
      <p>Our approach for complex question answering, shown in Fig.1, can be divided
into 5 steps.</p>
      <p>q: Where was the wife of</p>
      <p>Donald Trump born?</p>
      <p>entity replacement
qty: W_hPeerresowna_sbtohrenw?ife of</p>
      <p>Donald Trump</p>
      <p>SS
Model</p>
      <p>Question
Pattern
Corpus</p>
      <p>Novo_Mesto
Knowledge</p>
      <p>Graph</p>
      <p>SELECT ?city WHERE
{ ?person spouse Donald_Trump .
?person birthPlace ?city .}
query formulation
q1: the wife of _Person_ p1: Who is the spouse of _Person_
q2: Where was _PersoDno_nbalodrTnr?ump sscieommmiaplanartriiitcsyon p2: Where was _PersoDno_nbalodrTnr?ump tnmreaauncrshalialnteion s2: ?person birthPlace ?city
s1: ?person spouse Donald_Trump
Complex Question Decomposition</p>
      <p>Step(1) Named Entity Replacement. We focus on the structure
information of natural language questions. Speci cally, we use the named entity linking
tools to identify and replace the entities in the question with their corresponding
entity classes in the knowledge base to get the question pattern, which represents
a kind of question.</p>
      <p>Step(2) Semantic Similarity-based Question Decomposition. The
decomposed subquestions may be incomplete, that is, some components are
missing. It may be wrong to translate them directly into SPARQL queries. Therefore,
we present a semantic similarity model based on the siamese network
architecture to nd the most semantically similar standard question. Speci cally, given a
question q, we transform it into a xed-size embedding by adding a pooling layer
after BERT. Having these embeddings, we can use cosine-similarity to calculate
the semantic similarity between questions. Finally, we use mean squared-error
loss as the objective function, making the semantic similarity question closer.</p>
      <p>
        Similar to Zheng et al[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], the underlying principle of our decomposition
algorithm is to try each subquestion of question q and complete its similarity with
patterns in T , where T is our question pattern corpus. Algorithm 1 presents the
detail of our question decomposition algorithm. Lines 5 to 8 deal with parallel
complex questions, while lines 9 to 18 show the decomposition method of nested
complex questions.
      </p>
      <p>
        Step(3) Neural Machine Translation. Translation methods based on
templates or rules require accurate matching, while neural machine translation
has better generalization. We use the Transformer-based neural machine
translation model, which is mainly composed of two parts: question &amp; query encoding
and translation. The former models the semantics of question and query into
the embedding representation so that the transformer model could transfer
semantic information between di erent expressions. Here, we follow the encoding
approach suggested by Soru et al.[
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Note that, unlike Sour et al.[
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], which input
a complete natural language question and output the corresponding SPARQL
query, our model inputs the simple question pattern and output its
corresponding triple pattern, which e ectively solves the linking problem of entities that
have never appeared before and improves the accuracy of translation.
      </p>
      <p>Step(4) Query Construction. After parsing all simple subquestions of a
complex question, we need to assemble their corresponding triple patterns
together to form a complete SPARQL query to obtain the answer. Algorithm 1
shows that the decomposition of complex questions is orderly. The rst
subquestion can be operated independently, and the others need to use the previous
results as part of its facts. Here we assemble all the triple patterns into a
complete query in the order of decomposition. The variable of the last pattern is
taken as the variable of the SPARQL query. Note that we need to unify the join
variables for triple patterns that have join relationships and replace the entity
class with the real entity.</p>
      <p>Step(5) Query Evaluation. Evaluating the query to get the nal answer.
Algorithm 1: QD(qty, Ten, M, )</p>
      <p>Input: Question pattern qty =fw1, ,wng, Encoded pattern set Ten,</p>
      <p>Semantic Similarity model M and the similarity threshold ;</p>
      <p>Output: The decomposed subquestion patterns P(q)
1 qen M.encode(qty)
2 ( ; t) the maximum similarity between qen and Ten
3 if then
4 return P (q) t
5 if \and",\or",\but", etc. in qty then
6 for qsub in GetSubQuestion(qty) do
7 P (q) P (q)[ QD(qsub, Ten, M, )
8</p>
      <p>return P (q)
9 for i 2 [1,jqtyj] do
10 ei the position of the rst entity class after wi
11 for k 2 [ei,jqtyj] do
12 qsub GetSubstring(qty,i,k)
13 qen0 M.encode(qsub)
14 ( ; t) the maximum similarity between qen0 and Ten
15 if then
16 qty0 replace qsub in qty with the answer type of t
17 if jqty0 j=1 or QD(qty0 , Ten, M, ) 6= NULL then
18 return P (q) P (q) [ t
19 return NULL</p>
    </sec>
    <sec id="sec-3">
      <title>Experiments and Results</title>
      <p>
        The evaluation of our method is performed on three datasets(i.e., LC-QuAD[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ],
QALD-9[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], and ComplexQuestions[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]), using F1 measure as the metric. We use
a large number of simple questions to construct training data. Speci cally, our
training data consists of two parts: the SimpleDBpediaQA[
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] dataset and some
common simple questions collected from WikiAnswers. The former is a
benchmark dataset for simple question answering over knowledge base, which contains
43086 questions and the entities contained in each question. WikiAnswers[
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] is
a large corpus of natural languae questions. For each question, the corresponding
question pattern can be obtained through Step(1).
      </p>
      <p>For the semantic similarity model, we construct many training data in the
form of fp1; p2; sg, where p1 and p2 are two question pattern, here p2 may be a
transformation of p1 (such as changing structure, omitting compoents, replacing
synonyms), the similarity score s is obtained by considering their structure,
words, semantic, etc. For instance, f\who is the spouse of Person ",\the wife
of Person ",1.0 g. Besides, using the existing KBQA system, we can obtain the
sparql query corresponding to each question, and lter out the correct (question
pattern, query pattern) pairs as training data for the neural machine translation
model.</p>
      <p>0:8
0:7
0:6
0:5</p>
      <p>As shown in Table 1, our method achieves better results because we
decompose the question at the semantic level and can obtain each subquestion and its
standard form more accurately. Our method is based on the DBpedia knowledge
base, and others have not been tested on the QALD-9 and LC-QuAD datasets,
so there is no comparison here. From the data shown in Fig 2, our method works
best on the LC-QuAD dataset because templates generate it, so the question
structure is similar and can capture subqueries better. The QALD-9 dataset is
more complex, and its e ect is somewhat di erent from the others. We also study
the in uence of semantic similarity threshold . When is small, some
subsequences are mistakenly considered simple subquestions, resulting in the wrong
decomposition. While is large, some subquestions can not nd the
corresponding question pattern, so the transformation fails. A large number of experiments
show that 0.8 is a better threshold.</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>In this paper, we propose a method to decompose complex questions into
multiple simple subquestions to achieve ne-grained translation using a semantic
similarity model. Here we nd the question pattern similar to subquestion on
the semantic level. In addition, we translate these subquestions in parallel using
the neural machine translation model. We hope that our work can inspire other
applications of deep learning methods in KBQA.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgments</title>
      <p>This work is supported by the National Key Research and Development Program
of China (2017YFC0908401) and the National Natural Science Foundation of
China (61972455). Xiaowang Zhang is supported by the Peiyang Young Scholars
in Tianjin University (2019XRX-0032).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>W.</given-names>
            <surname>Zheng</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Zhang</surname>
          </string-name>
          , \
          <article-title>Question Answering over Knowledge Graphs via Structural Query Patterns"</article-title>
          , arXiv:
          <year>1910</year>
          .09760,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>A.</given-names>
            <surname>Abujabal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Yahya</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Riedewald</surname>
          </string-name>
          , and G. Weikum, \
          <article-title>Automated template generation for question answering over knowledge graphs"</article-title>
          ,
          <source>in Proceedings of the 26th International Conference on World Wide Web (WWW)</source>
          ,
          <year>2017</year>
          , pp.
          <volume>1191</volume>
          {
          <fpage>1200</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>X.</given-names>
            <surname>Yin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Gormann</surname>
          </string-name>
          and
          <string-name>
            <given-names>S.</given-names>
            <surname>Rudolph</surname>
          </string-name>
          , \
          <article-title>Neural Machine Translating from Natural Language to SPARQL"</article-title>
          , in arXiv:
          <year>1906</year>
          .09302,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>W.</given-names>
            <surname>Zheng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. X.</given-names>
            <surname>Yu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Zou</surname>
          </string-name>
          , and H. Cheng, \
          <article-title>Question answering over knowledge graphs: Question understanding via template decomposition"</article-title>
          ,
          <source>in Proceedings of the VLDB Endowment</source>
          , vol.
          <volume>11</volume>
          , no.
          <issue>11</issue>
          , pp.
          <volume>1373</volume>
          {
          <issue>1386</issue>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>P.</given-names>
            <surname>Trivedi</surname>
          </string-name>
          , G. Maheshwari,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dubey</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Lehmann</surname>
          </string-name>
          , \
          <article-title>LC-QuAD: A Corpus for Complex Question Answering over Knowledge Graphs"</article-title>
          ,
          <source>in 16th International Semantic Web Conference</source>
          , pp.
          <volume>210</volume>
          {
          <issue>218</issue>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>R.</given-names>
            <surname>Usbeck</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. H.</given-names>
            <surname>Gusmita</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. C. N.</given-names>
            <surname>Ngomo</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Saleem</surname>
          </string-name>
          , \
          <article-title>9th Challenge on Question Answering over Linked Data (QALD-9)"</article-title>
          , in 17th International Semantic Web Conference, pp.
          <volume>58</volume>
          {
          <issue>64</issue>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>H.</given-names>
            <surname>Bast</surname>
          </string-name>
          , E. Haussmann,\
          <source>Proceedings of the 24th ACM International on Conference on Information and Knowledge Management," in Proceedings of the 24th ACM International on Conference on Information and Knowledge Management</source>
          ,
          <year>2015</year>
          , pp.
          <volume>1431</volume>
          {
          <fpage>1440</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>T.</given-names>
            <surname>Soru</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Marx</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Moussallem</surname>
          </string-name>
          and
          <string-name>
            <given-names>G.</given-names>
            <surname>Publio</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Valdestilhas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Esteves</surname>
          </string-name>
          ,
          <string-name>
            <surname>C.</surname>
          </string-name>
          <article-title>Baron Neto, \SPARQL as a Foreign Language,"</article-title>
          <source>in SEMANTiCS</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>M.</given-names>
            <surname>Azmy</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Shi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Lin</surname>
          </string-name>
          and
          <string-name>
            <given-names>I. F.</given-names>
            <surname>Ilyas</surname>
          </string-name>
          , \
          <article-title>Farewell Freebase: Migrating the SimpleQuestions Dataset to DBpedia,"</article-title>
          <source>in Proceedings of the 27th International Conference on Computational Linguistics</source>
          , pp.
          <year>2093</year>
          {
          <volume>2103</volume>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>A.</given-names>
            <surname>Fader</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L. S.</given-names>
            <surname>Zettlemoyer</surname>
          </string-name>
          , and
          <string-name>
            <given-names>O.</given-names>
            <surname>Etzioni</surname>
          </string-name>
          . \
          <article-title>Paraphrase-Driven Learning for Open Question Answering"</article-title>
          ,
          <string-name>
            <surname>in</surname>
            <given-names>ACL</given-names>
          </string-name>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>