Semantic parsing method, semantic parsing device, electronic device and storage medium

By improving the semantic analysis of user discourse in the field of intelligent dialogue, and using language models and graph structure models to perform semantic analysis on user and local data, the problem of inaccurate semantic analysis in the existing technology is solved, and more efficient and logical semantic analysis and reply are achieved.

CN115221288BActive Publication Date: 2025-05-02PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210906332.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-29
Publication Date
2025-05-02
Estimated Expiration
2042-07-29

AI Technical Summary

Technical Problem

The prior art is difficult to accurately analyze user discourse in the field of intelligent dialogue, resulting in low logicality of generated replies.

Method used

By obtaining the local data of the local database and the user data of the target user, the data is encoded using the preset language model, a semantic edge connection relationship is constructed, and the graph structure model is reconstructed, and the target search statement is finally generated through the decoding model.

Benefits of technology

It improves the accuracy of semantic analysis and the logic of generating statements, and enhances the semantic understanding and replying ability of user discourse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115221288B_ABST
    Figure CN115221288B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a semantic parsing method, a semantic parsing device, an electronic device and a storage medium, which belongs to the field of artificial intelligence technology. The method includes: obtaining local data of a local database and user data of a target user terminal; encoding the local data through a preset language model to obtain a local semantic vector; encoding the user data through a language model to obtain a question semantic vector; constructing a semantic edge relationship based on the local semantic vector and the question semantic vector; reconstructing the question semantic vector, the local semantic vector, and the semantic edge relationship through a preset graph structure model to obtain a graph semantic feature vector; decoding the graph semantic feature vector through a preset decoding model to obtain a target retrieval statement, wherein the target retrieval statement includes an SQL statement. The embodiment of the present application can improve the accuracy of semantic parsing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a semantic parsing method, a semantic parsing device, an electronic device and a storage medium. Background Art

[0002] In the field of intelligent dialogue, it is often necessary to quickly perform semantic analysis of user speech through intelligent algorithms to generate corresponding reply sentences. However, the analysis of user speech often needs to rely on fixed semantic content templates, which often cannot accurately parse the semantic content of user speech. Therefore, how to improve the accuracy of semantic analysis has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] The main purpose of the embodiments of the present application is to propose a semantic parsing method, a semantic parsing device, an electronic device and a storage medium, aiming to improve the accuracy of semantic parsing.

[0004] To achieve the above object, a first aspect of an embodiment of the present application proposes a semantic parsing method, the method comprising:

[0005] Obtain local data from the local database and user data from the target user terminal;

[0006] Encoding the local data using a preset language model to obtain a local semantic vector;

[0007] Encoding the user data through the language model to obtain a question semantic vector;

[0008] Construct semantic edge relationships based on local semantic vectors and question semantic vectors;

[0009] Reconstructing the question semantic vector, the local semantic vector, and the semantic edge relationship through a preset graph structure model to obtain a graph semantic feature vector;

[0010] The graph semantic feature vector is decoded by a preset decoding model to obtain a target search statement, wherein the target search statement includes an SQL statement.

[0011] In some embodiments, the local semantic vector includes a table feature vector and a column feature vector, and the step of encoding the local data using a preset language model to obtain the local semantic vector includes:

[0012] Performing feature extraction on the local data through the convolutional layer of the language model to obtain table feature data and column feature data;

[0013] Encoding the table feature data through the first encoding layer of the language model to obtain the table feature vector;

[0014] The column feature data is encoded by the first encoding layer to obtain the column feature vector.

[0015] In some embodiments, the step of encoding the user data using the language model to obtain a question semantic vector includes:

[0016] Performing word segmentation processing on the user data by using the word segmenter of the language model to obtain user question segments;

[0017] The user question segment is encoded through the second encoding layer of the language model to obtain a question semantic vector.

[0018] In some embodiments, the local semantic vector includes a table feature vector and a column feature vector, the semantic edge relationship includes a first edge relationship, a second edge relationship, and a third edge relationship, and the step of constructing a semantic edge relationship according to the local semantic vector and the question semantic vector includes:

[0019] Matching the column feature vector and the table feature vector to obtain the first edge relationship;

[0020] Matching the column feature vector and the question semantic vector to obtain the second edge relationship;

[0021] The table feature vector and the question semantic vector are matched to obtain the third edge relationship.

[0022] In some embodiments, the step of reconstructing the question semantic vector, the local semantic vector, and the semantic edge relationship through a preset graph structure model to obtain a graph semantic feature vector includes:

[0023] The question semantic vector is node-processed by the graph structure model to obtain a question semantic node, and the local semantic vector is node-processed by the graph structure model to obtain a table feature node and a column feature node;

[0024] Aggregating the problem semantic node, the table feature node, and the column feature node through the multi-head attention mechanism of the graph structure model and the semantic edge relationship to obtain a target node feature vector;

[0025] A plurality of the target node feature vectors are concatenated to obtain the graph semantic feature vector.

[0026] In some embodiments, the step of decoding the graph semantic feature vector using a preset decoding model to obtain a target search statement includes:

