Question Answering over Knowledge Graphs (KGQA) is the task of answering natural language questions over a knowledge graph (KG). This task requires a model to reason over multiple edges of the KG to reach the right answer. In this work, we present a method to equip large language models (LLMs) with classic logical programming languages to provide an explainable solution to the problem. Our goal is to extract the representation of the question in the form of a Prolog query, which can then be used to answer the query programmatically. To demonstrate the effectiveness of this approach, we use the MetaQA dataset and show that our method finds the correct answer entities for all the questions in the test dataset.
翻译:基于知识图谱的问答(KGQA)任务是回答针对知识图谱的自然语言问题。该任务要求模型对知识图谱中的多条边进行推理以得出正确答案。本研究提出一种方法,将大型语言模型(LLMs)与传统逻辑编程语言相结合,为这一问题提供可解释的解决方案。我们的目标是提取问题的Prolog查询表示形式,进而通过编程方式回答该查询。为验证该方法的有效性,我们使用MetaQA数据集进行实验,结果表明本方法能够为测试数据集中的所有问题找到正确的答案实体。