Computer Science ›› 2020, Vol. 47 ›› Issue (11A): 562-569.doi: 10.11896/jsjkx.200200086

• Software Engineering • Previous Articles     Next Articles

SQL Grammar Structure Construction Based on Relationship Classification and Correction

WAN Wen-jun1, DOU Quan-sheng1,2, CUI Pan-pan1, ZHANG Bin1, TANG Huan-ling1,2   

  1. 1 School of Computer Science and Technology,Shandong Technology and Business University,Yantai,Shandong 264000,China
    2 Co-innovation Center of Shandong Colleges and Universities:Future Intelligent Computing,Yantai,Shandong 264000,China
  • Online:2020-11-15 Published:2020-11-17
  • About author:WAN Wen-jun,born in 1996,postgra-duate.His main research interests include natural language processing and deep learning.
    DOU Quan-sheng,born in 1971,Ph.D,professor,is a member of China Computer Federation.His main research interests include natural language processing and deep learning.
  • Supported by:
    This work was supported by the National Natural Science Foundation of China (61976125,61976124,61772319,61773244) and High Education Science and Technology Planning Program of Shandong Provincial Education Department (J18KA340,J18KA385).

Abstract: Aiming at the problem that the SQL grammar structure in nested query is difficult to construct,the GSC-RCC method combining relation classification and modification is proposed,and the SQL grammar is represented by three types of entity relationships.Firstly,the relational classification depth model is designed,and the column name common words are introduced to improve the performance of the model,so as to determine the probability of different relations of each entity pair in the statement,and then generate unmodified undirected graph.Then the relationship correction algorithm based on SQL grammar is designed to modify the undirected graph and finally construct the SQL grammar structure.In the real estate data query task,for multi-conditional query statements with nested conditions,the grammar structure generation accuracy of GSC-RCC method is 92.25%,and the method can reduce the dependence of the model on the number of statement sample.

Key words: Deep learning, NL2SQL, Relationship classification, Relationship correction, SQL grammar structure

CLC Number: 

  • TP312