[0027] Decoding the graph semantic feature vector through the decoding layer of the decoding model to obtain a target retrieval latent vector;

[0028] The target retrieval latent vector is sampled by the sampling layer of the decoding model to obtain the target retrieval sentence.

[0029] In some embodiments, after the step of decoding the graph semantic feature vector using a preset decoding model to obtain a target search statement, the method further includes:

[0030] Traversing the local database according to the target search statement to obtain initial answer content;

[0031] The initial answer content is screened to obtain target answer content, wherein the target answer content is used to reply to the user question in the user data.

[0032] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a semantic parsing device, the device comprising:

[0033] A data acquisition module is used to acquire local data from a local database and user data from a target user terminal;

[0034] A first encoding module, used to encode the local data through a preset language model to obtain a local semantic vector;

[0035] A second encoding module, used to encode the user data through the language model to obtain a question semantic vector;

[0036] The relationship building module is used to build semantic edge relationships based on the local semantic vector and the question semantic vector;

[0037] A reconstruction module, used to reconstruct the question semantic vector, the local semantic vector, and the semantic edge relationship through a preset graph structure model to obtain a graph semantic feature vector;

[0038] A decoding module is used to decode the graph semantic feature vector through a preset decoding model to obtain a target search statement, wherein the target search statement includes an SQL statement.

[0039] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program, when executed by the processor, implements the method described in the first aspect above.

[0040] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium used for computer-readable storage, and the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method described in the first aspect above.

[0041] The semantic parsing method, semantic parsing device, electronic device and storage medium proposed in the present application encode local data through a preset language model to obtain a local semantic vector, which can better retain the contextual semantic information of the local data and improve the semantic integrity of the local data. The user data is encoded through a language model to obtain a question semantic vector, which can more conveniently obtain the question semantic content of the user question of the target user end; the semantic edge relationship is constructed according to the local semantic vector and the question semantic vector, which can fully consider the mapping relationship between the user data and the local data, and realize the relationship construction between the local semantic representation vector and the question semantic vector; the question semantic vector, the local semantic vector and the semantic edge relationship are reconstructed through a preset graph structure model to obtain a graph semantic feature vector, which can jointly analyze the semantic content of the local database and the question content of the target user end, and improve the accuracy of semantic parsing. Finally, the graph semantic feature vector is decoded through a preset decoding model to obtain a target search statement. This method can improve the logic of the generated target search statement, thereby improving the accuracy of semantic parsing. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 is a flowchart of the semantic parsing method provided in an embodiment of the present application;

[0043] Figure 2 yes Figure 1 Flow chart of step S102 in FIG.

[0044] Figure 3 yes Figure 1 Flow chart of step S103 in FIG.

[0045] Figure 4 yes Figure 1 Flow chart of step S104 in FIG.

[0046] Figure 5 yes Figure 1Flow chart of step S105 in FIG.

[0047] Figure 6 yes Figure 1 Flow chart of step S106 in FIG.

[0048] Figure 7 is another flow chart of the semantic parsing method provided in an embodiment of the present application;

[0049] Figure 8 is a schematic diagram of the structure of a semantic parsing device provided in an embodiment of the present application;

[0050] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0052] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0054] First, some nouns involved in this application are analyzed:

[0055] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0056] Natural language processing (NLP): NLP uses computers to process, understand and apply human languages ​​(such as Chinese, English, etc.). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text understanding. Natural language processing is often used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.

[0057] Information Extraction (NER): A text processing technology that extracts specified types of entity, relationship, event and other factual information from natural language text and forms structured data output. Information extraction is a technology that extracts specific information from text data. Text data is composed of some specific units, such as sentences, paragraphs, and chapters. Text information is composed of some small specific units, such as characters, words, phrases, sentences, paragraphs, or a combination of these specific units. Extracting noun phrases, names, place names, etc. from text data are all text information extraction. Of course, the information extracted by text information extraction technology can be various types of information.

[0058] Web crawler: Also known as web spider, web robot, and more often in the FOAF community as web chaser, is a program or script that automatically crawls the World Wide Web according to certain rules. Other less commonly used names include ant, automatic indexer, simulator or worm.

[0059] BERT (Bidirectional Encoder Representation from Transformers) model: The BERT model further increases the generalization ability of the word vector model, fully describes the characteristics of character level, word level, sentence level and even inter-sentence relationship, and is built based on Transformer. There are three types of embeddings in BERT, namely Token Embedding, Segment Embedding, and Position Embedding; Token Embeddings is a word vector, and the first word is the CLS mark, which can be used for subsequent classification tasks; Segment Embeddings is used to distinguish between two sentences, because pre-training not only does LM but also does classification tasks with two sentences as input; Position Embeddings, the position word vector here is not the trigonometric function in Transfor, but is learned by BERT through training. However, BERT directly trains a position embedding to retain the position information, randomly initializes a vector for each position, adds model training, and finally obtains an embedding containing position information. Finally, in terms of the combination of position embedding and word embedding, BERT chooses to directly splice.

[0060] Tokenizer: Divides text into individual units (usually words).

