Natural language generation method based on SQL syntax tree node types

A technology of natural language and node type, applied in the field of natural language, it can solve the problems of limited types of SQL statements, lack of diversity of sentence patterns, and high similarity of natural language

Active Publication Date: 2019-12-24
GUANGDONG UNIV OF TECH
View PDF2 Cites 11 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The first is to convert SQL language into natural language according to pre-designed artificial rules and templates. The disadvantage of this method is that the generated natural language has a high degree of similarity, the sentence structure lacks diversity, and the types of SQL statements that can be supported are limited. After all, It is based on artificially designed templates; the second way of thinking is to regard the problem of converting SQL language into natural language as a sequence-to-sequence translation problem, and treat a SQL statement and a natural language description as a sequence form. The network encodes the SQL statement sequence to extract the overall expression of the SQL statement sequence, and then generates a natural language sequence based on this expression, but this method can only obtain the sequence information on the surface of the text sequence, and cannot use the grammatical structure information of the SQL language

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Natural language generation method based on SQL syntax tree node types
  • Natural language generation method based on SQL syntax tree node types
  • Natural language generation method based on SQL syntax tree node types

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0072] Such as figure 1 Shown, a kind of natural language generation method based on SQL syntax tree node type, comprises the following steps:

[0073] Step S1: constructing a natural language generation model, said model including a language encoder and a language decoder based on a memory network;

[0074] Step S2: Collect the natural language data set from the SQL text, and traverse the natural language data set according to the breadth first to obtain the SQL abstract syntax tree T={node with n nodes 1 ,...,node n} and the corresponding natural language sequence X={x 1 ,...,x m}; wherein, node represents a node of the SQL abstract syntax tree T, and the subscript is the node serial number; x represents a word in a natural language sentence X, and the subscript represents the serial number;

[0075] Step S3: Use the language encoder in the natural language generation model to calculate each node node in the SQL abstract syntax tree i The node state vector of

[0076...

specific example

[0128] Such as Figure 4 As shown, in this embodiment, a detailed sentence is input into the language encoder in the natural language generation model, and a sentence that can summarize the input content is output in the language decoder. The specific examples are as follows:

[0129] Input: Xiao Ming went to Guangzhou Restaurant for lunch, ordered 3 dishes, and had a good time.

[0130] Output: Xiao Ming enjoyed his lunch.

[0131] Assuming that the word "Xiao Ming" is not in the constructed dictionary, an "unknown" word will be generated if there is no copy mechanism; and if there is a copy mechanism, the word "Xiao Ming" can be copied from the input to the output . The specific realization of the replication mechanism is based on the pointer network (Pointer Network). The pointer network is based on the language encoder-language decoder framework, assuming that the input is X={x 1 ,...,x n}, the output is Y={y 1 ,...,y m}In a certain time step i of the decoder stage,...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to the field of natural languages, in particular to a natural language generation method based on SQL syntax tree node types. The method does not need a large amount of manual operation and does not require natural language to support various sentence patterns. Comparing with a natural language generation method based on sequence-to-sequence learning. According to the invention, the text information of the SQL language can be obtained; tree-shaped structured data of an SQL syntax tree and a tree-shaped long short-term memory network are combined for use; the grammatical structure information of the SQL statement is obtained more fully, the method has practical application significance, the defect that a development document and online data are consulted manually is overcome, the time cost and the labor cost are greatly reduced, and the working efficiency is improved.

Description

technical field [0001] The present invention relates to the field of natural language, and more specifically, relates to a method for generating natural language based on SQL syntax tree node types. Background technique [0002] Structured Query Language (SQL) is a non-procedural programming language for operating relational databases, which allows users to interactively query data on high-level data structures, making users transparent about the specific storage methods of data; currently, Structured Query Language It has been widely used in database operation transactions. Since the SQL language is a programming language, it can be converted into an abstract syntax tree (Abstract Syntax Description Language, ASDL), a language used to describe a tree-like data structure in a compiler. Syntax Tree, AST). The abstract syntax tree can express the grammatical structure of the SQL language in a tree form without expressing the specific details of the SQL language. The abstrac...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F16/242G06F8/41G06N3/04G06N3/08
CPCG06F16/2433G06N3/08G06F8/42G06N3/048
Inventor 蔡瑞初梁智豪许柏炎郝志峰温雯李梓健
Owner GUANGDONG UNIV OF TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products