Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
169 tokens/sec
GPT-4o
7 tokens/sec
Gemini 2.5 Pro Pro
45 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
38 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

A Comprehensive Evaluation of Neural SPARQL Query Generation from Natural Language Questions (2304.07772v3)

Published 16 Apr 2023 in cs.CL and cs.LG

Abstract: In recent years, the field of neural machine translation (NMT) for SPARQL query generation has witnessed significant growth. Incorporating the copy mechanism with traditional encoder-decoder architectures and using pre-trained encoder-decoders and LLMs have set new performance benchmarks. This paper presents various experiments that replicate and expand upon recent NMT-based SPARQL generation studies, comparing pre-trained LLMs (PLMs), non-pre-trained LLMs (NPLMs), and LLMs, highlighting the impact of question annotation and the copy mechanism and testing various fine-tuning methods using LLMs. In particular, we provide a systematic error analysis of the models and test their generalization ability. Our study demonstrates that the copy mechanism yields significant performance enhancements for most PLMs and NPLMs. Annotating the data is pivotal to generating correct URIs, with the "tag-within" strategy emerging as the most effective approach. Additionally, our findings reveal that the primary source of errors stems from incorrect URIs in SPARQL queries that are sometimes replaced with hallucinated URIs when using base models. This does not happen using the copy mechanism, but it sometimes leads to selecting wrong URIs among candidates. Finally, the performance of the tested LLMs fell short of achieving the desired outcomes.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (40)
  1. R. Hirigoyen, A. Zouaq, and S. Reyd, “A copy mechanism for handling knowledge base elements in SPARQL neural machine translation,” in Findings of the Association for Computational Linguistics: AACL-IJCNLP 2022.   Online only: Association for Computational Linguistics, Nov. 2022, pp. 226–236. [Online]. Available: https://aclanthology.org/2022.findings-aacl.22
  2. J.-H. Lin and E. J.-L. Lu, “Sparql generation with an nmt-based approach,” Journal of Web Engineering, pp. 1471–1490, 2022.
  3. S. Reyd, A. Zouaq, and P. A. K. K. Diallo, “A comprehensive evaluation of the copy mechanism for natural language to sparql query generation,” arXiv preprint arXiv:2304.07772, 2023.
  4. H. Tran, L. Phan, J. Anibal, B. T. Nguyen, and T.-S. Nguyen, “Spbert: an efficient pre-training bert on sparql queries for question answering over knowledge graphs,” in Neural Information Processing: 28th International Conference, ICONIP 2021, Sanur, Bali, Indonesia, December 8–12, 2021, Proceedings, Part I 28.   Springer, 2021, pp. 512–523.
  5. X. Huang, J.-J. Kim, and B. Zou, “Unseen entity handling in complex question answering over knowledge base via language generation,” in Findings of the Association for Computational Linguistics: EMNLP 2021, 2021, pp. 547–557.
  6. B. B. Naik, T. J. V. R. Reddy, K. R. V. karthik, and P. Kuila, “An sql query generator for cross-domain human language based questions based on nlp model,” Multimedia Tools and Applications, pp. 1–24, 2023.
  7. J. Lehmann, P. Gattogi, D. Bhandiwad, S. Ferré, and S. Vahdati, “Language models as controlled natural language semantic parsers for knowledge graph question answering,” in European Conference on Artificial Intelligence (ECAI), vol. 372.   IOS Press, 2023, pp. 1348–1356.
  8. D. Banerjee, P. A. Nair, J. N. Kaur, R. Usbeck, and C. Biemann, “Modern baselines for sparql semantic parsing,” in Proceedings of the 45th International ACM SIGIR Conference on Research and Development in Information Retrieval, 2022, pp. 2260–2265.
  9. M. Lewis, Y. Liu, N. Goyal, M. Ghazvininejad, A. Mohamed, O. Levy, V. Stoyanov, and L. Zettlemoyer, “BART: denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension,” in Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, D. Jurafsky, J. Chai, N. Schluter, and J. R. Tetreault, Eds.   Association for Computational Linguistics, 2020, pp. 7871–7880. [Online]. Available: https://doi.org/10.18653/v1/2020.acl-main.703
  10. C. Raffel, N. Shazeer, A. Roberts, K. Lee, S. Narang, M. Matena, Y. Zhou, W. Li, and P. J. Liu, “Exploring the limits of transfer learning with a unified text-to-text transformer,” J. Mach. Learn. Res., vol. 21, pp. 140:1–140:67, 2020. [Online]. Available: http://jmlr.org/papers/v21/20-074.html
  11. H. Touvron, T. Lavril, G. Izacard, X. Martinet, M.-A. Lachaux, T. Lacroix, B. Rozière, N. Goyal, E. Hambro, F. Azhar et al., “Llama: Open and efficient foundation language models,” arXiv preprint arXiv:2302.13971, 2023.
  12. B. Roziere, J. Gehring, F. Gloeckle, S. Sootla, I. Gat, X. E. Tan, Y. Adi, J. Liu, T. Remez, J. Rapin et al., “Code llama: Open foundation models for code,” arXiv preprint arXiv:2308.12950, 2023.
  13. F. F. Luz and M. Finger, “Semantic parsing natural language into SPARQL: improving target language representation with neural attention,” CoRR, vol. abs/1803.04329, 2018. [Online]. Available: http://arxiv.org/abs/1803.04329
  14. S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural computation, vol. 9, pp. 1735–80, 12 1997.
  15. T. Soru, E. Marx, D. Moussallem, G. Publio, A. Valdestilhas, D. Esteves, and C. B. Neto, “SPARQL as a foreign language,” in Proceedings of the Posters and Demos Track of the 13th International Conference on Semantic Systems - SEMANTiCS2017 co-located with the 13th International Conference on Semantic Systems (SEMANTiCS 2017), Amsterdam, The Netherlands, September 11-14, 2017, ser. CEUR Workshop Proceedings, J. D. Fernández and S. Hellmann, Eds., vol. 2044.   CEUR-WS.org, 2017. [Online]. Available: http://ceur-ws.org/Vol-2044/paper14/
  16. X. Yin, D. Gromann, and S. Rudolph, “Neural machine translating from natural language to SPARQL,” Future Gener. Comput. Syst., vol. 117, pp. 510–519, 2021. [Online]. Available: https://doi.org/10.1016/j.future.2020.12.013
  17. J. Gehring, M. Auli, D. Grangier, D. Yarats, and Y. N. Dauphin, “Convolutional sequence to sequence learning,” in Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, ser. Proceedings of Machine Learning Research, D. Precup and Y. W. Teh, Eds., vol. 70.   PMLR, 2017, pp. 1243–1252. [Online]. Available: http://proceedings.mlr.press/v70/gehring17a.html
  18. A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin, “Attention is all you need,” in Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, I. Guyon, U. von Luxburg, S. Bengio, H. M. Wallach, R. Fergus, S. V. N. Vishwanathan, and R. Garnett, Eds.   Curran Associates, Inc., 2017, pp. 5998–6008. [Online]. Available: https://proceedings.neurips.cc/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html
  19. P. Trivedi, G. Maheshwari, M. Dubey, and J. Lehmann, “Lc-quad: A corpus for complex question answering over knowledge graphs,” in The Semantic Web - ISWC 2017 - 16th International Semantic Web Conference, Vienna, Austria, October 21-25, 2017, Proceedings, Part II, ser. Lecture Notes in Computer Science, C. d’Amato, M. Fernández, V. A. M. Tamma, F. Lécué, P. Cudré-Mauroux, J. F. Sequeda, C. Lange, and J. Heflin, Eds., vol. 10588.   Springer, 2017, pp. 210–218. [Online]. Available: https://doi.org/10.1007/978-3-319-68204-4_22
  20. A.-K. Hartmann, T. Soru, and E. Marx, “Generating a large dataset for neural question answering over the dbpedia knowledge base,” 04 2018. [Online]. Available: https://www.researchgate.net/publication/324482598_Generating_a_Large_Dataset_for_Neural_Question_Answering_over_the_DBpedia_Knowledge_Base
  21. K. Papineni, S. Roukos, T. Ward, and W. Zhu, “Bleu: a method for automatic evaluation of machine translation,” in Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, July 6-12, 2002, Philadelphia, PA, USA.   ACL, 2002, pp. 311–318. [Online]. Available: https://aclanthology.org/P02-1040/
  22. X. Huang, J.-J. Kim, and B. Zou, “Unseen entity handling in complex question answering over knowledge base via language generation,” in Findings of the Association for Computational Linguistics: EMNLP 2021.   Punta Cana, Dominican Republic: Association for Computational Linguistics, Nov. 2021, pp. 547–557. [Online]. Available: https://aclanthology.org/2021.findings-emnlp.50
  23. J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, “BERT: Pre-training of deep bidirectional transformers for language understanding,” in Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers).   Minneapolis, Minnesota: Association for Computational Linguistics, Jun. 2019, pp. 4171–4186. [Online]. Available: https://aclanthology.org/N19-1423
  24. A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, and I. Sutskever, “Language models are unsupervised multitask learners,” 2019. [Online]. Available: https://d4mucfpksywv.cloudfront.net/better-language-models/language-models.pdf
  25. M. R. A. H. Rony, U. Kumar, R. Teucher, L. Kovriguina, and J. Lehmann, “SGPT: A generative approach for SPARQL query generation from natural language questions,” IEEE Access, vol. 10, pp. 70 712–70 723, 2022. [Online]. Available: https://doi.org/10.1109/ACCESS.2022.3188714
  26. A. See, P. J. Liu, and C. D. Manning, “Get to the point: Summarization with pointer-generator networks,” in Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, ACL 2017, Vancouver, Canada, July 30 - August 4, Volume 1: Long Papers, R. Barzilay and M. Kan, Eds.   Association for Computational Linguistics, 2017, pp. 1073–1083. [Online]. Available: https://doi.org/10.18653/v1/P17-1099
  27. M. Dubey, D. Banerjee, A. Abdelkawi, and J. Lehmann, “Lc-quad 2.0: A large dataset for complex question answering over wikidata and dbpedia,” in The Semantic Web - ISWC 2019 - 18th International Semantic Web Conference, Auckland, New Zealand, October 26-30, 2019, Proceedings, Part II, ser. Lecture Notes in Computer Science, C. Ghidini, O. Hartig, M. Maleshkova, V. Svátek, I. F. Cruz, A. Hogan, J. Song, M. Lefrançois, and F. Gandon, Eds., vol. 11779.   Springer, 2019, pp. 69–78. [Online]. Available: https://doi.org/10.1007/978-3-030-30796-7_5
  28. J. Gu, Z. Lu, H. Li, and V. O. K. Li, “Incorporating copying mechanism in sequence-to-sequence learning,” in Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 1: Long Papers.   The Association for Computer Linguistics, 2016, pp. 1631–1640. [Online]. Available: https://doi.org/10.18653/v1/p16-1154
  29. N. Muennighoff, “Sgpt: Gpt sentence embeddings for semantic search,” arXiv preprint arXiv:2202.08904, 2022.
  30. S. Yang, M. Teng, X. Dong, and F. Bo, “Llm-based sparql generation with selected schema from large scale knowledge base,” in China Conference on Knowledge Graph and Semantic Computing.   Springer, 2023, pp. 304–316.
  31. L. Kovriguina, R. Teucher, D. Radyush, and D. Mouromtsev, “Sparqlgen: One-shot prompt-based approach for sparql query generation,” 2023.
  32. H. Luo, Z. Tang, S. Peng, Y. Guo, W. Zhang, C. Ma, G. Dong, M. Song, W. Lin et al., “Chatkbqa: A generate-then-retrieve framework for knowledge base question answering with fine-tuned large language models,” arXiv preprint arXiv:2310.08975, 2023.
  33. T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, S. Agarwal, A. Herbert-Voss, G. Krueger, T. Henighan, R. Child, A. Ramesh, D. M. Ziegler, J. Wu, C. Winter, C. Hesse, M. Chen, E. Sigler, M. Litwin, S. Gray, B. Chess, J. Clark, C. Berner, S. McCandlish, A. Radford, I. Sutskever, and D. Amodei, “Language models are few-shot learners,” in Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin, Eds.   Curran Associates, Inc., 2020, pp. 1877–1901. [Online]. Available: https://proceedings.neurips.cc/paper/2020/hash/1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html
  34. D. Banerjee, P. A. Nair, J. N. Kaur, R. Usbeck, and C. Biemann, “Modern baselines for SPARQL semantic parsing,” in SIGIR ’22: The 45th International ACM SIGIR Conference on Research and Development in Information Retrieval, Madrid, Spain, July 11 - 15, 2022, E. Amigó, P. Castells, J. Gonzalo, B. Carterette, J. S. Culpepper, and G. Kazai, Eds.   ACM, 2022, pp. 2260–2265. [Online]. Available: https://doi.org/10.1145/3477495.3531841
  35. Y. Zhou, X. Geng, T. Shen, W. Zhang, and D. Jiang, “Improving zero-shot cross-lingual transfer for multilingual question answering over knowledge graph,” in Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 2021, pp. 5822–5834.
  36. S. Purkayastha, S. Dana, D. Garg, D. Khandelwal, and G. S. Bhargav, “A deep neural approach to kgqa via sparql silhouette generation,” in 2022 International Joint Conference on Neural Networks (IJCNN).   IEEE, 2022, pp. 1–8.
  37. A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, I. Sutskever et al., “Language models are unsupervised multitask learners,” OpenAI blog, vol. 1, no. 8, p. 9, 2019.
  38. J. Ding, W. Hu, Q. Xu, and Y. Qu, “Leveraging frequent query substructures to generate formal queries for complex question answering,” arXiv preprint arXiv:1908.11053, 2019.
  39. M. Chen, J. Tworek, H. Jun, Q. Yuan, H. P. de Oliveira Pinto, J. Kaplan, H. Edwards, Y. Burda, N. Joseph, G. Brockman, A. Ray, R. Puri, G. Krueger, M. Petrov, H. Khlaaf, G. Sastry, P. Mishkin, B. Chan, S. Gray, N. Ryder, M. Pavlov, A. Power, L. Kaiser, M. Bavarian, C. Winter, P. Tillet, F. P. Such, D. Cummings, M. Plappert, F. Chantzis, E. Barnes, A. Herbert-Voss, W. H. Guss, A. Nichol, A. Paino, N. Tezak, J. Tang, I. Babuschkin, S. Balaji, S. Jain, W. Saunders, C. Hesse, A. N. Carr, J. Leike, J. Achiam, V. Misra, E. Morikawa, A. Radford, M. Knight, M. Brundage, M. Murati, K. Mayer, P. Welinder, B. McGrew, D. Amodei, S. McCandlish, I. Sutskever, and W. Zaremba, “Evaluating large language models trained on code,” CoRR, vol. abs/2107.03374, 2021. [Online]. Available: https://arxiv.org/abs/2107.03374
  40. L. Ouyang, J. Wu, X. Jiang, D. Almeida, C. L. Wainwright, P. Mishkin, C. Zhang, S. Agarwal, K. Slama, A. Ray, J. Schulman, J. Hilton, F. Kelton, L. Miller, M. Simens, A. Askell, P. Welinder, P. Christiano, J. Leike, and R. Lowe, “Training language models to follow instructions with human feedback,” 2022. [Online]. Available: https://arxiv.org/abs/2203.02155
Citations (2)

Summary

We haven't generated a summary for this paper yet.