[0061] Graph structure: It is a common data structure. For example, web pages captured by web crawlers are a typical graph structure. In a graph structure, a node can be linked to any node. The structure formed by all nodes is a graph structure. The links in a graph structure can be directed or undirected (bidirectional links). A tree structure is a special graph structure. A graph structure has no root and can have loops, but in a graph structure, there cannot be two or more isolated nodes.

[0062] Encoder: Converts the input sequence into a vector of fixed length.

[0063] Decoder: Convert the previously generated fixed vector into an output sequence; the input sequence can be text, voice, image, or video; the output sequence can be text or image.

[0064] MySQL: MySQL is a relational database management system. Relational databases store data in different tables instead of putting all data in a large warehouse, which increases speed and flexibility. The SQL language used by MySQL is the most commonly used standardized language for accessing databases.

[0065] Self-attention mechanism: The attention mechanism enables the neural network to focus on a subset of its input (or features), select specific inputs, and can be applied to any type of input regardless of its shape. In the case of limited computing power, the attention mechanism is a resource allocation solution that is the main means to solve the problem of information overload, allocating computing resources to more important tasks.

[0066] In the field of intelligent dialogue, it is often necessary to quickly perform semantic analysis of user speech through intelligent algorithms to generate corresponding reply sentences. However, the analysis of user speech often needs to rely on fixed semantic content templates, which often cannot accurately parse the semantic content of user speech. Therefore, how to improve the accuracy of semantic analysis has become a technical problem that needs to be solved urgently.

[0067] Based on this, the embodiments of the present application provide a semantic parsing method, a semantic parsing device, an electronic device and a storage medium, aiming to improve the accuracy of semantic parsing.

[0068] The semantic parsing method, semantic parsing device, electronic device and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the semantic parsing method in the embodiments of the present application is described.

[0069] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0070] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0071] The semantic parsing method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The semantic parsing method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the semantic parsing method, etc., but is not limited to the above forms.

[0072] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0073] Figure 1 is an optional flowchart of the semantic parsing method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.

[0074] Step S101, obtaining local data of a local database and user data of a target user terminal;

[0075] Step S102, encoding the local data using a preset language model to obtain a local semantic vector;

[0076] Step S103, encoding the user data through a language model to obtain a question semantic vector;

[0077] Step S104, constructing a semantic edge relationship based on the local semantic vector and the question semantic vector;

[0078] Step S105, reconstructing the question semantic vector, the local semantic vector, and the semantic edge relationship through a preset graph structure model to obtain a graph semantic feature vector;

[0079] Step S106, decoding the graph semantic feature vector through a preset decoding model to obtain a target search statement, wherein the target search statement includes an SQL statement.

[0080] Steps S101 to S106 shown in the embodiment of the present application are performed by obtaining local data from a local database and user data of a target user terminal; encoding the local data through a preset language model to obtain a local semantic vector, which can better retain the contextual semantic information of the local data and improve the semantic integrity of the local data. By encoding user data through a language model, a question semantic vector is obtained, which can more conveniently obtain the question semantic content of user questions on the target user side; semantic edge relationships are constructed based on local semantic vectors and question semantic vectors, which can fully consider the mapping relationship between user data and local data, effectively mine the fine-grained relationship between local semantic content and question semantic content, and realize the relationship construction between local semantic representation vectors and question semantic vectors; problem semantic vectors, local semantic vectors, and semantic edge relationships are reconstructed through a preset graph structure model to obtain a graph semantic feature vector, which can jointly analyze the semantic content of the local database and the question content of the target user side to improve the accuracy of semantic parsing. Finally, the graph semantic feature vector is decoded through a preset decoding model to obtain a target retrieval statement, wherein the target retrieval statement includes an SQL statement. This method can improve the logic of the generated target retrieval statement, thereby improving the accuracy of semantic parsing.

[0081] In step S101 of some embodiments, a web crawler can be written, and after the data source is set, data can be crawled in a targeted manner to obtain local data of the local database and user data of the target user terminal. The local data of the local database and the user data of the target user terminal can also be obtained by other means, but not limited to this. Among them, the local database can be a MYSQL database, and the local data includes table name data and column name data corresponding to each table name data. The table name data is the table name set of the data table in the local database, and the column name data is the column name set corresponding to each data table. The target user terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., and the user data mainly includes the problem data of the target user.

[0082] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0083] See also Figure 2 In some embodiments, the local semantic vector includes a table name feature vector and a column name feature vector. Step S102 may include but is not limited to steps S201 to S203:

[0084] Step S201, extracting features from local data through the convolutional layer of the language model to obtain table feature data and column feature data;

[0085] Step S202, encoding the table feature data through the first encoding layer of the language model to obtain a table feature vector;

[0086] Step S203: encoding the column feature data through the first encoding layer to obtain a column feature vector.

[0087] In step S201 of some embodiments, the language model may be a Bert model or the like, and features of the local data are extracted through the convolutional layer of the language model to obtain semantic content information of the data table in the local data, and obtain table feature data and column feature data, wherein the table feature data mainly includes table name features of the database table, and the column feature data mainly includes column name features corresponding to the table name features of each data table.