[1] CHUNG J,GULCEHRE C,CHO K H,et al.Empirical evaluation of gated recurrent neural networks on sequence modeling[J].arXiv:1412.3555,2014.
[2] POPESCU A M,ARMANASU A,ETZIONI O,et al.Modern natural language interfaces to databases:Composing statistical parsing with semantic tractability[C]//Proc of the 20th Int Conf on Computational Linguistics.Stroudsburg,PA:Association for Computational Linguistics,2004:141-147.
[3] LI Y,YANG H,JAGADISH H V.Constructing a Generic Natural Language Interface for an XML Database[M].Berlin,Heidelberg:Springer Berlin Heidelberg,2006:737-754.
[4] ALESSANDRA G,MOSCHITTI A.Translating Questions to SQL Queries with Generative Parsers Discriminatively Reranked [C]//Proc. of COLING.New York:ACM,2012:401-410.
[5] POON H.Grounded Unsupervised Semantic Parsing [C]//Proc of the 51st Annual Meeting of the Association forComputatio-nal Linguistics.Stroudsburg,PA:ACL,2013.
[6] LI H,XU J.Semantic Matching in Search [J].Foundations and Trends in Information Retrieval,2014,7(5):343-469.
[7] SERBAN I,SORDONI A,BENGIO Y,et al.Building End-To-End Dialogue Systems Using Generative Hierarchical Neural Network Models [C]//Proc of the 30th AAAI Conf on Artificial Intelligence.Menlo Park,CA:AAAI Press,2016.
[8] DOLAN W B,BROCKETT C.Automatically Constructing aCorpus of Sentential Paraphrases [C]//Proc of the Third Int Workshop on Paraphrasing(IWP).2005.
[9] BROWN P F,DELLA PIETRA S A,DELLA PIETRA V J,et al.The Mathematics of Statistical Machine Translation:Parameter Estimation [J].Computational Linguistics,1993,19(2):263.
[10] VINYALS O,KAISER L,KOO T K,et al.Grammar as a Foreign Language [C]//Proc of Advances in Neural Information Processing Systems.New York,NY:Curran Associates,2015:2773-2781.
[11] ZHONG V,XIONG C,SOCHER R.Seq2SQL:GeneratingStructured Queries from Natural Language using Reinforcement Learning [J].arXiv:1709.00103,2017.
[12] DONG L,LAPATA M.Coarse-to-Fine Decoding for Neural Semantic Parsing [J].arXiv:1805.04793,2018.
[13] CAI R C,XU B Y,ZHANG Z J,et al.An Encoder-Decoder Framework Translating Natural Language to Database Queries [J].arXiv:1711.06061,2017.
[14] XU X J,LIU C,DAWN S.SQLNet:Generating Structured Queries From Natural Language Without Reinforcement Learning [J].arXiv:1711.04436,2017.
[15] YU T,LI Z F,ZHANG Z L,et al.TypeSQL:Knowledge-based Type-Aware Neural Text-to-SQL Generation [J].arXiv:1804.09769,2018.
[16] HWANG W,YIM J,PARK S,et al.A Comprehensive Exploration on WikiSQL with Table-Aware Word Contextualization [J].arXiv:1902.01069,2019.
[17] EPSTEIN,SAMUEL S.Transportable Natural Language Pro-cessing through Simplicity-The PRE System [J].Acm Transactions on Information Systems,1985,3(2):107-120.
[18] IYER S,KONSTAS I,CHEUNG A,et al.Learning a Neural Semantic Parser from User Feedback[J].arXiv:1704.08760,2017.
[19] FINEGAN-DOLLAK C,KUMMERFELD J K,ZHANG L,et al.Improving Text-to-SQL Evaluation Methodology [J].ar-Xiv:1806.09029,2018.
[20] LEE D,YOON J,SONG J,et al.One-Shot Learning for Text-to-SQL Generation [J].arXiv:1905.11499,2019.
[21] VINYALS O,FORTUNATO M,JAITLY N.Pointer Networks [C]//Proc of Advances in Neural Information Processing Systems.New York,NY:Curran Associates,2015:2692-2700.
[22] LEE D.Recursive and Clause-Wise Decoding for Complex and Cross-Domain Text-to-SQL Generation [J].arXiv:1904.08835,2019.
[23] SONG Y,SHI S,LI J,et al.Directional Skip-Gram:ExplicitlyDistinguishing Left and Right Context for Word Embeddings [C]//Proc of the 2018 Conf of the North American Chapter of the Association for Computational Linguistics:Human Language Technologies,Stroudsburg,PA:ACL,2018:175-180.
[24] LIN Z H,FENG M W,SANTOS C N D,et al.A Structured Self-attentive Sentence Embedding [J].arXiv:1703.03130,2017.
[25] CORTES C,VAPNIK V.Support-Vector Networks [J].Machine Learning,1995,20(3):273-297.
[26] ZENG D J,LIU K,LAI S W,et al.Relation Classification via Convolutional Deep Neural Network [C]//Proc. of COLING.New York:ACM,2014:2335-2344.
[27] ZHU J,QIAO J,DAI X,et al.Relation Classification via Target-Concentrated Attention CNNs [C]//Int. Conf. on Neural Information Processing.Berlin:Springer,2017:137-146.
[1] XU Yong-xin, ZHAO Jun-feng, WANG Ya-sha, XIE Bing, YANG Kai. Temporal Knowledge Graph Representation Learning [J]. Computer Science, 2022, 49(9): 162-171.
[2] RAO Zhi-shuang, JIA Zhen, ZHANG Fan, LI Tian-rui. Key-Value Relational Memory Networks for Question Answering over Knowledge Graph [J]. Computer Science, 2022, 49(9): 202-207.
[3] TANG Ling-tao, WANG Di, ZHANG Lu-fei, LIU Sheng-yun. Federated Learning Scheme Based on Secure Multi-party Computation and Differential Privacy [J]. Computer Science, 2022, 49(9): 297-305.
[4] WANG Jian, PENG Yu-qi, ZHAO Yu-fei, YANG Jian. Survey of Social Network Public Opinion Information Extraction Based on Deep Learning [J]. Computer Science, 2022, 49(8): 279-293.
[5] HAO Zhi-rong, CHEN Long, HUANG Jia-cheng. Class Discriminative Universal Adversarial Attack for Text Classification [J]. Computer Science, 2022, 49(8): 323-329.
[6] JIANG Meng-han, LI Shao-mei, ZHENG Hong-hao, ZHANG Jian-peng. Rumor Detection Model Based on Improved Position Embedding [J]. Computer Science, 2022, 49(8): 330-335.
[7] SUN Qi, JI Gen-lin, ZHANG Jie. Non-local Attention Based Generative Adversarial Network for Video Abnormal Event Detection [J]. Computer Science, 2022, 49(8): 172-177.
[8] HU Yan-yu, ZHAO Long, DONG Xiang-jun. Two-stage Deep Feature Selection Extraction Algorithm for Cancer Classification [J]. Computer Science, 2022, 49(7): 73-78.
[9] CHENG Cheng, JIANG Ai-lian. Real-time Semantic Segmentation Method Based on Multi-path Feature Extraction [J]. Computer Science, 2022, 49(7): 120-126.
[10] HOU Yu-tao, ABULIZI Abudukelimu, ABUDUKELIMU Halidanmu. Advances in Chinese Pre-training Models [J]. Computer Science, 2022, 49(7): 148-163.
[11] ZHOU Hui, SHI Hao-chen, TU Yao-feng, HUANG Sheng-jun. Robust Deep Neural Network Learning Based on Active Sampling [J]. Computer Science, 2022, 49(7): 164-169.
[12] SU Dan-ning, CAO Gui-tao, WANG Yan-nan, WANG Hong, REN He. Survey of Deep Learning for Radar Emitter Identification Based on Small Sample [J]. Computer Science, 2022, 49(7): 226-235.
[13] ZHU Wen-tao, LAN Xian-chao, LUO Huan-lin, YUE Bing, WANG Yang. Remote Sensing Aircraft Target Detection Based on Improved Faster R-CNN [J]. Computer Science, 2022, 49(6A): 378-383.
[14] WANG Jian-ming, CHEN Xiang-yu, YANG Zi-zhong, SHI Chen-yang, ZHANG Yu-hang, QIAN Zheng-kun. Influence of Different Data Augmentation Methods on Model Recognition Accuracy [J]. Computer Science, 2022, 49(6A): 418-423.
[15] MAO Dian-hui, HUANG Hui-yu, ZHAO Shuang. Study on Automatic Synthetic News Detection Method Complying with Regulatory Compliance [J]. Computer Science, 2022, 49(6A): 523-530.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!