Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method and device for quickly realizing NL2SQL based on vectorized semantic rule

A semantic and rule-based technology, applied in the field of fast implementation of NL2SQL based on vectorized semantic rules, can solve the problems of lack of accurate mapping of fields, complex process, and inability to build model training, etc., to achieve good accuracy, generalization ability, and high recall rate Effect

Active Publication Date: 2020-11-27
北京智源人工智能研究院
View PDF1 Cites 7 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In actual professional application scenarios, due to the absence or lack of sufficient labeled corpus in the professional field, corresponding model training cannot be constructed. Therefore, it is still a difficult problem to quickly implement NL2SQL combined with business data models
In addition, due to the lack of accurate mapping between the field attributes parsed in the natural statement and the fields in the business database, the entire process is complicated and executable SQL cannot be correctly generated

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
  • Method and device for quickly realizing NL2SQL based on vectorized semantic rule
  • Method and device for quickly realizing NL2SQL based on vectorized semantic rule

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0044] Such as figure 1 As shown, the embodiment of the present invention provides a method for quickly implementing NL2SQL based on vectorized semantic rules, including:

[0045] S101, performing word segmentation processing and entity recognition on the first sentence based on natural language;

[0046] S102. Using a preset entity type to replace the corresponding entity in the first sentence to obtain a second sentence;

[0047] S103. Identify the second sentence according to a preset semantic rule template to obtain a semantic segment;

[0048] S104, obtain table and field information of the business database according to the semantic segment matching;

[0049] S105. Generate an SQL statement according to the table and field information of the business database.

[0050] Executing step S101, specifically including: performing word segmentation processing and entity recognition on the first sentence by using a predefined entity rule template and a conventional dictionary...

Embodiment 2

[0183] Such as figure 2 As shown, another aspect of the present invention also includes a functional module architecture completely corresponding to the aforementioned method flow, that is, an embodiment of the present invention also provides a device for quickly implementing NL2SQL based on vectorized semantic rules, including:

[0184] Entity recognition module 201, for carrying out participle processing and entity recognition to the first sentence based on natural language;

[0185] An entity type replacement module 202, configured to use a preset entity type to replace the corresponding entity in the first sentence to obtain a second sentence;

[0186] Semantic segment recognition module 203, used for identifying the second sentence according to a preset semantic rule template to obtain a semantic segment;

[0187] The business database table matching module 204 is used to obtain the table and field information of the business database according to the semantic segment m...

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 discloses a method and a device for quickly realizing an NL2SQL based on a vectorized semantic rule. The method comprises the steps of performing word segmentation processing and entityrecognition on a first statement based on a natural language; replacing a corresponding entity in the first statement with a preset entity type to obtain a second statement; identifying the second statement according to a preset semantic rule template to obtain a semantic segment; performing matching according to the semantic fragments to obtain table and field information of a service database; and generating an SQL statement according to the table and field information of the business database. Compared with the prior art, the method and the device have the advantages that the method does not depend on a complex system and a complex database, the NL2SQL can be rapidly achieved, the semantic fragments in the natural sentences are recognized based on the vectorized semantic rules, the semantic search accuracy and generalization ability are improved, and the recall rate is high.

Description

technical field [0001] The invention relates to the technical field of natural language processing, in particular to a method and device for quickly realizing NL2SQL based on vectorized semantic rules. Background technique [0002] In the field of semantic search, how to freely query the target data in the database through natural language has become an emerging research hotspot in the industry. Among them, converting natural language into a standardized semantic representation that computers can understand and execute is a subtask in the field of semantic analysis. NL2SQL (Natural Language to SQL) is a technology that converts user natural statements into SQL statements that computers can execute. [0003] In actual professional application scenarios, due to the absence or lack of sufficient labeled corpus in the professional field, it is impossible to build corresponding model training. Therefore, it is still a difficult problem to quickly realize NL2SQL combined with bus...

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
IPC IPC(8): G06F40/30G06F40/295G06F40/242G06F16/242
CPCG06F16/2433G06F40/242G06F40/295G06F40/30
Inventor 肖超峰李智钱泓锦刘占亮
Owner 北京智源人工智能研究院
Features
  • Generate Ideas
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More