[0088] In step S202 of some embodiments, the table feature data is encoded by the first encoding layer of the language model to implement mapping of the table feature data from the semantic space to the vector space, thereby obtaining a table feature vector.

[0089] In step S203 of some embodiments, the column feature data is encoded by the first encoding layer of the language model to achieve mapping of the column feature data from the semantic space to the vector space, thereby obtaining a column feature vector.

[0090] The above steps S201 to S203 encode the local data through the language model, which can better retain the contextual semantic information of the local data, thereby improving the semantic integrity of the local data.

[0091] See also Figure 3 In some embodiments, step S103 may include but is not limited to steps S301 to S302:

[0092] Step S301, performing word segmentation processing on user data through a word segmenter of a language model to obtain user question segments;

[0093] Step S302: Encode the user's question segment through the second encoding layer of the language model to obtain a question semantic vector.

[0094] In step S301 of some embodiments, the language model may be a Bert model, etc., and the word segmenter of the language model may be a Jieba word segmenter, etc. The user data mainly includes the problem data of the target user. Taking the Jieba word segmenter as an example, the dictionary file in the Jieba word segmenter is first loaded, and each word and the number of times the word appears in the Jieba word segmenter are obtained. Further, the dictionary file is traversed, and a directed acyclic graph of all possible word segmentation situations in the user data is constructed by string matching, and the maximum probability of all paths from each Chinese character node in the user data to the end of the sentence is calculated, and the end position of the corresponding Chinese character word segment in the directed acyclic graph is recorded at the same time. Finally, the user data is segmented according to the node path to obtain the user problem word segment. In addition, for the user data that does not have a corresponding word in the dictionary file, it can be processed by a statistical method to obtain the user problem word segment.

[0095] In step S302 of some embodiments, the user question segment is encoded through the second encoding layer of the language model to achieve mapping of the user question segment from the semantic space to the vector space, and obtain a question semantic vector. This method can easily convert user question data in text form into question data in vector form, thereby improving the efficiency of semantic parsing.

[0096] See also Figure 4 In some embodiments, the local semantic vector includes a table feature vector and a column feature vector, the semantic edge relationship includes a first edge relationship, a second edge relationship, and a third edge relationship, and step S104 may include but is not limited to steps S401 to S403:

[0097] Step S401, matching the column feature vector and the table feature vector to obtain a first edge relationship;

[0098] Step S402, matching the column feature vector and the question semantic vector to obtain a second edge relationship;

[0099] Step S403: Match the table feature vector and the question semantic vector to obtain a third edge relationship.

[0100] In step S401 of some embodiments, when the column feature vector and the table feature vector are matched, there are six cases of matching relationships between the column feature vector and the table feature vector, that is, the first edge relationship includes six types. Specifically, when the matching process is from the column feature vector to the table feature vector, if the column feature characterization vector exists in the table feature characterization vector, that is, the current data table has this column, and this column is the primary key, then the column feature characterization vector and the table feature characterization vector are completely matched; if the column feature characterization vector exists in the table feature characterization vector, the current data table has this column, but this column is not the primary key, then the column feature characterization vector and the table feature characterization vector are partially matched; if the column feature characterization vector does not exist in the table feature characterization vector, that is, the current data table does not have this column, then the column feature characterization vector and the table feature characterization vector do not match.

[0101] Similarly, when the matching process is from the table feature vector to the column feature vector, if the column feature characterization vector exists in the table feature characterization vector, that is, the current data table has this column and this column is the primary key, then the column feature characterization vector and the table feature characterization vector completely match; if the column feature characterization vector exists in the table feature characterization vector, the current data table has this column but this column is not the primary key, then the column feature characterization vector and the table feature characterization vector partially match; if the column feature characterization vector does not exist in the table feature characterization vector, that is, the current data table does not have this column, then the column feature characterization vector and the table feature characterization vector do not match.

[0102] Therefore, through the above two pointing modes and three different matching situations, a first edge relationship including six situations can be obtained according to the column feature vector and the table feature vector.

[0103] In step S402 of some embodiments, when matching the column feature vector and the question semantic vector, there are six cases of matching relationship between the column feature vector and the question semantic vector, that is, the second edge relationship includes six types. Specifically, when the matching process is from the column feature vector to the question semantic feature vector, if the question word is the column name, the column feature representation vector and the question semantic vector are completely matched; if the question word is part of the column name, the column feature representation vector and the question semantic vector are partially matched; if the question word is not in the column name, the column feature representation vector and the question semantic vector are not matched.

[0104] Similarly, when the matching process is from the question semantic vector to the column feature vector, if the question word is the column name, the column feature representation vector and the question semantic vector completely match; if the question word is part of the column name, the column feature representation vector and the question semantic vector partially match; if the question word is not in the column name, the column feature representation vector and the question semantic vector do not match.

[0105] Therefore, through the above two pointing methods and three different matching situations, a second edge relationship including six situations can be obtained according to the column feature vector and the question semantic vector.

