Robust Text-to-Cypher Using Combination of BERT, GraphSAGE, and Transformer (CoBGT) Model
Source abstract
Abstract
Graph databases have become essential for managing and analyzing complex data relationships, with Neo4j emerging as a leading player in this domain. Neo4j, a high-performance NoSQL graph database, excels in efficiently handling connected data, offering powerful querying capabilities through its Cypher query language. However, due to Cypher’s complexities, making it more accessible for nonexpert users requires translating natural language queries into Cypher. Thus, in this paper, we propose a text-to-Cypher model to effectively translate natural language queries into Cypher. In our proposed model, we combine several methods to enable nonexpert users to interact with graph databases using the English language. Our approach includes three modules: key-value extraction, relation–properties prediction, and Cypher query generation. For key-value extraction and relation–properties prediction, we leverage BERT and GraphSAGE to extract features from natural language. Finally, we use a Transformer model to generate the Cypher query from these features. Additionally, due to the lack of text-to-Cypher datasets, we introduced a new dataset that contains English questions querying information within a graph database, paired with corresponding Cypher query ground truths. This dataset aids future model learning, validation, and comparison on text-to-Cypher task. Through experiments and evaluations, we demonstrate that our model achieves high accuracy and efficiency when comparing with some well-known seq2seq model such as T5 and GPT2, with an 87.1% exact match score on the dataset.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Topic Modeling · Natural Language Processing Techniques · Text and Document Classification Technologies
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
Department of Intelligent Systems, Soongsil University, Seoul 06978, Republic of Korea
Funding
MSIT (Ministry of Science and ICT), Korea · IITP (Institute of Information & communications Technology Planning & Evaluation)
References (33)
Show source-provided references
1. Introduction to graph databases
2. Cao, R., Chen, L., Chen, Z., Zhao, Y., Zhu, S., and Yu, K. (2021, January 1–6). LGESQL: Line Graph Enhanced Text-to-SQL Model with Mixed Local and Non-Local Relations. Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), Online.10.18653/v1/2021.acl-long.198 ↗
3. Nadime, F., Alastair, G., Paolo, G., Leonid, L., Tobias, L., Victor, M., Stefan, P., Mats, R., Mats, R., and Petra, S. (2018, January 10–15). Cypher: An Evolving Query Language for Property Graphs. Proceedings of the 2018 International Conference on Management of Data, Houston, TX, USA.
4. On the Defense of Spoofing Countermeasures against Adversarial Attacks10.1109/ACCESS.2023.3310809 ↗
5. Cisse, M., Adi, Y., Neverova, N., and Keshet, J. (2017, January 4–9). Houdini: Fooling Deep Structured Visual and Speech Recognition Models with Adversarial Examples. Proceedings of the 31st International Conference on Neural Information Processing Systems, Long Beach, CA, USA.
6. DMT-Net: Deep Multiple Networks for Low-Light Image Enhancement Based on Retinex Model10.1109/ACCESS.2023.3336411 ↗
7. Duong, M.-T., Nguyen, T.-T., Lee, S., and Hong, M.-C. (2024). Multi-Branch Network for Color Image Denoising Using Dilated Convolution and Attention Mechanisms. Sensors, 24.10.3390/s24113608 ↗
8. Le, H.-D., and Park, M. (2024). Enhancing Multi-Class Attack Detection in Graph Neural Network through Feature Rearrangement. Electronics, 13.10.3390/electronics13122404 ↗
9. Tran, D.-H., and Park, M. (2024, January 17–19). Graph Embedding for Graph Neural Network in Intrusion Detection System. Proceedings of the International Conference on Information Networking (ICOIN), Ho Chi Minh City, Vietnam.10.1109/ICOIN59985.2024.10572124 ↗
10. Vijaya, J., Mittal, C., Singh, C., and Lekhana, M. (2023, January 11–13). An Efficient System for Audio-Based Sign Language Translator through MFCC Feature Extraction. Proceedings of the 2023 International Conference on Sustainable Communication Networks and Application (ICSCNA), Theni, India.10.1109/ICSCNA58489.2023.10370086 ↗
11. Lavanya, R., Gautam, A., and Anand, A. (2024, January 12–14). Real-Time Translator with Added Features for Cross-Language Communication. Proceedings of the 10th International Conference on Communication and Signal Processing (ICCSP), Melmaruvathur, India.10.1109/ICCSP60870.2024.10543567 ↗
12. Sak, H., Senior, A.W., and Beaufays, F. (2014, January 14–18). Long Short-Term Memory Recurrent Neural Network Architectures for Large Scale Acoustic Modeling. Proceedings of the INTERSPEECH, Singapore.10.21437/Interspeech.2014-80 ↗
13. GPT-3: Its Nature, Scope, Limits, and Consequences10.1007/s11023-020-09548-1 ↗
14. Wolf, T., Debut, L., Sanh, V., Chaumond, J., Delangue, C., Moi, A., Cistac, P., Rault, T., Louf, R., and Funtowicz, M. (2020, January 16–20). Transformers: State-of-the-Art Natural Language Processing. Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, Online.10.18653/v1/2020.emnlp-demos.6 ↗
15. Dong, L., and Lapata, M. (2016). Language to Logical Form with Neural Attention. Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, Association for Computational Linguistics.10.18653/v1/P16-1004 ↗
16. Li, T., Zhang, S., and Li, Z. (2023). SP-NLG: A Semantic-Parsing-Guided Natural Language Generation Framework. Electronics, 12.10.3390/electronics12081772 ↗
17. Li, Y., Su, Z., Li, H., Zhang, S., Wang, S., Wu, W., and Zhang, Y. (2023, January 4–10). T5-SR: A Unified Seq-to-Seq Decoding Strategy for Semantic Parsing. Proceedings of the ICASSP 2023—2023 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Rhodes Islands.10.1109/ICASSP49357.2023.10096172 ↗
18. Guo, A., Li, X., Xiao, G., Tan, Z., and Zhao, X. (2022, January 17–21). SpCQL: A Semantic Parsing Dataset for Converting Natural Language into Cypher. Proceedings of the 31st ACM International Conference on Information & Knowledge Management, Atlanta, GA, USA.10.1145/3511808.3557703 ↗
19. Li, J., Hui, B., Cheng, R., Qin, B., Ma, C., Huo, N., Huang, F., Du, W., Si, L., and Li, Y. (2023, January 7–14). Graphix-T5: Mixing Pre-Trained Transformers with Graph-Aware Layers for Text-to-SQL Parsing. Proceedings of the Thirty-Seventh AAAI Conference on Artificial Intelligence and Thirty-Fifth Conference on Innovative Applications of Artificial Intelligence and Thirteenth Symposium on Educational Advances in Artificial Intelligence, Online.10.1609/aaai.v37i11.26536 ↗
20. Jeong, G., Han, M., Kim, S., Lee, Y., Lee, J., Park, S., and Kim, H. (2023). Improving Text-to-SQL with a Hybrid Decoding Method. Entropy, 25.10.3390/e25030513 ↗
21. Scholak, T., Schucher, N., and Bahdarau, R. (2021, January 7–11). PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Models. Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, Punta Cana, Dominican Republic.10.18653/v1/2021.emnlp-main.779 ↗
22. PAROT: Translating Natural Language to SPARQL
23. SGPT: A Generative Approach for SPARQL Query Generation from Natural Language Questions10.1109/ACCESS.2022.3188714 ↗
24. Bogin, B., Gardner, M., and Berant, J. (2019). Representing Schema Structure with Graph Neural Networks for Text to SQL Parsing. Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, Association for Computational Linguistics.10.18653/v1/P19-1448 ↗
25. Guo, J., Zhan, Z., Gao, Y., Xiao, Y., Lou, J.G., Liu, T., and Zhang, D. (2019). Towards Complex Text to SQL in Cross-Domain Database. Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, Association for Computational Linguistics.10.18653/v1/P19-1444 ↗
26. Wang, B., Shin, R., Liu, X., Polozov, O., and Richardson, M. (2020). RAT-SQL: Relation Aware Schema Encoding and Linking for Text to SQL Parsers. Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, Association for Computational Linguistics.10.18653/v1/2020.acl-main.677 ↗
27. SCRIBL: A System for the Semantic Capture of Relationships in Biological Literature10.21105/joss.06645 ↗
28. Devlin, J., Chang, M., Lee, K., and Toutanova, K. (2019). BERT: Pre-Training of Deep Bidirectional Transformers for Language Understanding. Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Association for Computational Linguistics.
29. Hamilton, W., Ying, R., and Leskovec, J. (2017, January 4–9). Inductive Representation Learning on Large Graphs. Proceedings of the International Conference on Neural Information Processing Systems, Long Beach, CA, USA.
30. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A., Kaiser, Ł., and Polosukhin, I. (2017, January 4–9). Attention Is All You Need. Proceedings of the International Conference on Neural Information Processing Systems, Long Beach, CA, USA.
31. Reimers, N., and Gurevych, I. (2019). Sentence-BERT: Sentence Embeddings Using Siamese BERT-Networks. Proceedings of the Conference on Empirical Methods in Natural Language Processing, Association for Computational Linguistics.10.18653/v1/D19-1410 ↗
32. Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer
33. Radford, A., Wu, J., and Sutskever, I. (2019, September 03). Language Models Are Unsupervised Multitask Learners. Available online: https://d4mucfpksywv.cloudfront.net/better-language-models/language_models_are_unsupervised_multitask_learners.pdf.