Answering questions over domain-specific graphs requires a tailored approach due to the limited number of relations and the specific nature of the domain. Our approach integrates classic logical programming languages into large language models (LLMs), enabling the utilization of logical reasoning capabilities to tackle the KGQA task. By representing the questions as Prolog queries, which are readable and near close to natural language in representation, we facilitate the generation of programmatically derived answers. To validate the effectiveness of our approach, we evaluate it using a well-known benchmark dataset, MetaQA. Our experimental results demonstrate that our method achieves accurate identification of correct answer entities for all test questions, even when trained on a small fraction of annotated data. Overall, our work presents a promising approach to addressing question answering over domain-specific graphs, offering an explainable and robust solution by incorporating logical programming languages.
翻译:针对领域特定图谱的问答需采用定制化方法,原因在于此类图谱中关系数量有限且领域属性鲜明。本研究将经典逻辑编程语言整合至大语言模型,通过发挥逻辑推理能力来解决知识图谱问答任务。通过将问题表示为Prolog查询(该表示方式兼具可读性与接近自然语言的特性),我们实现了程序化答案的生成。为验证方法有效性,我们采用基准数据集MetaQA进行评估。实验结果表明,即使仅使用少量标注数据训练,该方法仍能准确识别所有测试问题的正确答案实体。总体而言,本研究通过融合逻辑编程语言,为领域特定图谱问答提供了兼具可解释性与鲁棒性的可行方案。