[0106] In step S403 of some embodiments, when the table feature vector and the question semantic vector are matched, there are six cases of matching relationship between the table feature vector and the question semantic vector, that is, the third edge relationship includes six types. Specifically, when the matching process is from the table feature vector to the question semantic feature vector, if the question word is the table name, the table feature representation vector and the question semantic vector are completely matched; if the question word is part of the table name, the table feature representation vector and the question semantic vector are partially matched; if the question word is not in the table name, the table feature representation vector and the question semantic vector are not matched.

[0107] Similarly, when the matching process is from the question semantic vector to the question table feature vector, if the question word is the table name, the table feature representation vector and the question semantic vector completely match; if the question word is part of the table name, the table feature representation vector and the question semantic vector partially match; if the question word is not in the table name, the table feature representation vector and the question semantic vector do not match.

[0108] Therefore, through the above two pointing methods and three different matching situations, a third edge relationship including six situations can be obtained according to the table feature vector and the question semantic vector.

[0109] In some other embodiments, when a table name feature vector points to another table name feature vector, four edge relationships may be generated, which are recorded as fourth edge relationships. Specifically, the two table name feature vectors are recorded as table name feature vector A and table name feature vector B respectively. Then the fourth edge relationship may include table name feature vector A connecting to table name feature vector B through a foreign key, table name feature vector B connecting to table name feature vector A through a foreign key, table name feature vector A and table name feature vector B being foreign keys to each other, and there is no direct connection between table name feature vector A and table name feature vector B.

[0110] It needs to be explained that, because there are cases where different data tables in the database contain the same column name, only foreign key connections can play the role of corresponding association and constraint between the master and slave tables. The direct connection here means that the two tables are associated through foreign keys, and the absence of direct connection means that there is no foreign key connection between the two tables. The absence of direct connection means that there is no association relationship between the data tables corresponding to the two table name feature vectors connected by foreign keys, that is, there is no common column that exists as the primary key of a single data table or two data tables.

[0111] In some other embodiments, when a column name feature vector points to another column name feature vector, three edge relationships may be generated, which are recorded as the fifth edge relationship. Specifically, the two column name feature vectors are recorded as column name feature vector C and column name feature vector D, respectively. The fifth edge relationship may include that the column name feature vector C and the column name feature vector D are the same column name, the column name feature vector C and the column name feature vector D belong to the same data table, and the column name feature vector C and the column name feature vector D do not belong to the same data table.

[0112] The above steps S401 to S403 can fully consider the mapping relationship between user data and local data, effectively mine the fine-grained relationship between local semantic content and question semantic content, realize the relationship construction between local semantic representation vectors and question semantic vectors, and improve the correlation between semantic contents.

[0113] See also Figure 5 In some embodiments, step S105 may include but is not limited to steps S501 to S503:

[0114] Step S501, node-processing the question semantic vector through the graph structure model to obtain the question semantic node, and node-processing the local semantic vector through the graph structure model to obtain the table feature node and the column feature node;

[0115] Step S502, aggregating the question semantic nodes, table feature nodes, and column feature nodes through the multi-head attention mechanism and semantic edge relationship of the graph structure model to obtain a target node feature vector;

[0116] Step S503, concatenating multiple target node feature vectors to obtain a graph semantic feature vector.

[0117] In step S501 of some embodiments, the question semantic vector is node-processed through a graph structure model to obtain a question semantic node, wherein the question semantic node can be represented as

[0118] Q = {q 1 ,q 2 ,q 3 …q n}

[0119] Among them, q i Represents the i-th word in the question sentence corresponding to the question semantic vector, and n is the length of the question sentence Q.

[0120] Similarly, the local semantic vector is node-processed through the graph structure model to obtain table feature nodes and column feature nodes, where the table feature node can be expressed as

[0121] T={t1 ,t 2 ,t 3 …,t x}

[0122] The column feature node can be represented as

[0123] C={c 11 ,c 12 ,…,c xy}

[0124] Among them, x is the number of data tables contained in the local database DB, c xy Indicates the name of the yth column corresponding to the xth data table.

[0125] In step S502 of some embodiments, the semantic edge relationship may be represented as a set R, where:

[0126] R = {r 1 ,r 2 ,…,r 25}

[0127] Among them, r represents each type of edge relationship. According to the above steps S401 to S403, it can be known that there are 25 types of semantic edge relationships in the embodiment of the present application.

[0128] Furthermore, the preset initialization matrix is ​​used as the relationship weight matrix W r =[x 1 ,x 2 ,...,x 25 ]; where x i Represents the weight of the i-th semantic edge relationship.

[0129] In the embodiment of the present application, both multi-head attention mechanism and semantic edge relationship are used to realize node aggregation. Specifically, the process of aggregating question semantic nodes, table feature nodes, and column feature nodes through the multi-head attention mechanism of the graph structure model can be expressed as:

[0130]

[0131]

