Querying Nosql with Deep Learning to Answer Natural Language Questions

Querying Nosql with Deep Learning to Answer Natural Language Questions

The Thirty-First AAAI Conference on Innovative Applications of Artificial Intelligence (IAAI-19) Querying NoSQL with Deep Learning to Answer Natural Language Questions Sebastian Blank,1 Florian Wilhelm,1 Hans-Peter Zorn,1 Achim Rettinger2 inovex GmbH,1 Karlsruhe Institute of Technology,2 [email protected], [email protected], [email protected], [email protected] Abstract To enable the application of a KBQueryBot in real-world use-cases, it needs to satisfy two conditions. Firstly, it needs Almost all of today’s knowledge is stored in databases and to be trainable in an end-to-end fashion. Labelled data is thus can only be accessed with the help of domain spe- cific query languages, strongly limiting the number of peo- always a scarce resource and any kind of additional inter- ple which can access the data. In this work, we demonstrate mediate labelling to fulfil this task is too costly for practi- an end-to-end trainable question answering (QA) system that cal applications since it requires expert knowledge about the allows a user to query an external NoSQL database by us- query language and scales poorly (Liang et al. 2016). On the ing natural language. A major challenge of such a system other hand, judging the correctness of a retrieved result can is the non-differentiability of database operations which we be conducted having only domain knowledge and thus even overcome by applying policy-based reinforcement learning. active learning-powered techniques can be applied. We evaluate our approach on Facebook’s bAbI Movie Dialog Typically, there are two different ways how to interact dataset and achieve a competitive score of 84.2% compared to several benchmark models. We conclude that our approach with a KB. Agents can either query an external KB with excels with regard to real-world scenarios where knowledge the corresponding query language or make use of an inter- resides in external databases and intermediate labels are too nal memory that allows for more flexible means of lookups, costly to gather for non-end-to-end trainable QA systems. e.g. probabilistic lookup. This requires a conversion of the externally available database into the internal memory ren- dering the user management and access control capabilities Introduction of modern databases useless. However, lacking these capa- Almost all of today’s knowledge is stored and organized bilities results in severe issues regarding data security and in various types of databases but the ability to access this privacy. Therefore, our second requirement is that a KB- knowledge is limited to the ones who have mastered the cor- QueryBot needs to cope with today’s prevalent databases responding query language. Conversational agents promise like Elasticsearch, MongoDB and PostgreSQL. to overcome this barrier by allowing humans to query these This work contributes to engineering efforts to establish resources with natural language thus fostering the democra- a standard machine learning model and training procedure tization of knowledge. The broad domain of conversational for all kinds of structured database queries via natural lan- agents can be further subdivided by looking at the complex- guage questions. We propose a KBQueryBot which relies ity of human-machine interaction. Goal-oriented dialog sys- on a sequence-to-sequence model (Sutskever, Vinyals, and tems follow the purpose of gaining information through con- Le 2014) that is augmented with pointer attention (Bah- versation in order to complete a specific task. Hence, they danau, Cho, and Bengio 2014; Vinyals, Fortunato, and Jaitly are typically applied in short dialogs that are domain spe- 2015). We apply the REINFORCE-algorithm (Williams cific. In contrast, non-goal-oriented agents are designed to 1992) which enables us to overcome the problem of non- have extended conversations without any restriction to a spe- differentiable database operations and train our model on cific domain. question-answer pairs. Our approach is closely related to In our opinion, both categories represent long-term goals Zhong, Xiong, and Socher (2017) and also uses policy gra- in artificial intelligence, but they depend on the practical fea- dient but differs in avoiding the usage of intermediate la- sibility of another type of natural language processing (NLP) bels. Our model integrates with Elasticsearch (ES) which is task that is much simpler. We define a KBQueryBot as an one of the most popular NoSQL databases1 and dominant in agent that fulfils the task of translating a query, posed in nat- search-related applications. Typically, users query ES with ural language, into the domain-specific query language of the help of graphical user interfaces designed for the spe- an external knowledge base (KB) in order to retrieve factoid cific use-case. However, we notice an increased interest of answers in a single-shot manner. This task can also be seen business customers to make their KBs accessible by natural as a semantic parsing problem. language input to provide an improved user experience. Copyright c 2019, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. 1https://db-engines.com/en/ranking 9416 Related Work In the same manner, Zhong, Xiong, and Socher (2017) as- Since the task of a KBQueryBot is to reformulate a single sume the availability of the query ground truth (intermediate user question into a corresponding structured query, it can labels) and the database response. They propose Seq2SQL, be qualified as a specialised QA system which does not take which is a modular approach to translate natural language into account any dialog history. As the focus of our work questions into SQL queries and generalizes across different lies on the retrieval of data stored in an external KB, it can table schemas. Seq2SQL consists of three modules. The first clearly be separated from QA systems that only leverage di- module is responsible to identify an aggregator, e.g. count or alog history to answer a question (Eric and Manning 2017). max, while the second module identifies the column that will Recent QA systems that incorporate external knowledge be used in the select operator. Both modules are trained on can be distinguished by the way they perform the actual question-query pairs. The third module is designed to pro- lookup. Dhingra et al. (2016) proposed the term soft-KB duce the where-clause. Since arguments in the where-clause lookup for using an attention mechanism as introduced by can be swapped, this ambiguity is handled by policy-based Bahdanau, Cho, and Bengio (2014) to compute a probability reinforcement learning trained on question-answer pairs di- distribution over the index of the KB. The index with the rectly. Our work resembles their architecture but uses only highest probability is then retrieved and the corresponding reinforcement learning to achieve end-to-end trainability. data presented as result. In contrast, generating a structured The work of Williams and Zweig (2016) applies policy- query which is then executed is known as hard-KB lookup. based reinforcement without intermediate labels in task- oriented dialog system. It translates human commands into Soft-KB lookup. Memory Networks (MemNN) repre- API calls also taken into account the dialog history. Our sent a neural architecture that is extended with an inter- work differs in that no separately trained entity extraction nal memory component (Weston, Chopra, and Bordes 2014; is needed and the resulting query is solely based on the Sukhbaatar et al. 2015). Bordes et al. (2015) proposed their user’s input without needing any additional predefined busi- application for soft-KB lookup by ingesting the external ness logic. KB into the internal memory in a pre-processing step. They showed promising performance against multiple benchmark Model models, second only to a subgraph embedding based QA system by Bordes, Chopra, and Weston (2014), on the large- The overall architecture of our SeqPolicyNet model which scale and domain specific Movie Dialog dataset (Dodge et solves the introduced KBQueryBot task is illustrated in Fig- al. 2015). Miller et al. (2016) confirmed the qualities of ure 1. The core component is an attention-based pointer net- MemNN in another benchmark on a modified Movie Dia- work (Sutskever, Vinyals, and Le 2014) which fills slots of log dataset where MemNN even outperformed the QA sys- a predefined ES query template. The fixed-length output se- tem by Bordes, Chopra, and Weston (2014). Due to these quence is composed of elements which either select a col- promising results, we use MemNNs as a benchmark for our umn name of the KB or point to a token of the question for hard-KB approach on the same dataset. entity extraction. Thus, we will refer to them as selection or Dhingra et al. (2016) introduced KB-InfoBot which extraction outputs. With the help two extraction outputs act- also performs a soft-KB lookup, but its lookup policy is ing as start and end pointer, it is thus possible to extract an trained with reinforcement learning similar to our work. entity composed by a span of tokens. For instance, given the They observed that their model tends to fail from random question ”Who was the director of Gone With the Wind?” initialization and overcame this problem by using imitation the start pointer would be Gone and the end pointer Wind. learning to mimic hand-crafted agents. This required Our model can thus be seen as a pointer network for entity human interaction diminishes the advantage of end-to-end extraction (Zhong, Xiong, and Socher 2017) with reduced trainability. complexity. Hard-KB lookup. Non-differentiable database opera- Pointer Network tions are the major shortcoming of hard-KB lookup, since As input SeqPolicyNet receives the natural language ques- they complicate the end-to-end trainability of the corre- tions xq and the columns xc of the KB which are lowercased sponding models.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    6 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us