{"title":"使用混合编码器-解码器和交叉注意模型增强SPARQL问答查询生成","authors":"Yi-Hui Chen , Eric Jui-Lin Lu , Kwan-Ho Cheng","doi":"10.1016/j.websem.2025.100869","DOIUrl":null,"url":null,"abstract":"<div><div>A question-answering (QA) system is essential for helping users retrieve relevant and accurate answers based on their queries. The precision of SPARQL query syntax generation is directly linked to the accuracy of the answers provided. Recently, many studies on knowledge graph-based natural language question-answering (KGQA) systems have leveraged the Neural Machine Translation (NMT) framework to translate input questions into SPARQL query syntax, a process known as Text-to-SPARQL. In NMT, cross-attention-based Transformers, ConvS2S, and BiLSTM models are commonly used for training. However, comparing the translation performance of these models is challenging due to their significant architectural differences. To address this issue, this paper integrates various encoder and cross-attention methods with a fixed LSTM decoder to form hybrid models, which are then trained and evaluated on QA systems. Beyond the hybrid models discussed, this study introduces an improved ConvS2S architecture featuring a Multi-Head Convolutional (MHC) encoder, designated as QAWizer_MHC. The MHC encoder incorporates the Transformer’s multi-head attention mechanism to compute dependencies within the input sequence. Additionally, the enhanced ConvS2S model captures local hidden features across different receptive fields within the input sequence. Experimental results demonstrate that QAWizer_MHC outperforms other models, achieving BLEU-1 scores of 76.52% and 83.37% on the QALD-9 and LC-QuAD-1.0 datasets, respectively. Furthermore, in end-to-end system evaluations on the same datasets, the model attained Macro F1 scores of 52% and 66%, respectively, surpassing other KGQA systems. The experimental findings indicate that even with limited computational resources and general embeddings, a well-designed encoder–decoder architecture that integrates cross-attention can achieve performance comparable to large pre-trained models.</div></div>","PeriodicalId":49951,"journal":{"name":"Journal of Web Semantics","volume":"87 ","pages":"Article 100869"},"PeriodicalIF":3.1000,"publicationDate":"2025-07-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Enhancing SPARQL query generation for question answering with a hybrid encoder–decoder and cross-attention model\",\"authors\":\"Yi-Hui Chen , Eric Jui-Lin Lu , Kwan-Ho Cheng\",\"doi\":\"10.1016/j.websem.2025.100869\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><div>A question-answering (QA) system is essential for helping users retrieve relevant and accurate answers based on their queries. The precision of SPARQL query syntax generation is directly linked to the accuracy of the answers provided. Recently, many studies on knowledge graph-based natural language question-answering (KGQA) systems have leveraged the Neural Machine Translation (NMT) framework to translate input questions into SPARQL query syntax, a process known as Text-to-SPARQL. In NMT, cross-attention-based Transformers, ConvS2S, and BiLSTM models are commonly used for training. However, comparing the translation performance of these models is challenging due to their significant architectural differences. To address this issue, this paper integrates various encoder and cross-attention methods with a fixed LSTM decoder to form hybrid models, which are then trained and evaluated on QA systems. Beyond the hybrid models discussed, this study introduces an improved ConvS2S architecture featuring a Multi-Head Convolutional (MHC) encoder, designated as QAWizer_MHC. The MHC encoder incorporates the Transformer’s multi-head attention mechanism to compute dependencies within the input sequence. Additionally, the enhanced ConvS2S model captures local hidden features across different receptive fields within the input sequence. Experimental results demonstrate that QAWizer_MHC outperforms other models, achieving BLEU-1 scores of 76.52% and 83.37% on the QALD-9 and LC-QuAD-1.0 datasets, respectively. Furthermore, in end-to-end system evaluations on the same datasets, the model attained Macro F1 scores of 52% and 66%, respectively, surpassing other KGQA systems. The experimental findings indicate that even with limited computational resources and general embeddings, a well-designed encoder–decoder architecture that integrates cross-attention can achieve performance comparable to large pre-trained models.</div></div>\",\"PeriodicalId\":49951,\"journal\":{\"name\":\"Journal of Web Semantics\",\"volume\":\"87 \",\"pages\":\"Article 100869\"},\"PeriodicalIF\":3.1000,\"publicationDate\":\"2025-07-30\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Journal of Web Semantics\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://www.sciencedirect.com/science/article/pii/S1570826825000101\",\"RegionNum\":3,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q3\",\"JCRName\":\"COMPUTER SCIENCE, ARTIFICIAL INTELLIGENCE\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Web Semantics","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S1570826825000101","RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, ARTIFICIAL INTELLIGENCE","Score":null,"Total":0}
Enhancing SPARQL query generation for question answering with a hybrid encoder–decoder and cross-attention model
A question-answering (QA) system is essential for helping users retrieve relevant and accurate answers based on their queries. The precision of SPARQL query syntax generation is directly linked to the accuracy of the answers provided. Recently, many studies on knowledge graph-based natural language question-answering (KGQA) systems have leveraged the Neural Machine Translation (NMT) framework to translate input questions into SPARQL query syntax, a process known as Text-to-SPARQL. In NMT, cross-attention-based Transformers, ConvS2S, and BiLSTM models are commonly used for training. However, comparing the translation performance of these models is challenging due to their significant architectural differences. To address this issue, this paper integrates various encoder and cross-attention methods with a fixed LSTM decoder to form hybrid models, which are then trained and evaluated on QA systems. Beyond the hybrid models discussed, this study introduces an improved ConvS2S architecture featuring a Multi-Head Convolutional (MHC) encoder, designated as QAWizer_MHC. The MHC encoder incorporates the Transformer’s multi-head attention mechanism to compute dependencies within the input sequence. Additionally, the enhanced ConvS2S model captures local hidden features across different receptive fields within the input sequence. Experimental results demonstrate that QAWizer_MHC outperforms other models, achieving BLEU-1 scores of 76.52% and 83.37% on the QALD-9 and LC-QuAD-1.0 datasets, respectively. Furthermore, in end-to-end system evaluations on the same datasets, the model attained Macro F1 scores of 52% and 66%, respectively, surpassing other KGQA systems. The experimental findings indicate that even with limited computational resources and general embeddings, a well-designed encoder–decoder architecture that integrates cross-attention can achieve performance comparable to large pre-trained models.
期刊介绍:
The Journal of Web Semantics is an interdisciplinary journal based on research and applications of various subject areas that contribute to the development of a knowledge-intensive and intelligent service Web. These areas include: knowledge technologies, ontology, agents, databases and the semantic grid, obviously disciplines like information retrieval, language technology, human-computer interaction and knowledge discovery are of major relevance as well. All aspects of the Semantic Web development are covered. The publication of large-scale experiments and their analysis is also encouraged to clearly illustrate scenarios and methods that introduce semantics into existing Web interfaces, contents and services. The journal emphasizes the publication of papers that combine theories, methods and experiments from different subject areas in order to deliver innovative semantic methods and applications.