[0132] in, is the attention head of node i at layer l+1, Represents vector x 1 to x k The splicing, is the normalized attention coefficient calculated by the k-th attention head in the l-th layer, is an input transformation matrix. The above formula can be used to obtain the node information of each question semantic node, table feature node, and column feature node in the l+1th layer after being aggregated by the multi-head attention mechanism.

[0133] Furthermore, a relation head is added as a relation gate to control the information flow from adjacent nodes, and the aggregation processing of adjacent question semantic nodes, table feature nodes, and column feature nodes is realized. The process can be expressed as

[0134]

[0135]

[0136]

[0137] Among them, r ij represents the relationship embedding between nodes i and j, which can be obtained based on the relationship weight matrix W r Obtained, thus we can obtain the node information of each question semantic node, table feature node, and column feature node of the l+1 layer after aggregation by the multi-head attention mechanism

[0138] The target node feature vector obtained by the above method includes two types of node information, namely, node information And node information

[0139] In step S503 of some embodiments, the node information aggregated by the relation head and the attention head in the target node feature vector is concatenated to obtain final node feature information, and the final node feature information is used as the graph semantic feature vector.

[0140] The above steps S501 to S503 can fully consider the mapping relationship between user data and local data, use the graph structure model to construct and extract structured information, fully capture the relationship and importance between questions, column names and table names, and realize the relationship reconstruction between local semantic representation vectors and question semantic vectors, thereby improving the accuracy of semantic parsing.

[0141] See also Figure 6 In some embodiments, step S106 includes but is not limited to steps S601 to S602:

[0142] Step S601, decoding the graph semantic feature vector through the decoding layer of the decoding model to obtain the target retrieval latent vector;

[0143] Step S602, sampling the target retrieval latent vector through the sampling layer of the decoding model to obtain the target retrieval sentence.

[0144] In step S601 of some embodiments, the graph semantic feature vector is decoded by the decoding layer of the decoding model to capture the semantic content information of the graph semantic feature vector, and the generated graph semantic feature vector is converted into an output sequence vector to obtain a target retrieval latent vector.

[0145] In step S602 of some embodiments, the target retrieval latent vector is downsampled by the sampling layer of the decoding model to obtain a target retrieval statement, wherein the target retrieval statement includes an SQL statement.

[0146] See also Figure 7 In some embodiments, after step S106, the semantic parsing method may further include but is not limited to steps S701 to S702:

[0147] Step S701, traverse the local database according to the target search statement to obtain the initial answer content;

[0148] Step S702, screening the initial answer content to obtain the target answer content, wherein the target answer content is used to reply to the user question in the user data.

[0149] In step S701 of some embodiments, the local database is traversed according to the target search statement, and the reply content matching the target search statement is retrieved in the local database to obtain the initial answer content.

[0150] In step S702 of some embodiments, the initial answer content can be screened in combination with the current dialogue context, and the initial answer content that meets the current dialogue context is selected as the target answer content, and the target answer content is used to reply to the user question in the user data. Alternatively, by comparing the matching degree of each initial answer content with the target search statement, the initial answer content with the highest matching degree is selected as the target answer content, wherein the matching degree can be calculated using the cosine similarity algorithm or other collaborative filtering algorithms without limitation.

[0151] Through the above steps S701 to S702, the local database can be searched more conveniently according to the target search statement in the form of SQL statements, and the initial answer content obtained by the search can be screened and processed, the target answer content can be selected as the query result, and a dialogue response can be generated based on the query result and fed back to the target user end to answer the questions raised by the user, thereby improving the reliability of the dialogue.

[0152] The semantic parsing method of the embodiment of the present application obtains local data of the local database and user data of the target user terminal; encodes the local data through a preset language model to obtain a local semantic vector, which can better retain the contextual semantic information of the local data and improve the semantic integrity of the local data. Encode the user data through a language model to obtain a question semantic vector, which can more conveniently obtain the question semantic content of the user question of the target user terminal; construct a semantic edge relationship based on the local semantic vector and the question semantic vector, which can fully consider the mapping relationship between user data and local data, effectively mine the fine-grained relationship between local semantic content and question semantic content, and realize the relationship construction between the local semantic representation vector and the question semantic vector; reconstruct the question semantic vector, the local semantic vector, and the semantic edge relationship through a preset graph structure model to obtain a graph semantic feature vector, which can jointly analyze the semantic content of the local database and the question content of the target user terminal to improve the accuracy of semantic parsing. Finally, decode the graph semantic feature vector through a preset decoding model to obtain a target search statement, wherein the target search statement is an SQL statement. This method can improve the logic of the generated target search statement, thereby improving the accuracy of semantic parsing.

[0153] See also Figure 8 The embodiment of the present application also provides a semantic parsing device, which can implement the above semantic parsing method, and the device includes:

[0154] The data acquisition module 801 is used to acquire local data of the local database and user data of the target user terminal;

[0155] A first encoding module 802 is used to encode local data using a preset language model to obtain a local semantic vector;

[0156] The second encoding module 803 is used to encode the user data through the language model to obtain a question semantic vector;

[0157] A relationship building module 804 is used to build a semantic edge relationship according to the local semantic vector and the question semantic vector;

