arXiv:2410.00414cs.CL2024-10被引 3

用候选表达式增强语法,提升知识库问答的解析准确率与速度

Semantic Parsing with Candidate Expressions for Knowledge Base Question Answering

  • 引入候选表达式约束语法,指导模型生成符合知识库的逻辑形式
  • 在KQA Pro和Overnight数据集上,准确率显著提升,尤其在弱监督下
  • 通过子类型推理与缓存掩码,解码速度大幅提高,适合实际部署

语义解析器将自然语言转换为逻辑形式,可在知识库(KB)上求值以生成答案。现有方法多基于序列到序列预训练语言模型,将逻辑形式视为词元序列,并通过语法进行约束解码。然而,这些语法无法有效利用知识库中的大量信息,尽管逻辑形式包含实体或关系等KB元素。本文提出一种增强候选表达式的语法,用于大规模知识库上的语义解析。该语法将动作定义为产生规则,模型在推理时依据类型和候选表达式进行约束预测。我们将其应用于知识库问答任务,候选表达式约束帮助模型生成有效的KB元素。引入子类型推断、并集类型两种特殊规则及掩码缓存算法,显著提升解码速度。在KQA Pro和Overnight两个基准测试中,无论强监督或弱监督训练,候选表达式均提升了准确率,且解码速度快。源代码已公开于https://github.com/daehwannam/candexpr-sp.git。

原文摘要 · Abstract (English)

Semantic parsers convert natural language to logical forms, which can be evaluated on knowledge bases (KBs) to produce denotations. Recent semantic parsers have been developed with sequence-to-sequence (seq2seq) pre-trained language models (PLMs) or large language models, where the models treat logical forms as sequences of tokens. For syntactic and semantic validity, the semantic parsers use grammars that enable constrained decoding. However, the grammars lack the ability to utilize large information of KBs, although logical forms contain representations of KB elements, such as entities or relations. In this work, we propose a grammar augmented with candidate expressions for semantic parsing on a large KB with a seq2seq PLM. The grammar defines actions as production rules, and our semantic parser predicts actions during inference under the constraints by types and candidate expressions. We apply the grammar to knowledge base question answering, where the constraints by candidate expressions assist a semantic parser to generate valid KB elements. We also introduce two special rules, sub-type inference and union types, and a mask caching algorithm. In particular, sub-type inference and the mask caching algorithm greatly increase the decoding speed of our semantic parser. We experimented on two benchmarks, KQA Pro and Overnight, where the constraints by candidate expressions increased the accuracy of our semantic parser, whether it was trained with strong supervision or weak supervision. In addition, our semantic parser had a fast decoding speed in the experiments. Our source code is publicly available at https://github.com/daehwannam/candexpr-sp.git.

语义解析知识库问答语法约束高效解码

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。