Parsing natural language questions into executable logical forms is a useful and interpretable way to perform question answering on structured data such as knowledge bases (KB) or databases (DB). However, existing approaches on semantic parsing cannot adapt to both modalities, as they suffer from the exponential growth of the logical form candidates and can hardly generalize to unseen data. In this work, we propose Uni-Parser, a unified semantic parser for question answering (QA) on both KB and DB. We introduce the primitive (relation and entity in KB, and table name, column name and cell value in DB) as an essential element in our framework. The number of primitives grows linearly with the number of retrieved relations in KB and DB, preventing us from dealing with exponential logic form candidates. We leverage the generator to predict final logical forms by altering and composing topranked primitives with different operations (e.g. select, where, count). With sufficiently pruned search space by a contrastive primitive ranker, the generator is empowered to capture the composition of primitives enhancing its generalization ability. We achieve competitive results on multiple KB and DB QA benchmarks more efficiently, especially in the compositional and zero-shot settings.
翻译:将自然语言问题分解为可执行的逻辑形式是一种有用和可解释的方法,可以用来对结构化数据(如知识基础(KB)或数据库(DB))进行回答。然而,语义分解的现有方法无法适应两种模式,因为它们受到逻辑形式候选人的指数增长的影响,并且很难向不可见的数据概括。在这项工作中,我们提议一个统一的语义解解析器Uni-Parker,用于KB和DB的问答(QA) 。我们引入原始(KB中的关系和实体,以及DB中的表格名称、列名和单元格值)作为我们框架中的一个基本元素。原始数随着在 KB 和 DB 中检索到的关系数量而成线性增长,阻止我们与指数逻辑形式候选人打交道。我们利用发电机来预测最终的逻辑形式,通过不同的操作(例如选择、计算) 来改变和组合上层的原始(QA) 。通过对比性原始排序器,发电机能够捕捉到最原始的搜索空间,从而能够捕捉到其原始结构的构成,特别是V级。我们取得竞争性结果。