[0158] The reconstruction module 805 is used to reconstruct the question semantic vector, the local semantic vector, and the semantic edge relationship through a preset graph structure model to obtain a graph semantic feature vector;

[0159] The decoding module 806 is used to decode the graph semantic feature vector through a preset decoding model to obtain a target search statement, wherein the target search statement includes an SQL statement.

[0160] In some embodiments, the local semantic vector includes a table name feature vector and a column name feature vector, and the first encoding module 802 includes:

[0161] A feature extraction unit, used to extract features from local data through a convolutional layer of a language model to obtain table feature data and column feature data;

[0162] A first encoding unit, used for encoding the table feature data through a first encoding layer of a language model to obtain a table feature vector;

[0163] The second encoding unit is used to encode the column feature data through the first encoding layer to obtain a column feature vector.

[0164] In some embodiments, the second encoding module 803 includes:

[0165] A word segmentation unit is used to perform word segmentation processing on user data through a word segmenter of a language model to obtain user question segments;

[0166] The third encoding unit is used to encode the user question segment through the second encoding layer of the language model to obtain a question semantic vector.

[0167] In some embodiments, the local semantic vector includes a table feature vector and a column feature vector, the semantic edge relationship includes a first edge relationship, a second edge relationship, and a third edge relationship, and the relationship construction module 804 includes:

[0168] A first matching unit is used to match the column feature vector and the table feature vector to obtain a first edge relationship;

[0169] A second matching unit is used to match the column feature vector and the question semantic vector to obtain a second edge relationship;

[0170] The third matching unit is used to match the table feature vector and the question semantic vector to obtain a third edge relationship.

[0171] In some embodiments, the reconstruction module 805 includes:

[0172] A nodeization unit is used to perform nodeization processing on the question semantic vector through a graph structure model to obtain a question semantic node, and to perform nodeization processing on the local semantic vector through a graph structure model to obtain a table feature node and a column feature node;

[0173] Aggregation unit, used to aggregate question semantic nodes, table feature nodes, and column feature nodes through the multi-head attention mechanism and semantic edge relationship of the graph structure model to obtain the target node feature vector;

[0174] The concatenation unit is used to concatenate multiple target node feature vectors to obtain a graph semantic feature vector.

[0175] In some embodiments, the decoding module 806 includes:

[0176] A decoding unit, used for decoding the graph semantic feature vector through a decoding layer of a decoding model to obtain a target retrieval latent vector;

[0177] The sampling unit is used to sample the target retrieval latent vector through the sampling layer of the decoding model to obtain the target retrieval sentence.

[0178] In some embodiments, the semantic parsing device further includes a retrieval module, specifically including:

[0179] A traversal unit, used to traverse the local database according to the target search statement to obtain the initial answer content;

[0180] The screening unit is used to screen the initial answer content to obtain the target answer content, wherein the target answer content is used to reply to the user question in the user data.

[0181] The specific implementation of the semantic parsing device is basically the same as the specific implementation of the above-mentioned semantic parsing method, and will not be repeated here.

[0182] The embodiment of the present application also provides an electronic device, the electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program is executed by the processor to realize the above-mentioned semantic parsing method. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0183] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0184] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0185] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the semantic parsing method of the embodiment of this application;

[0186] Input / output interface 903, used to implement information input and output;

[0187] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);

[0188] A bus 905 that transmits information between the various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);

[0189] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0190] An embodiment of the present application also provides a storage medium, which is a computer-readable storage medium used for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above-mentioned semantic parsing method.

[0191] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0192] The semantic parsing method, semantic parsing device, electronic device and storage medium provided in the embodiments of the present application obtain local data from a local database and user data of a target user terminal; encode the local data through a preset language model to obtain a local semantic vector, which can better preserve the contextual semantic information of the local data and improve the semantic integrity of the local data. The user data is encoded through the language model to obtain the question semantic vector, which can more conveniently obtain the question semantic content of the user question on the target user side; the semantic edge relationship is constructed according to the local semantic vector and the question semantic vector, which can fully consider the mapping relationship between the user data and the local data, effectively mine the fine-grained relationship between the local semantic content and the question semantic content, and realize the relationship construction between the local semantic representation vector and the question semantic vector; the question semantic vector, the local semantic vector, and the semantic edge relationship are reconstructed through the preset graph structure model to obtain the graph semantic feature vector, which can jointly analyze the semantic content of the local database and the question content of the target user side to improve the accuracy of semantic parsing. Finally, the graph semantic feature vector is decoded through the preset decoding model to obtain the target retrieval statement, where the target retrieval statement is an SQL statement. This method can improve the logic of the generated target retrieval statement, thereby improving the accuracy of semantic parsing.

[0193] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0194] It can be understood by those skilled in the art that Figure 1-7 The technical solutions shown in the figure do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figure, or a combination of certain steps, or different steps.

