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 comb

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

Example Embodiment

[0043] Example one

[0044] like figure 1 Shown embodiment the present invention provides a fast implementation NL2SQL based on semantic rules to the quantization method, comprising:

[0045] S101, the first sentence of natural language processing and performs segmentation entity recognition;

[0046] S102, the first sentence in place of an entity corresponding to the entity type using a preset, to give a second statement;

[0047] S103, the second identified sentence according to the preset templates semantic rules, semantic fragments obtained;

[0048] S104, according to the matched semantic fragment obtained field information table and the service database;

[0049] S105, generates SQL statements in accordance with the table as the field information of the service database.

[0050] Performing step S101, the specifically comprises: using a conventional dictionaries and rule templates entity predefined to the first statement and the word processing entity recognition, to obtain ...

Example Embodiment

[0182] Example 2

[0183] like figure 2 Shown, comprises a further aspect of the present invention and the method fully corresponds to the same process function module architecture, i.e., embodiments of the present invention further provides a fast implementation based on the quantization means NL2SQL semantic rules, comprising:

[0184] Entity identification module 201 for the first sentence of natural language processing and word segmentation entity recognition;

[0185] Alternatively entity type module 202, for replacing the corresponding entity of the first sentence, the sentence obtained by using a second predetermined entity type;

[0186] Semantic segment identification module 203 for identifying the sentence in accordance with a preset second semantic rules templates, to obtain semantic fragment;

[0187] The service database table matching module 204, for obtaining field information table and the service database according to the semantic matching segments;

[0188] SQL s...

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 北京智源人工智能研究院
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