With the development of Internet technology,many applications provide financial quantification services for the public,but most users do not have financial or computer professional knowledge,they expect to use natural language to query data,so natural language to SQL(NL2SQL)is urgently needed.To solve this problem,a Chinese financial NL2SQL algorithm based on BiLSTM is proposed,which is divided into encoding and decoding stages.In the encoding stage,feature vectors were generated by BiLSTM and attention mechanism.In the decoding stage,the SQL generation was decoupled into nine classified tasks according to the SQL syntax rules,and each task was interdependent and joint learning,and then the complex SQL statement was generated.In addition to the model,a vector library containing financial vocabulary was trained,which built data sets for the financial domain.The experimental verification on this data set shows that the method has higher accuracy,can effectively solve the problem of SQL generation in the financial field,and is implemented in a financial quantitative analysis system.
NL2SQLBiLSTMAttention mechanismVector libraryDat set