[0195] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0196] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0197] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0198] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0199] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0200] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0201] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0202] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0203] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A semantic parsing method, characterized in that: The method comprises: Obtain local data from the local database and user data from the target user terminal; Encoding the local data using a preset language model to obtain a local semantic vector; Encoding the user data through the language model to obtain a question semantic vector; Constructing a semantic edge relationship according to the local semantic vector and the question semantic vector, wherein the semantic edge relationship is obtained by matching the local semantic vector and the question semantic vector; Reconstructing the question semantic vector, the local semantic vector, and the semantic edge relationship through a preset graph structure model to obtain a graph semantic feature vector; Decoding the graph semantic feature vector through a preset decoding model to obtain a target search statement, wherein the target search statement includes an SQL statement; The local semantic vector includes a table feature vector and a column feature vector. The encoding process of the local data by using a preset language model to obtain the local semantic vector includes: Performing feature extraction on the local data through the convolution layer of the language model to obtain table feature data and column feature data; performing encoding processing on the table feature data through the first encoding layer of the language model to obtain the table feature vector; performing encoding processing on the column feature data through the first encoding layer to obtain the column feature vector; The reconstructing the question semantic vector, the local semantic vector, and the semantic edge relationship by using a preset graph structure model to obtain a graph semantic feature vector includes: The question semantic vector is node-processed through the graph structure model to obtain a question semantic node, and the local semantic vector is node-processed through the graph structure model to obtain a table feature node and a column feature node; the question semantic node, the table feature node, and the column feature node are aggregated through the multi-head attention mechanism of the graph structure model and the semantic edge relationship to obtain a target node feature vector; multiple target node feature vectors are spliced ​​to obtain the graph semantic feature vector.

2. The semantic parsing method according to claim 1, characterized in that: The step of encoding the user data by using the language model to obtain a question semantic vector comprises: Performing word segmentation processing on the user data by using the word segmenter of the language model to obtain user question segments; The user question segment is encoded through the second encoding layer of the language model to obtain a question semantic vector.

3. The semantic parsing method according to claim 1, characterized in that: The local semantic vector includes a table feature vector and a column feature vector, the semantic edge relationship includes a first edge relationship, a second edge relationship and a third edge relationship, and the step of constructing a semantic edge relationship according to the local semantic vector and the question semantic vector includes: Matching the column feature vector and the table feature vector to obtain the first edge relationship; Matching the column feature vector and the question semantic vector to obtain the second edge relationship; The table feature vector and the question semantic vector are matched to obtain the third edge relationship.

4. The semantic parsing method according to claim 1, characterized in that: The step of decoding the graph semantic feature vector by a preset decoding model to obtain a target search sentence includes: Decoding the graph semantic feature vector through the decoding layer of the decoding model to obtain a target retrieval latent vector; The target retrieval latent vector is sampled by the sampling layer of the decoding model to obtain the target retrieval sentence.

5. The semantic parsing method according to any one of claims 1 to 4, characterized in that: After the step of decoding the graph semantic feature vector by a preset decoding model to obtain a target search sentence, the method further includes: Traversing the local database according to the target search statement to obtain initial answer content; The initial answer content is screened to obtain target answer content, wherein the target answer content is used to reply to the user question in the user data.

6. A semantic analysis device, characterized in that: The device comprises: A data acquisition module is used to acquire local data from a local database and user data from a target user terminal; A first encoding module, used to encode the local data through a preset language model to obtain a local semantic vector; A second encoding module, used for encoding the user data through the language model to obtain a question semantic vector; A relationship building module, used to build a semantic edge relationship according to the local semantic vector and the question semantic vector, wherein the semantic edge relationship is obtained by matching the local semantic vector and the question semantic vector; A reconstruction module, used to reconstruct the question semantic vector, the local semantic vector, and the semantic edge relationship through a preset graph structure model to obtain a graph semantic feature vector; A decoding module, used for decoding the graph semantic feature vector through a preset decoding model to obtain a target search statement, wherein the target search statement includes an SQL statement; The local semantic vector includes a table feature vector and a column feature vector. The encoding process of the local data by using a preset language model to obtain the local semantic vector includes: Performing feature extraction on the local data through the convolution layer of the language model to obtain table feature data and column feature data; performing encoding processing on the table feature data through the first encoding layer of the language model to obtain the table feature vector; performing encoding processing on the column feature data through the first encoding layer to obtain the column feature vector; The reconstructing the question semantic vector, the local semantic vector, and the semantic edge relationship by using a preset graph structure model to obtain a graph semantic feature vector includes: The question semantic vector is node-processed through the graph structure model to obtain a question semantic node, and the local semantic vector is node-processed through the graph structure model to obtain a table feature node and a column feature node; the question semantic node, the table feature node, and the column feature node are aggregated through the multi-head attention mechanism of the graph structure model and the semantic edge relationship to obtain a target node feature vector; multiple target node feature vectors are spliced ​​to obtain the graph semantic feature vector.

7. An electronic device, characterized in that: The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the semantic parsing method as described in any one of claims 1 to 5 are realized.

8. A storage medium, the storage medium being a computer-readable storage medium, used for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the semantic parsing method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Semantic parsing method and semantic parser

    CN111382253A

  • Code separation with semantic guarantees

    US20140282372A1