A query statement generation method, related methods and devices

By filling and splicing natural language query statements in multiple rounds of dialogue scenarios, the problem of low accuracy of SQL statements in the existing technology is solved, and database query and analysis of e-commerce, payment, video and live broadcast platforms is realized.

CN113918589BActive Publication Date: 2025-08-12ALIBABA GROUP HOLDING LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010664003.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-10
Publication Date
2025-08-12
Estimated Expiration
2040-07-10

AI Technical Summary

Technical Problem

In the prior art, in multiple rounds of dialogue scenarios, the accuracy of converting natural language query statements to SQL statements is low, making it difficult to meet the database data query needs.

Method used

Through the slot recognition model, the natural language query statement of the current conversation round is input into the slot structure format. The empty slots are filled with the previous slot structure information, and the query statement is spliced to realize database query in multiple conversation scenarios.

Benefits of technology

It improves the accuracy of query statements in multiple rounds of dialogue scenarios, can accurately obtain the required data from the database, and is suitable for database query and analysis of e-commerce, payment, video and live broadcast platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113918589B_ABST
    Figure CN113918589B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for generating a query statement, and related methods and devices. The query statement generation method comprises: inputting a natural language query statement of a current dialogue turn into a slot recognition model to obtain current slot structure information; the current slot structure information includes slots in a preset slot structure format and named entities of the natural language query statement in the slots; if there are empty slots in the current slot structure information, obtaining prior slot structure information corresponding to a natural language query statement of at least one previous dialogue turn; filling the empty slots in the current slot structure information with named entities in the prior slot structure information; and concatenating the named entities corresponding to each slot in the filled current slot structure information to obtain a query statement. The present invention solves the problem of low query statement accuracy in multi-round dialogue scenarios in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing, and in particular to a method for generating a query statement, and related methods and devices. Background Art

[0002] Databases store a large amount of data. To retrieve data from a database, data query subjects, such as operations personnel or data analysts, typically use the Natural Language to Structured Query Language (NL2SQL) method. This method converts natural language query statements describing the desired query content into SQL statements, allowing ordinary query subjects to quickly retrieve the desired data.

[0003] The commonly used NL2SQL implementation uses an end-to-end deep learning model to encode natural language query statements and all table header information, then decode them to generate the corresponding SQL statements. Parsing natural language queries into SQL statements through this end-to-end approach only meets the requirements of a single conversation. When multiple conversations require changing query conditions based on contextual information, the resulting SQL statements have low accuracy because the contextual information of different conversation rounds is not linked in this end-to-end solution. This makes it difficult to obtain the data required for the current conversation round from the database. Summary of the Invention

[0004] In view of the above problems, the present invention is proposed to provide a query statement generation method, related methods and devices that overcome the above problems or at least partially solve the above problems.

[0005] In a first aspect, an embodiment of the present invention provides a method for generating a query statement, comprising the following steps:

[0006] Inputting the natural language query statement of the current dialogue turn into the slot recognition model to obtain current slot structure information; the current slot structure information includes a slot in a preset slot structure format and a named entity of the natural language query statement in the slot;

[0007] If there is an empty slot in the current slot structure information, obtain the previous slot structure information corresponding to at least one natural language query statement in the previous dialogue turn;

[0008] Filling empty slots in the current slot structure information with named entities in the previous slot structure information;

[0009] The named entities corresponding to the slots in the filled current slot structure information are concatenated to obtain a query statement.

[0010] In one embodiment, before inputting the natural language query statement of the current dialogue turn into the slot recognition model, the method further includes:

[0011] Creating a set of named entities corresponding to each slot in the preset slot structure format according to the pre-acquired metadata table;

[0012] Randomly extracting named entities from each of the sets to obtain multiple training samples;

[0013] Performing sequence labeling on the plurality of training samples to obtain labeled training samples;

[0014] The initial model is trained based on the labeled training samples to obtain the slot recognition model.

[0015] In one embodiment, training the initial model based on the labeled training samples to obtain the slot recognition model includes:

[0016] Segmenting the labeled training samples into characters to obtain character feature data corresponding to each character;

[0017] Inputting the character feature data into the bidirectional long short-term memory network in the initial model to obtain forward character feature data and reverse character feature data corresponding to each character feature data;

[0018] Fusing the forward word feature data and the reverse word feature data to obtain context word feature data;

[0019] Linearly projecting the context word feature data onto the conditional random field network in the initial model to obtain a slot recognition result of the labeled training sample;

[0020] Matching the sequence labeling results of the labeled training samples with the slot recognition results, and updating the network parameters of the slot recognition training model according to the matching results;

[0021] The above process is repeated until a preset matching result is reached to obtain the slot identification model.

[0022] In one embodiment, before inputting the natural language query statement of the current dialogue turn into the slot recognition model, the method further includes:

[0023] performing at least one of character conversion, special character processing, and character spelling correction on the natural language query statement to obtain a first candidate statement;

[0024] Completing the first candidate sentence based on at least one of the context information of the natural language query sentence, historical query data, and a preset data graph to obtain a second candidate sentence;

[0025] The second candidate sentence is rewritten to obtain a standardized natural language query sentence.

[0026] In one embodiment, rewriting the second candidate statement to obtain a standardized natural language query statement includes:

[0027] performing synonym replacement on the characters and / or words in the second candidate sentence to obtain a third candidate sentence;

[0028] Determining a data table where the data to be queried is located based on the context information and the third candidate statement;

[0029] Obtain dimension enumeration values and indicator information of the data table;

[0030] Calculating similarity by performing edit distance on the third candidate sentence according to the dimension enumeration value and the indicator information, and obtaining a fourth candidate sentence based on the similarity;

[0031] String matching and sorting are performed on the fourth candidate sentence to obtain the standardized natural language query sentence.

[0032] In one embodiment, obtaining previous slot structure information corresponding to at least one natural language query statement in a previous conversation turn, and filling empty slots in the current slot structure information with named entities in the previous slot structure information includes:

[0033] Obtaining the previous slot structure information corresponding to the natural language query statement of the previous dialogue round, and determining whether the slots corresponding to each empty slot in the current slot structure information have named entities;

[0034] If so, fill the named entity into the corresponding empty slot;

[0035] If not, obtain the previous slot structure information corresponding to at least one previous dialogue round close to the previous dialogue round according to the time distance from the current dialogue round, and fill the empty slot of the current slot structure information according to the previous slot structure information corresponding to the adjacent previous dialogue round.

[0036] In one embodiment, the slots of the preset slot structure format include:

[0037] Time slots are used to fill named entities corresponding to time;

[0038] The data table name slot is used to be filled with a named entity corresponding to the data table name;

[0039] The data table dimension slot is used to fill the named entity corresponding to the dimension enumeration value of the data table;

[0040] Data table metric slots, which are used to fill named entities corresponding to the metrics of the data table; and

[0041] Intent slots are used to fill in named entities corresponding to the query intent.

[0042] In a second aspect, an embodiment of the present invention provides a method for generating a slot recognition model, comprising:

[0043] Creating a set of named entities corresponding to each of the slots according to the pre-acquired metadata table;

[0044] Randomly extracting named entities from each of the sets to obtain multiple training samples;

[0045] Performing sequence labeling on the plurality of training samples to obtain labeled training samples;

[0046] The initial model is trained based on the labeled training samples to obtain a slot recognition model.

[0047] In a third aspect, an embodiment of the present invention provides a method for querying data in a database, comprising:

[0048] Obtain the query statement according to the above method;

[0049] According to the query statement, query data is obtained from the database to generate query results.

[0050] In a fourth aspect, an embodiment of the present invention provides a method for analyzing database data, comprising:

[0051] Obtain the query statement according to the above method;

[0052] According to the query statement, query data is obtained from the database, and the corresponding data analysis interface is called to analyze the query data and generate analysis results.

[0053] In a fifth aspect, an embodiment of the present invention provides a query statement generation device, comprising:

[0054] A slot recognition module, configured to input the natural language query statement of the current dialogue turn into a slot recognition model to obtain current slot structure information; the current slot structure information includes a slot in a preset slot structure format and a named entity of the natural language query statement in the slot;

[0055] A previous slot structure information acquisition module, configured to acquire previous slot structure information corresponding to at least one natural language query statement in a previous dialogue turn if there is an empty slot in the current slot structure information;

[0056] a slot structure information supplementing module, configured to fill empty slots in the current slot structure information with named entities in the previous slot structure information;

[0057] The query statement determination module is used to splice the named entities corresponding to the slots in the filled current slot structure information to obtain a query statement.

[0058] In a sixth aspect, an embodiment of the present invention provides a device for generating a slot recognition model, comprising:

[0059] A set determination module, configured to create a set of named entities corresponding to each of the slots according to a pre-acquired metadata table;

[0060] A sample acquisition module, configured to randomly extract named entities from each of the sets to obtain a plurality of training samples;

[0061] A sample labeling module is used to perform sequence labeling on the plurality of training samples to obtain labeled training samples;

[0062] The model training module is used to train the initial model based on the labeled training samples to obtain a slot recognition model.

[0063] In a seventh aspect, an embodiment of the present invention provides a data query device for a database, comprising:

[0064] A slot recognition module, configured to input the natural language query statement of the current dialogue turn into a slot recognition model to obtain current slot structure information; the current slot structure information includes a slot in a preset slot structure format and a named entity of the natural language query statement in the slot;

[0065] A previous slot structure information acquisition module, configured to acquire previous slot structure information corresponding to at least one natural language query statement in a previous dialogue turn if there is an empty slot in the current slot structure information;

[0066] a slot structure information supplementing module, configured to fill empty slots in the current slot structure information with named entities in the previous slot structure information;

[0067] A query statement determination module is used to concatenate the named entities corresponding to the slots in the filled current slot structure information to obtain a query statement;

[0068] The query result determination module is used to obtain query data from the database according to the query statement to obtain the query result.

[0069] In an eighth aspect, an embodiment of the present invention provides a data analysis device for a database, comprising:

[0070] A slot recognition module, configured to input the natural language query statement of the current dialogue turn into a slot recognition model to obtain current slot structure information; the current slot structure information includes a slot in a preset slot structure format and a named entity of the natural language query statement in the slot;

[0071] A previous slot structure information acquisition module, configured to acquire previous slot structure information corresponding to at least one natural language query statement in a previous dialogue turn if there is an empty slot in the current slot structure information;

[0072] a slot structure information supplementing module, configured to fill empty slots in the current slot structure information with named entities in the previous slot structure information;

[0073] A query statement determination module is used to concatenate the named entities corresponding to the slots in the filled current slot structure information to obtain a query statement;

[0074] The analysis result determination module is used to obtain query data from the database according to the query statement, and call the corresponding data analysis interface to analyze the query data to obtain the analysis result.

[0075] In the ninth aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the above-mentioned query statement generation method, slot recognition model generation method, database data query method, and database data analysis method.

[0076] In the tenth aspect, an embodiment of the present invention provides a database query device, comprising: a processor and a memory for storing processor executable commands; wherein the processor is configured to execute the above-mentioned query statement generation method, slot identification model generation method, database data query method and database data analysis method.

[0077] The beneficial effects of the above technical solutions provided by the embodiments of the present invention include at least:

[0078] The slot recognition model obtains the current slot structure information corresponding to the natural language query statement in the current conversation turn, supplements it with the previous slot structure information, and then constructs a query statement to enable interaction with the database. When the query statement is obtained, the current slot structure information is interacted with the previous slot structure information to fill in the empty slots in the current slot structure information. When the natural language query statement in the current conversation turn changes the query conditions based on the natural language query statement in the previous conversation turn, the required SQL statement can be accurately obtained and the required data can be obtained from the database. This is suitable for database queries in multi-round conversation scenarios.

[0079] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purposes and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.

[0080] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0082] Figure 1 Flowchart of a method for generating a query statement in an embodiment of the present invention;

[0083] Figure 2 Flowchart of a method for generating a slot identification model according to an embodiment of the present invention;

[0084] Figure 3 This is an example diagram of the implementation process principle of the method for generating a slot identification model in an embodiment of the present invention;

[0085] Figure 4 This is a schematic structural diagram of an initial model in an embodiment of the present invention;

[0086] Figure 5 This is an example diagram of the implementation process principle of the method for generating a query statement in an embodiment of the present invention;

[0087] Figure 6 Schematic diagram of the data query method of the database in an embodiment of the present invention;

[0088] Figure 7 This is a schematic diagram of a data query result of a database in an embodiment of the present invention;

[0089] Figure 8This is a flowchart of a method for analyzing database data in an embodiment of the present invention;

[0090] Figure 9 Schematic diagram of the structure of a query statement generating device according to an embodiment of the present invention;

[0091] Figure 10 Schematic diagram of the structure of a device for generating a slot identification model according to an embodiment of the present invention;

[0092] Figure 11 This is a schematic diagram of the structure of a data query device for a database in an embodiment of the present invention;

[0093] Figure 12 Schematic diagram of the structure of a data analysis device for a database in an embodiment of the present invention. DETAILED DESCRIPTION

[0094] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0095] In order to solve the problems existing in the above-mentioned prior art, the embodiment of the present invention provides a method for generating a query statement. The query statement described in the method for generating a query statement can be a Structured Query Language (SQL) statement, which can be called a structured query statement or an SQL statement. Figure 1 Shown, including:

[0096] S11: Inputting the natural language query statement of the current dialogue turn into a slot recognition model to obtain current slot structure information; the current slot structure information includes a slot in a preset slot structure format and a named entity (NE) of the natural language query statement in the slot;

[0097] S12: If there is an empty slot in the current slot structure information, obtain previous slot structure information corresponding to at least one natural language query statement in a previous dialogue turn;

[0098] S13: Filling empty slots in the current slot structure information with named entities in the previous slot structure information;

[0099] S14: Concatenate the named entities corresponding to the slots in the filled current slot structure information to obtain a structured query statement.

[0100] In an embodiment of the present invention, a slot is an attribute corresponding to a named entity in a natural language query statement, such as a time slot, a data table (Cube) name slot, a dimension slot, an indicator slot, and an intent slot corresponding to a metadata table in a database. The natural language query statement of the current dialogue round is input into a slot recognition model, which performs slot filling and fills the named entities of the natural language query statement into corresponding slots, i.e., annotates the defined attributes of the named entities. For example, if the natural language query statement is "the payment amount of last week", the slots involved include a time slot and an indicator slot. The attribute of the named entity "last week" should be defined as a time attribute, so the filled slot is a time slot, and the attribute of the named entity "payment amount" should be defined as an indicator attribute, so the filled slot is an indicator slot.

[0101] The above slot recognition model is obtained by training the initial model. Figure 2 As shown, before inputting the natural language query sentence of the current dialogue turn into the slot recognition model, the slot recognition model is trained by the following steps:

[0102] S21: creating a set of named entities corresponding to each slot in the preset slot structure format according to the pre-acquired metadata table;

[0103] S22: randomly extracting named entities from each of the sets to obtain multiple training samples;

[0104] S23: performing sequence labeling on the plurality of training samples to obtain labeled training samples;

[0105] S24: Training the initial model based on the labeled training samples to obtain a slot recognition model.

[0106] The inventors of the present invention analyzed commonly used natural language query statements and found that for any metadata table in a database, if you want to query the data corresponding to the metadata table, you need to clearly specify the data table (Cube) name of the metadata table corresponding to the data to be queried, for example, the data table name indicating the data source; the time range of the data to be queried, for example, the last 30 days, last week, yesterday, today, 10:00 am, etc.; the dimensions of the data to be queried in the data table, for example, the channel (i.e., data source), user type, etc.; the indicators of the data to be queried in the data table, for example, payment amount, conversation turn, etc.; the query intent includes data query and data analysis. Among them, data query is to directly perform statistics on the data in the database, while data analysis requires obtaining the data in the database and analyzing the data through the corresponding data analysis interface to obtain the analysis conclusion. The above-mentioned data analysis includes factor analysis, correlation analysis, attribution analysis, trend prediction, etc. If the query statement contains information such as "why it rises", "why it falls", "growth trend in the next year", etc., it can be determined that the query intent is data analysis. In an embodiment of the present invention, if a natural language query statement does not contain a named entity indicating that the query intent is data analysis, the default query intent is data query, not data analysis. Therefore, the natural language query statement is abstracted into a slot structure format that includes time (Time), data table (Cube) name, dimension (Dimension), metric (Measure), and query intent (Intent). The query statement in this slot structure format can cover all query requirements of the query object. Therefore, training samples can be generated based on annotation in this slot structure format.

[0107] In the embodiment of the present invention, any metadata table (Cube) in the database includes the data table (Cube) name, dimension enumeration values and various indicators, wherein the dimension enumeration values refer to all dimensions predefined in the metadata table that represent qualitative descriptions of the data, such as product name, user type, etc. Therefore, a data map can be constructed based on each metadata table in the database, and associations between data table (Cube) names and dimensions, data table (Cube) names and indicators, and dimensions and indicators can be established. In the embodiment of the present invention, the data table (Cube) names, dimensions, and indicators are all named entities, that is, multiple named entities and associations between named entities are constructed in the data map. Different training samples can be randomly constructed based on the data map, and each training sample can contain data that can be filled in with data table (Cube) name, time, dimension, indicator and meaning. Figure 5 A named entity that contains at least one of the slots.

[0108] In a specific embodiment, referring to Figure 3As shown, first, according to the data graph constructed by the metadata table, slot abstraction is performed to obtain a slot structure format including five slots: time (Time), data table (Cube) name, dimension (Dimension), indicator (Measure) and query intent (Intent), and according to the slot structure format, a named entity set corresponding to each slot is constructed respectively, including: randomly constructing different named entities corresponding to time, such as the past 30 days, last week, this week, the past 10 days, yesterday, today at 10 am and null value, etc., to obtain a named entity set corresponding to time; according to each named entity corresponding to the Cube name in the data graph, a named entity set corresponding to the Cube name is constructed; according to each named entity corresponding to the dimension in the data graph, such as the product name, channel, user type and other named entities, a named entity set corresponding to the dimension is constructed; according to each named entity corresponding to the indicator in the data graph, such as the payment amount, conversation turn, service resolution rate, etc., a named entity set corresponding to the indicator is constructed; randomly constructing different query intents, such as why it rises, why it falls, whether there is anomaly, null value and other named entities, to construct a named entity set corresponding to the intent.

[0109] Then, based on the established named entity sets, a random extraction model (Random Extract Model) uses a random extraction algorithm to extract named entities from at least one named entity set, and automatically construct multiple training samples. For example, if the name of a metadata table is A platform data, the dimension includes the channel A platform, the user type in the dimension includes ordinary members and premium members, and the indicator is the payment amount, then the training samples that can be randomly constructed include: "the payment amount of ordinary members on A platform in the past 30 days", "the payment amount in the past 30 days", "the payment amount of ordinary members in the past 30 days", "the payment amount of ordinary members in the past 30 days", "the payment amount of premium members in the past 30 days", "today's payment amount", "today's payment amount on A platform", etc. By randomly extracting named entities from each named entity set, different training samples are automatically constructed, and the slot label of each named entity in the training sample is determined, where the slot label indicates which slot the named entity is.

[0110] Next, we use the BIO method to perform sequence annotation on the automatically constructed training samples. For example, taking the training sample "UV of platform A" as an example, since the training samples come from various named entity sets, we can determine that the slot label of "platform A" is the data table name and the slot label of "UV" is the indicator. After using BIO annotation, the final labeled training sample is:

[0111]

[0112] Among them, B-Cube indicates that the corresponding character "A" belongs to the data table name slot and is at the beginning of the named entity; I-Cube indicates that the corresponding characters "Ping" and "Tai" belong to the data table name slot and are not at the beginning of the named entity; O indicates that the corresponding character "De" does not belong to the named entity; B-Measure indicates that the corresponding character "Jiao" belongs to the index slot and is at the beginning of the named entity; I-Measure indicates that the corresponding characters "Yi", "Jin", and "E" belong to the index slot and are not at the beginning of the named entity.

[0113] Finally, based on the labeled training samples, the initial model is trained to obtain a slot recognition model that can recognize each slot corresponding to the slot structure.

[0114] In the embodiment of the present invention, the trained slot recognition model can fill the corresponding named entity into the slot of the preset slot structure format. Among them, the time slot is used to fill the named entity corresponding to the time; the data table name slot is used to fill the named entity corresponding to the data table name; the data table dimension slot is used to fill the named entity corresponding to the dimension of the data table; the data table index slot is used to fill the named entity corresponding to the index of the data table; the intent slot is used to fill the named entity corresponding to the query intent.

[0115] Of course, the above slot structure format proposed in the embodiment of the present invention is only a specific implementation manner of the present invention. In order to more accurately label the named entities in the natural language query statement, other slots can be added based on this slot structure format. For example, a symbol slot can be added to fill the named entity corresponding to the operator. For example, if the natural language query statement includes at least one of "greater than", "less than", ">", and "<", it can be filled into the symbol slot.

[0116] In the prior art, during the generation process of training samples, manual intervention is required to screen and label the training samples. In the embodiment of the present invention, in order to reduce the influence of unnecessary human factors, training samples are automatically generated and labeled to quickly complete the training of the initial model. For any pre-obtained meta-data table, slot abstraction is performed according to each dimension and index of the meta-data table to create a set of named entities corresponding to each slot of the preset slot structure format; a random sampling algorithm is used to randomly sample named entities from the set of named entities corresponding to each slot to obtain multiple training samples. Moreover, when sampling named entities from each set of named entities, null values can also be sampled. Therefore, the multiple training samples obtained through the random sampling algorithm can cover all forms of natural language query statements of the user and can take into account each dimension and index in the meta-data table.

[0117] In an embodiment of the present invention, no human intervention is required in the process of creating a set of named entities, generating training samples, and labeling training samples. The initial model is trained on the labeled training samples obtained based on the above method provided by the embodiment of the present invention to obtain a slot recognition model, which can speed up the model training speed and improve the model training efficiency.

[0118] In a specific embodiment, the above-mentioned training of the initial model based on the labeled training samples to obtain the slot recognition model includes:

[0119] Segmenting the labeled training samples into characters to obtain character feature data corresponding to each character;

[0120] Inputting the character feature data into the bidirectional long short-term memory network in the initial model to obtain forward character feature data and reverse character feature data corresponding to each character feature data;

[0121] Fusing the forward word feature data and the reverse word feature data to obtain context word feature data;

[0122] Linearly projecting the context word feature data onto the conditional random field network in the initial model to obtain a slot recognition result of the labeled training sample;

[0123] Matching the sequence labeling results of the labeled training samples with the slot recognition results, and updating the network parameters of the slot recognition training model according to the matching results;

[0124] The above process is repeated until a preset matching result is reached to obtain the slot identification model.

[0125] In an embodiment of the present invention, the process of executing the initial model training can be executed in the server. Through the initial model, the slot recognition problem is abstracted into a sequence labeling problem, and the slot recognition model is trained. As a specific implementation of the embodiment of the present invention, the initial model is a Bi-directional Long Short-Term Memory-Conditional Random Field (BiLSTM-CRF) model. Figure 4As shown, the initial model is divided into three layers, wherein the first layer is the representation layer, which is used for word encoding (Word Embeddings). In the representation layer, a machine learning training tool, such as FASTTEXT, can be used in advance to train based on data obtained by existing technologies to build a mapping relationship table between words and word feature data; the second layer is the BiLSTM layer, which is used to process the input word feature data to obtain contextual word feature data containing context information; the third layer is the CRF layer. Since the CRF layer has transfer features, it can process the input contextual word feature data to obtain the slot recognition results of the labeled training samples.

[0126] In a specific embodiment, it can be, referring to Figure 4 As shown in FIG, the labeled training sample “UV of platform A” is input into the initial model, where “UV” is the abbreviation of Unique Visitor, which means the number of independent visitors. First, word embeddings are performed through the representation layer, and the word feature data corresponding to each word is obtained according to the mapping relationship table between words and word feature data; then, the word feature data is input into the BiLSTM layer in the initial model to obtain the forward word feature data and reverse word feature data corresponding to each word feature data; the forward word feature data and reverse word feature data corresponding to each word are fused to obtain the corresponding context word feature data, wherein Li represents the forward word feature data of word I, Ri represents the forward word feature data of word I, and Ci represents the forward word feature data of word I; finally, the context word feature data is linearly projected onto the CRF layer in the initial model to obtain the slot recognition result of the labeled training sample, wherein B-Cube indicates that the corresponding word "A" belongs to the data table name slot and is at the beginning of the named entity; I-Cube indicates that the corresponding words "ping" and "tai" belong to the data table name slot and are not at the beginning of a named entity; O indicates that the corresponding word "de" does not belong to a named entity; B-Measure indicates that the corresponding word "UV" belongs to the indicator slot and is at the beginning of a named entity.

[0127] The BiLSTM-CRF model provided in the embodiment of the present invention has a CRF layer after the BiLSTM layer. This is because although the result output by the BiLSTM layer has learned the context information, if softmax is directly used to output a label corresponding to the maximum probability value, the context word feature data corresponding to each word are independent of each other, which will cause the final slot recognition result to have two or more labels representing the beginning of the named entity connected, such as a B-Cube followed by a B-Cube, causing the slot recognition result to be wrong. The output result obtained by the CRF layer can consider the order between different labels, and the obtained slot recognition result is more accurate. The initial model in the embodiment of the present invention uses Bi-LSTM to encode the input sequence to complete feature extraction, and then uses CRF to decode the obtained features to obtain the final sequence labeling result, i.e., the slot recognition result.

[0128] Of course, the initial model provided in the embodiment of the present invention can also be various other types of deep learning network models. For example, the initial model can be an LSTM model, a CNN+BiLSTM+CRF model, a CRF model, etc., as long as it can display the purpose of slot identification. In the embodiment of the present invention, there is no specific limitation on the specific model structure adopted by the initial model.

[0129] In the prior art, data query subjects, such as operations personnel or data analysts, can write a Structured Query Language (SQL) statement to interact with the database in order to obtain the desired data from the database, or use reports built by Business Intelligence (BI) tools to obtain data from the database through dimension filtering. However, ordinary query personnel do not have the ability to write SQL statements, and every change in query conditions requires modifying the SQL statement and re-querying. The reports built by BI tools have already defined the data dimensions and filterable content in advance. Once the desired data is not within the scope of the interactive dimensions, a new BI tool needs to be redeveloped. These two data query methods are cumbersome and time-consuming. In order to allow ordinary query subjects to obtain the desired content anytime and anywhere, the NL2SQL method can be used to convert the natural language query statement describing the desired content into an SQL statement, allowing ordinary query subjects to quickly obtain the desired data.

[0130] The commonly used implementation methods of the NL2SQL method are: 1. Design an expert system based on the basic concepts of syntactic and semantic knowledge, and map all possible natural language query statements to SQL language one-to-one. When a query request is received, a similarity selection algorithm can be used to select an SQL result suitable for a natural language query statement from multiple results; 2. Use semantic rules to find the relationship between the words appearing in the natural language query statement and the attributes in the database, and establish a data table (Cube) template. When a query request is received, the query conditions in the natural language query statement can be mapped to the data table template, and then the corresponding query results can be obtained; 3. Through an end-to-end deep learning model, the natural language query statement and all table header information of the data table are encoded, and then decoded to generate the corresponding SQL statement. Both methods 1 and 2 require manual maintenance of a rule base that conforms to grammatical or semantic rules. Therefore, it is difficult to develop a universal database query solution applicable to different data query scenarios, and the manual maintenance cost is high. Method 3, on the other hand, parses the query statement of the query object into SQL statements in an end-to-end manner, which can only meet the requirements of a single conversation. In a multi-round conversation scenario, if the natural language query statement of a later conversation round lacks the necessary named entities, the query statement of the later conversation round needs to be completed based on the context information of the earlier conversation round. In this case, if the context information of the earlier conversation round is not available, the SQL statement parsing will cause errors. If the context information of the earlier conversation round is available, it is necessary to resolve ambiguities between multiple conversation rounds and fuse the natural language query statements of the later conversation round and the earlier conversation round. This may require a lot of information to be fused, and due to the complex relationships between the natural language query statements of multiple conversation rounds, the accuracy of the resulting SQL statement is low, making it difficult to obtain the required data from the database.

[0131] In this embodiment of the present invention, a slot recognition model is used to obtain the current slot structure information corresponding to the natural language query statement in the current conversation turn. This information is then supplemented based on the previous slot structure information to create a structured query statement, enabling interaction with the database. When the structured query statement is generated, empty slots in the current slot structure information are filled through interaction between the current slot structure information and the previous slot structure information. When the natural language query statement in the current conversation turn modifies the query conditions based on the natural language query statement in the previous conversation turn, the required SQL statement can be accurately obtained, and the required data can be retrieved from the database. This approach is suitable for database queries in multi-turn conversation scenarios.

[0132] In a specific embodiment, the query statement generation method provided by the embodiment of the present invention can be applied to different application scenarios, including database query or analysis of e-commerce service platforms, database query or analysis of payment platforms, data block query or analysis of video platforms, and database query or analysis of live broadcast platforms. For example, in the database query application scenario of the e-commerce service platform, users of the e-commerce service platform, including data analysts and merchants of the e-commerce service platform, can query the data in the database of the e-commerce service platform to achieve data statistics and analysis. The data analyst or merchant of the platform only needs to input the content to be queried or analyzed, that is, the natural language query statement, and can obtain the SQL language for querying the database of the e-commerce service platform through the above query statement generation method. The obtained SQL language can quickly query the appropriate data from the database of the e-commerce service platform and display it to the data analyst or merchant in a suitable display mode, such as generating a graph, text, or table, to meet the user's need to query the database anytime and anywhere. It should be noted that through the query statement generation method provided by the embodiment of the present invention, the user can query different data from the database through multiple rounds of dialogue (including two or more dialogue rounds) and obtain different query results.

[0133] For example, if a data analyst of an e-commerce service platform wants to query both the transaction amounts of the e-commerce service platform in the last 30 days and the transaction amounts of the e-commerce service platform in the last 7 days, then in the first round of dialogue, the data analyst needs to enter the natural language query statement "transaction amounts of the e-commerce service platform in the last 30 days" to obtain the SQL statement corresponding to the natural language query statement, thereby querying the data in the database of the e-commerce service platform and obtaining the query results of the transaction amounts of the e-commerce service platform in the last 30 days; in the second round of dialogue, as long as the natural language query statement entered by the data analyst contains the time information "in the last 7 days", for example, the natural language query statement entered in the second round of dialogue is "in the last 7 days", the above-mentioned query statement generation method can be used to fill the empty slots in the slot structure information corresponding to the natural language query statement entered in the second round of dialogue using the slot structure information when the SQL statement is obtained in the first round of dialogue, thereby obtaining the SQL statement corresponding to the natural language query statement of the second round of dialogue (i.e., "in the last 7 days"), thereby querying the data in the database of the e-commerce service platform and obtaining the query results of the transaction amounts of the e-commerce service platform in the last 7 days.

[0134] In an embodiment of the present invention, to make slot recognition results more accurate and to implement database queries more quickly, the natural language query statement of the current conversation turn may be standardized before being input into the slot recognition model. Specific implementation steps may include:

[0135] performing at least one of character conversion, special character processing, and character spelling correction on the natural language query statement to obtain a first candidate statement;

[0136] Completing the first candidate sentence based on at least one of the context information of the natural language query sentence, historical query data, and a preset data graph to obtain a second candidate sentence;

[0137] The second candidate sentence is rewritten to obtain a standardized natural language query sentence.

[0138] In an embodiment of the present invention, since the natural language query statements of the usage objects are highly arbitrary, there may be some characters whose case is not strictly distinguished, or there may be both simplified and traditional characters. Therefore, the natural language query statements of the usage objects can be preprocessed, and character processing such as uppercase and lowercase conversion and simplified and traditional character conversion can be performed on the natural language query statements.

[0139] In an embodiment of the present invention, spelling errors may occur in the natural language query statement of the object being used. For example, if the natural language query statement is "the weather in the near future", then "the near future" may be a spelling error, or if the natural language query statement is "the weather in today's weather", then the "air" in "today's weather" may be a redundant word. Therefore, the natural language query statement of the object being used can be preprocessed to perform character spelling correction (or typo correction). In an embodiment of the present invention, taking the correction of the spelling error of "near future" as an example, the process of character spelling correction is explained: all the words in the basic dictionary obtained by word segmentation are represented in pinyin in advance, so all the words with the pinyin of "jintian" can be obtained, and a relationship database between pinyin and words is constructed. The probability of misspelling "today" as "near future", "jintian", "only future", etc. is calculated through the relationship database. If it is finally identified that the probability of misspelling "today" as "near future" is greater than the preset probability, it is determined that "near future" is a spelling error and needs to be replaced with "today".

[0140] In an embodiment of the present invention, the natural language query statement of the object may include some special characters that cannot be recognized by the slot recognition model, such as some disordered characters, characters that are not normal natural language symbols, web page links, etc. Therefore, the natural language query statement of the object can be processed with special characters to remove the special characters in the query statement.

[0141] In an embodiment of the present invention, the first candidate sentence obtained by the above preprocessing may lack a named entity corresponding to a slot label, or a named entity may omit some characters or words. For example, in multiple rounds of dialogue, the sentence used by the user in the first round of dialogue is "the service resolution rate of platform A in the past 10 days", and the sentence in the current round of dialogue is "what about the past 30 days?" Then, based on the context information, it can be known that the sentence used by the user in the current round of dialogue should mean "what about the service resolution rate of platform A in the past 30 days?" Therefore, in order to obtain the slot recognition result faster, the named entity corresponding to the slot label of the sentence in the previous dialogue round can be used to complete the missing named entity in the current round of dialogue based on the context information.

[0142] Alternatively, based on statistics on the historical query data of the user object, the preference query statement of the user object is obtained, and the natural language query statement of the user object is completed. For example, the natural language query statement of the user object is "the resolution rate of platform A in the past 10 days". By statistics on the historical query data of the user object, it is concluded that the user preference is to query the service resolution rate of platform A. Then, the "resolution rate of platform A in the past 10 days" of this round of conversation can be completed as "the service resolution rate of platform A in the past 10 days".

[0143] Alternatively, by querying the data graph, the natural language query statement of the object of use is completed. For example, the natural language query statement of the object of use is "the resolution rate of platform A in the past 10 days". By querying the data table names, dimensions and indicators included in the data graph and the relationship between them, it is found that the indicator associated with the data table name corresponding to platform A is only "service resolution rate" but not "resolution rate". Then, the "resolution rate of platform A in the past 10 days" of this round of conversation can be completed as "service resolution rate of platform A in the past 10 days".

[0144] In a specific embodiment, the above-mentioned rewriting of the second candidate sentence to obtain a standardized natural language query sentence includes:

[0145] performing synonym replacement on the characters and / or words in the second candidate sentence to obtain a third candidate sentence;

[0146] Determining a data table where the data to be queried is located based on the context information and the third candidate statement;

[0147] Get dimension enumeration values and indicator information of the data table;

[0148] Calculating similarity of the third candidate sentence based on edit distance (ED) according to the dimension enumeration value and the indicator information, and obtaining a fourth candidate sentence based on the similarity;

[0149] String matching and sorting are performed on the fourth candidate sentence to obtain the standardized natural language query sentence.

[0150] In an embodiment of the present invention, in order to facilitate the query of the user object, a synonym library can be pre-defined, such as some abbreviation synonyms of named entities, such as abbreviating "unique visitor number" as "UV", or some shortcut phrases corresponding to named entities can be pre-defined by the user object. In order to make the natural language query statement of the input slot recognition model more standard, the named entities in the above-mentioned second candidate statement can be replaced with synonyms, and the abbreviation synonyms or shortcut phrases can be replaced with standard named entities to obtain a third candidate statement.

[0151] In an embodiment of the present invention, for a natural language query statement of an object, we need to determine whether the user has the permission to query the corresponding data table. Therefore, it is also necessary to determine whether the object has the permission to query the corresponding data table based on the context information and the query statement. When it is determined that the object has the query permission, the data table name, dimension enumeration value and indicator information as well as the association relationship between the data table name, dimension and indicator are obtained from the preset data map according to the name of the data table (Cube) to be queried. The similarity between the named entity and the data table name, dimension and indicator in the third candidate statement is calculated based on the edit distance, and the fourth candidate statement is obtained based on the similarity. In an embodiment of the present invention, the edit distance refers to the minimum number of operations required to convert one string into another string. The smaller the degree of difference between the two named entities, that is, the smaller the edit distance, the higher the similarity between the two named entities.

[0152] In an embodiment of the present invention, there may be multiple fourth candidate sentences obtained by screening, so a standardized natural language query sentence can be finally obtained by performing string matching and ranking processing with the natural language query sentence of the object of use. If there are multiple fourth candidate sentences, the natural language query sentence of the object of use can be string matched with multiple fourth candidate sentences in the manner of the prior art, and the multiple matched fourth candidate sentences can be ranked according to the preset sorting rules, and the candidate sentence with the highest ranking is selected as the standardized natural language query sentence. The preset sorting rules can, for example, be the number of repeated words between the natural language query sentence of the object of use and the fourth candidate sentence, the number of repetitions of the named entity, or encoding the natural language query sentence of the object and the fourth candidate sentence into word feature data respectively, and calculating the similarity of the encoded word feature data.

[0153] Reference Figure 5As shown, for the convenience of description, "Query" is used to represent "natural language query statement" in the figure. For the query of the usage object, such as "the conversation turn of super members of platform A", first, query standardization processing is performed, including query preprocessing, query completion and query rewriting, wherein query preprocessing can include at least one of case conversion, simplified and traditional Chinese conversion, typo correction and special character processing, query completion includes completion based on context information, completion based on historical query data and completion based on data graph, and the query rewriting process includes synonym replacement, determination of data table name, calculation of similarity based on edit distance (ED), and string matching and sorting processing. Then, the standardized query is input into the slot recognition model to obtain the current slot structure information.

[0154] In an embodiment of the present invention, before obtaining the previous slot structure information corresponding to the natural language query statement of at least one previous dialogue turn, the method further includes:

[0155] Determine whether there is an empty slot in the current slot structure information. If not, concatenate the slots in the current slot structure information to obtain a structured query statement.

[0156] If so, obtain the previous slot structure information corresponding to at least one natural language query statement in the previous dialogue turn.

[0157] In an embodiment of the present invention, obtaining previous slot structure information corresponding to at least one natural language query statement in a previous conversation turn, and filling empty slots in the current slot structure information with named entities in the previous slot structure information, includes:

[0158] Obtaining the previous slot structure information corresponding to the natural language query statement of the previous dialogue round, and determining whether the slots corresponding to each empty slot in the current slot structure information have named entities;

[0159] If so, fill the named entity into the corresponding empty slot;

[0160] If not, obtain the previous slot structure information corresponding to at least one previous dialogue round close to the previous dialogue round according to the time distance from the current dialogue round, and fill the empty slot of the current slot structure information according to the previous slot structure information corresponding to the adjacent previous dialogue round.

[0161] In a specific embodiment, it may be that the previous slot structure information corresponding to the previous dialogue round is first obtained, and the current slot structure information is compared with each corresponding slot in the previous slot structure information;

[0162] If a slot in the current slot structure information is an empty slot, and a slot corresponding to the empty slot in the previous slot structure information is a non-empty slot, then filling the named entity in the non-empty slot in the previous slot structure information into the corresponding empty slot in the current slot structure information;

[0163] If, after supplementing the current slot structure information with the previous slot structure information corresponding to the previous conversation round, there are still empty slots in the supplemented current slot structure information, that is, the previous slot structure information corresponding to the previous conversation round also has empty slots, then the previous slot structure information corresponding to the previous conversation round closest to the previous conversation round is obtained according to the time distance from the current conversation round, and the empty slots of the current slot structure information are filled with the previous slot structure information according to the previous slot structure information corresponding to the closest previous conversation round. The above process is repeated until all slots in the supplemented current slot structure information are filled with named entities.

[0164] In the embodiment of the present invention, an empty slot may be a slot that is not filled with a named entity, and a non-empty slot may be a slot that is filled with a named entity.

[0165] Example 2

[0166] The embodiment of the present invention provides a method for generating a slot recognition model, the process of which is as follows: Figure 2 As shown, the following steps are included:

[0167] S21: creating a set of named entities corresponding to each slot in the preset slot structure format according to the pre-acquired metadata table;

[0168] S22: randomly extracting named entities from each of the sets to obtain multiple training samples;

[0169] S23: performing sequence labeling on the plurality of training samples to obtain labeled training samples;

[0170] S24: Training the initial model based on the labeled training samples to obtain a slot recognition model.

[0171] The inventors of the present invention analyzed commonly used natural language query statements and concluded that, for any metadata table in a database, if one wishes to query the data corresponding to the metadata table, one must clearly define the data table (Cube) name of the metadata table corresponding to the data to be queried, the time range of the data to be queried, the dimensions of the data to be queried in the data table, the indicators of the data to be queried in the data table, and the query intent. Therefore, the natural language query statement is abstracted into a slot structure format that includes time (Time), data table (Cube) name, dimension (Dimension), indicator (Measure), and query intent (Intent). The query statement in this slot structure format can cover all query requirements of the query object, and therefore, training samples can be generated based on annotations in this slot structure format.

[0172] In a specific embodiment, referring to Figure 3 As shown, first, based on the data graph constructed by the metadata table, slot abstraction is performed to obtain a slot structure format including five slots: time (Time), data table (Cube) name, dimension (Dimension), indicator (Measure) and query intent (Intent), and a named entity set corresponding to each slot is constructed according to the slot structure format, including: randomly constructing different named entities corresponding to time, such as the named entities of the past 30 days, last week, this week, the past 10 days, yesterday, today at 10 am and null values, to obtain a named entity set corresponding to time; according to the data graph For each named entity corresponding to the data table (Cube) name, a named entity set corresponding to the data table (Cube) name is constructed; according to each named entity corresponding to the dimension of the data graph, such as product name, channel, user type and other named entities, a named entity set corresponding to the dimension is constructed; according to each named entity corresponding to the indicator of the data graph, such as payment amount, conversation rounds, service resolution rate, etc., a named entity set corresponding to the indicator is constructed; different query intentions are randomly constructed, such as why it rises, why it falls, whether there are any anomalies, null values and other named entities, to construct a named entity set corresponding to the intention.

[0173] Then, based on the established named entity sets, the Random Extract Model uses the random extraction algorithm to extract named entities from at least one named entity set and automatically constructs multiple training samples. For example, if the name of a metadata table is A platform data, the dimensions include the channel as A platform, the user types in the dimensions include ordinary members and premium members, and the metric is payment amount, then the randomly constructed training samples may include: "Payment amount of ordinary members on A platform in the past 30 days", "Payment amount in the past 30 days", "Payment amount of ordinary members in the past 30 days", "Payment amount of ordinary members in the past 30 days", "Payment amount of premium members in the past 30 days", "Payment amount today", "Payment amount on A platform today", etc. By randomly extracting named entities from each named entity set, different training samples are automatically constructed, and the slot labels of each named entity in the training samples are determined, where the slot label indicates which slot the named entity belongs to.

[0174] Next, the sequence labeling of the multiple automatically constructed training samples is performed in the automatic annotation (BIO) manner of the training samples. For example, taking the training sample "UV of A platform" as an example, since the training sample comes from each named entity set, the slot label of "A platform" can be determined as the data table name, and the slot label of "UV" can be determined as the metric. After BIO annotation, the finally obtained labeled training sample is:

[0175]

[0176] Among them, B-Cube indicates that the corresponding character "A" belongs to the data table name slot and is at the beginning of the named entity; I-Cube indicates that the corresponding characters "ping" and "tai" belong to the data table name slot and are not at the beginning of the named entity; O indicates that the corresponding character "de" does not belong to the named entity; B-Measure indicates that the corresponding character "jiao" belongs to the metric slot and is at the beginning of the named entity; I-Measure indicates that the corresponding characters "yi", "jin", and "e" belong to the metric slot and are not at the beginning of the named entity.

[0177] Finally, the initial model is trained based on the labeled training samples to obtain a slot recognition model that can recognize each slot corresponding to the slot structure. The trained slot recognition model can fill the corresponding named entity into the slot of the preset slot structure format. Among them, the time slot is used to fill the named entity corresponding to the time; the data table name slot is used to fill the named entity corresponding to the data table name; the data table dimension slot is used to fill the named entity corresponding to the dimension of the data table; the data table metric slot is used to fill the named entity corresponding to the metric of the data table; the intent slot is used to fill the named entity corresponding to the query intent.

[0178] Of course, the above-mentioned slot structure format proposed in the embodiment of the present invention is only a specific implementation method of the present invention. In order to more accurately mark the named entities of the natural language query statement, other slots can be added on the basis of the slot structure format, such as adding a symbol slot to fill in the named entities corresponding to the operator. For example, if the natural language query statement includes at least one of "greater than", "less than", ">" and "<", the symbol slot can be filled.

[0179] In the prior art, manual intervention is required to screen and label training samples during the training sample generation process. In an embodiment of the present invention, in order to reduce the influence of unnecessary human factors, training samples are automatically generated and labeled so as to quickly complete the training of the initial model. For any pre-acquired metadata table, slot abstraction is performed according to the various dimensions and indicators of the metadata table, and a set of named entities corresponding to each slot in a preset slot structure format is created; a random extraction algorithm is used to randomly extract named entities from the set of named entities corresponding to each slot to obtain multiple training samples, and when extracting named entities from the set of each named entity, null values can also be extracted. Therefore, the multiple training samples obtained by the random extraction algorithm can cover the forms of all natural language query statements using the object, and can take into account the various dimensions and indicators in the metadata table.

[0180] In an embodiment of the present invention, no human intervention is required in the process of creating a set of named entities, generating training samples, and labeling training samples. The initial model is trained on the labeled training samples obtained based on the above method provided by the embodiment of the present invention to obtain a slot recognition model, which can speed up the model training speed and improve the model training efficiency.

[0181] In a specific embodiment, the above-mentioned training of the initial model based on the labeled training samples to obtain the slot recognition model includes:

[0182] Segmenting the labeled training samples into characters to obtain character feature data corresponding to each character;

[0183] Inputting the character feature data into the bidirectional long short-term memory network in the initial model to obtain forward character feature data and reverse character feature data corresponding to each character feature data;

[0184] Fusing the forward word feature data and the reverse word feature data to obtain context word feature data;

[0185] Linearly projecting the context word feature data onto the conditional random field network in the initial model to obtain a slot recognition result of the labeled training sample;

[0186] Match the sequence annotation result of the labeled training sample with the slot recognition result, and update the network parameters of the slot recognition training model according to the matching result;

[0187] Repeat the above process until a preset matching result is reached to obtain the slot recognition model.

[0188] In the embodiment of the present invention, the process of performing initial model training can be executed in a server. Through this initial model, the slot recognition problem is abstracted into a sequence annotation problem, and a slot recognition model is trained. As a specific implementation manner of the embodiment of the present invention, the initial model is a BiLSTM-CRF model. Refer to Figure 4 As shown, the initial model is divided into three layers. Among them, the first layer is the representation layer for word encoding (Word Embeddings). In the representation layer, a mapping relationship table of words and word feature data can be constructed by pre-training through a machine learning training tool, such as FASTTEXT, based on the data in the prior art; the second layer is the BiLSTM layer for processing the input word feature data to obtain context word feature data containing context information; the third layer is the CRF layer. Since the CRF layer has transition features, it can process the input context word feature data to obtain the slot recognition result of the labeled training sample.

[0189] In a specific embodiment, it can be, refer to Figure 4 As shown, when the labeled training sample "UV of A platform" is input into the initial model, first, word splitting processing (Word Embeddings) is performed through the representation layer, and according to the mapping relationship table of words and word feature data, the word feature data corresponding to each word is obtained; then, the word feature data is input into the BiLSTM layer in the initial model to obtain the forward word feature data and backward word feature data corresponding to each word feature data; the forward word feature data and backward word feature data corresponding to each word are fused to obtain the corresponding context word feature data, where Li represents the forward word feature data of word I, Ri represents the forward word feature data of word I, and Ci represents the forward word feature data of word I; finally, the context word feature data is linearly projected into the conditional random field network in the initial model to obtain the slot recognition result of the labeled training sample. Among them, B-Cube indicates that the corresponding word "A" belongs to the data table name slot and is at the beginning of the named entity; I-Cube indicates that the corresponding words "ping" and "tai" belong to the data table name slot and are not at the beginning of the named entity; O indicates that the corresponding word "de" does not belong to the named entity; B-Measure indicates that the corresponding word "UV" belongs to the indicator slot and is at the beginning of the named entity.

[0190] The BiLSTM-CRF model provided in the embodiment of the present invention has a CRF layer after the BiLSTM layer. This is because although the result output by the BiLSTM layer has learned the context information, if softmax is directly used to output a label corresponding to the maximum probability value, the context word feature data corresponding to each word are independent of each other, which will cause the final slot recognition result to have two or more labels representing the beginning of the named entity connected, such as a B-Cube followed by a B-Cube, causing the slot recognition result to be wrong. The output result obtained by the CRF layer can consider the order between different labels, and the obtained slot recognition result is more accurate. The initial model in the embodiment of the present invention uses Bi-LSTM to encode the input sequence to complete feature extraction, and then uses CRF to decode the obtained features to obtain the final sequence labeling result, i.e., the slot recognition result.

[0191] Of course, the initial model provided in the embodiment of the present invention can also be various other types of deep learning network models. For example, the initial model can be an LSTM model, a CNN+BiLSTM+CRF model, a CRF model, etc., as long as it can display the purpose of slot identification. In the embodiment of the present invention, there is no specific limitation on the specific model structure adopted by the initial model.

[0192] Example 3

[0193] The embodiment of the present invention provides a method for querying data in a database, the process of which is as follows: Figure 6 As shown, the following steps are included:

[0194] S11: Inputting the natural language query statement of the current dialogue turn into a slot recognition model to obtain current slot structure information; the current slot structure information includes a slot in a preset slot structure format and a named entity of the natural language query statement in the slot;

[0195] S12: If there is an empty slot in the current slot structure information, obtain previous slot structure information corresponding to at least one natural language query statement in a previous dialogue turn;

[0196] S13: Filling empty slots in the current slot structure information with named entities in the previous slot structure information;

[0197] S14: concatenating the named entities corresponding to the slots in the filled current slot structure information to obtain a structured query statement;

[0198] S15: According to the structured query statement, query data is obtained from the database to generate a query result.

[0199] The database data query method provided by the embodiment of the present invention determines that the query intention is a data query based on the information of the intention slot of the obtained structured query statement, and then executes the process of obtaining query data from the database and generating query results.

[0200] Reference Figure 5 As shown, for the convenience of description, "Query" is used in the figure to represent "natural language query statement". Query standardization processing is performed on the query using the object, including query preprocessing, query completion and query rewriting. Query preprocessing can include at least one of case conversion, simplified and traditional Chinese conversion, typo correction and special character processing. Query completion includes completion based on context information, completion based on historical query data and completion based on data graphs. The query rewriting process includes synonym replacement, determination of data table name, calculation of similarity based on edit distance (ED), and string matching and sorting. Next, the standardized query is input into the slot recognition model to obtain the current slot structure information.

[0201] Reference Figure 7 As shown, assuming that the query of the previous conversation round of the object is "the conversation round of ordinary members of platform A", and the query of the current conversation round is "what about super members", then it is determined that there are empty slots in the current slot structure information, and the previous slot structure information corresponding to the query of the previous conversation round is obtained; according to the comparison results of the current slot structure information and the corresponding slots in the previous slot structure information, the current slot structure information is supplemented; and the slots in the supplemented current slot structure information are spliced to obtain a structured query statement. Figure 7 As shown, assuming that the user had the above two rounds of conversations on March 7, 2020, in the previous conversation round, according to the query "Conversation rounds of ordinary members of platform A", the query result for the conversation rounds of ordinary members is "20200307A platform member type-ordinary member conversation round 1960", that is, the conversation rounds of ordinary members of platform A on March 7, 2020 were 1960 times; in the current conversation round, according to the query "Conversation rounds of super members", the query result for the conversation rounds of super members is "20200307A platform member type-super member conversation round 208338", that is, the conversation rounds of super members of platform A on March 7, 2020 were 208338 times. This shows that in this embodiment of the present invention, in a multi-round conversation scenario, even if the query information of the current conversation round is incomplete, the user can still correctly obtain the query result desired by the user.

[0202] In this embodiment of the present invention, the specific process of obtaining a structured query statement according to steps S11 to S14 can be referred to the description of the first embodiment above and will not be repeated here. Furthermore, the specific implementation process of obtaining query data from a database and generating query results based on the structured query statement can be referred to the implementation methods in the prior art and is not limited in this embodiment of the present invention.

[0203] The embodiment of the present invention provides a method for analyzing data in a database. Figure 8 As shown, the following steps are included:

[0204] S11: Inputting the natural language query statement of the current dialogue turn into a slot recognition model to obtain current slot structure information; the current slot structure information includes a slot in a preset slot structure format and a named entity of the natural language query statement in the slot;

[0205] S12: If there is an empty slot in the current slot structure information, obtain previous slot structure information corresponding to at least one natural language query statement in a previous dialogue turn;

[0206] S13: Filling empty slots in the current slot structure information with named entities in the previous slot structure information;

[0207] S14: concatenating the named entities corresponding to the slots in the filled current slot structure information to obtain a structured query statement;

[0208] S16: According to the structured query statement, query data is obtained from the database, and a corresponding data analysis interface is called to analyze the query data to generate an analysis result.

[0209] The database data analysis method provided in the embodiment of the present invention can realize data analysis types including factor analysis, correlation analysis, attribution analysis, data anomaly analysis, trend prediction, etc. According to the information of the intent slot of the structured query statement obtained, the query intent is determined to be data analysis, and then the data analysis interface parameters to be called can be generated, and the corresponding data analysis interface can be called to analyze the queried data to obtain the data analysis results.

[0210] In this embodiment of the present invention, the specific process of obtaining a structured query statement according to steps S11 to S14 can be referred to the description of the first embodiment above and will not be repeated here. Furthermore, the specific implementation process of obtaining query data from a database based on the structured query statement, invoking a corresponding data analysis interface, analyzing the query data, and generating analysis results can be referred to the implementation methods in the prior art and is not limited in this embodiment of the present invention.

[0211] Based on the same inventive concept, an embodiment of the present invention also provides a query statement generation device, related devices and equipment. Since the principles of the problems solved by these systems, related storage media and equipment are similar to those of the aforementioned text recognition method, the implementation of the system, related storage media and equipment can refer to the implementation of the aforementioned method, and the repeated parts will not be repeated.

[0212] The embodiment of the present invention provides a query statement generation device, referring to Figure 9 As shown, the device includes:

[0213] The slot recognition module 101 is configured to input the natural language query statement of the current dialogue turn into a slot recognition model to obtain current slot structure information; the current slot structure information includes a slot in a preset slot structure format and a named entity of the natural language query statement in the slot;

[0214] A previous slot structure information acquisition module 102 is configured to acquire previous slot structure information corresponding to a natural language query statement in at least one previous dialogue turn if there is an empty slot in the current slot structure information;

[0215] The slot structure information supplement module 103 is configured to fill empty slots in the current slot structure information with named entities in the previous slot structure information;

[0216] The query statement determination module 104 is configured to concatenate the named entities corresponding to the slots in the filled current slot structure information to obtain a structured query statement.

[0217] In one embodiment, referring to Figure 10 As shown, the query statement generating device further includes:

[0218] A set determining module 201 is configured to create a set of named entities corresponding to each of the slots according to a pre-acquired metadata table;

[0219] A sample acquisition module 202 is configured to randomly extract named entities from each of the sets to obtain a plurality of training samples;

[0220] The sample labeling module 203 is used to perform sequence labeling on the plurality of training samples to obtain labeled training samples;

[0221] The model training module 204 is used to train the initial model based on the labeled training samples to obtain a slot recognition model.

[0222] In one embodiment, the model training module 204 is specifically configured to process the labeled training samples into characters to obtain character feature data corresponding to each character;

[0223] Inputting the character feature data into the bidirectional long short-term memory network in the initial model to obtain forward character feature data and reverse character feature data corresponding to each character feature data;

[0224] Fusing the forward word feature data and the reverse word feature data to obtain context word feature data;

[0225] Linearly projecting the context word feature data onto the conditional random field network in the initial model to obtain a slot recognition result of the labeled training sample;

[0226] Matching the sequence labeling results of the labeled training samples with the slot recognition results, and updating the network parameters of the slot recognition training model according to the matching results;

[0227] Repeat the above process to obtain the slot identification model.

[0228] In one embodiment, the query statement generating device further includes:

[0229] a sentence standardization module, configured to perform at least one of character conversion, special character processing, and character spelling correction on the natural language query sentence to obtain a first candidate sentence;

[0230] Completing the first candidate sentence based on at least one of context information of the natural language query sentence, historical query data, and a preset data graph to obtain a second candidate sentence;

[0231] The second candidate sentence is rewritten to obtain a standardized natural language query sentence.

[0232] In one embodiment, the sentence standardization module is specifically configured to perform synonym replacement on the second candidate sentence to obtain a third candidate sentence;

[0233] Determining a data table where the data to be queried is located based on the context information and the third candidate statement;

[0234] Obtaining dimension enumeration values and index information of the data table according to the preset data map, performing edit distance calculation on the third candidate sentence to obtain a fourth candidate sentence;

[0235] String matching and sorting are performed on the fourth candidate sentence to obtain the standardized natural language query sentence.

[0236] In one embodiment, the previous slot structure information acquisition module 102 is specifically configured to acquire the previous slot structure information corresponding to the natural language query statement of the previous conversation turn, and acquire the previous slot structure information corresponding to at least one previous conversation turn that is close to the previous conversation turn based on the time distance from the current conversation turn.

[0237] The slot structure information supplementing module 103 is specifically used to determine whether the slots corresponding to the empty slots in the current slot structure information have named entities;

[0238] If so, fill the named entity into the corresponding empty slot;

[0239] If not, the empty slots in the current slot structure information are filled according to the previous slot structure information corresponding to the adjacent previous dialogue round.

[0240] In one embodiment, the slots of the preset slot structure format include:

[0241] Time slots are used to fill named entities corresponding to time;

[0242] The data table name slot is used to be filled with a named entity corresponding to the data table name;

[0243] The data table dimension slot is used to fill the named entity corresponding to the dimension enumeration value of the data table;

[0244] The data table indicator slot is used to fill the named entity corresponding to the indicator of the data table;

[0245] Intent slots are used to fill in named entities corresponding to the query intent.

[0246] The embodiment of the present invention provides a device for generating a slot recognition model, referring to Figure 10 As shown, the device includes:

[0247] A set determining module 201 is configured to create a set of named entities corresponding to each of the slots according to a pre-acquired metadata table;

[0248] A sample acquisition module 202 is configured to randomly extract named entities from each of the sets to obtain a plurality of training samples;

[0249] The sample labeling module 203 is used to perform sequence labeling on the plurality of training samples to obtain labeled training samples;

[0250] The model training module 204 is used to train the initial model based on the labeled training samples to obtain a slot recognition model.

[0251] The embodiment of the present invention provides a data query device for a database, referring to Figure 11 As shown, the device includes:

[0252] The slot recognition module 101 is configured to input the natural language query statement of the current dialogue turn into a slot recognition model to obtain current slot structure information; the current slot structure information includes a slot in a preset slot structure format and a named entity of the natural language query statement in the slot;

[0253] A previous slot structure information acquisition module 102 is configured to acquire previous slot structure information corresponding to a natural language query statement in at least one previous dialogue turn if there is an empty slot in the current slot structure information;

[0254] The slot structure information supplement module 103 is configured to fill empty slots in the current slot structure information with named entities in the previous slot structure information;

[0255] The query statement determination module 104 is used to splice the named entities corresponding to the slots in the filled current slot structure information to obtain a structured query statement;

[0256] The query result determination module 105 is configured to obtain query data from a database according to the structured query statement to obtain a query result.

[0257] The embodiment of the present invention provides a data analysis device for a database, referring to Figure 12 As shown, the device includes:

[0258] The slot recognition module 101 is configured to input the natural language query statement of the current dialogue turn into a slot recognition model to obtain current slot structure information; the current slot structure information includes a slot in a preset slot structure format and a named entity of the natural language query statement in the slot;

[0259] A previous slot structure information acquisition module 102 is configured to acquire previous slot structure information corresponding to a natural language query statement in at least one previous dialogue turn if there is an empty slot in the current slot structure information;

[0260] The slot structure information supplement module 103 is configured to fill empty slots in the current slot structure information with named entities in the previous slot structure information;

[0261] The query statement determination module 104 is used to splice the named entities corresponding to the slots in the filled current slot structure information to obtain a structured query statement;

[0262] The analysis result determination module 106 is used to obtain query data from the database according to the structured query statement, and call the corresponding data analysis interface to analyze the query data to obtain analysis results.

[0263] An embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon. When the instructions are executed by a processor, the above-mentioned query statement generation method, slot recognition model generation method, database data query method and database data analysis method are implemented.

[0264] An embodiment of the present invention provides a database query device, comprising: a processor and a memory for storing processor executable commands; wherein the processor is configured to execute the above-mentioned query statement generation method, slot identification model generation method, database data query method and database data analysis method.

[0265] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) containing computer-usable program code.

[0266] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0267] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0268] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0269] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A method for generating a query statement, comprising: Input the natural language query sentence of the current dialogue turn into the slot recognition model to obtain the current slot structure information; The current slot structure information includes a slot in a preset slot structure format and a named entity of the natural language query statement in the slot; If there is an empty slot in the current slot structure information, obtain the previous slot structure information corresponding to at least one natural language query statement in the previous dialogue turn; Filling empty slots in the current slot structure information with named entities in the previous slot structure information; Concatenate the named entities corresponding to the slots in the filled current slot structure information to obtain a query statement; Before inputting the natural language query statement of the current dialogue turn into the slot recognition model, the method further includes: The labeled training samples are processed into characters to obtain the character feature data corresponding to each character; Inputting the character feature data into a bidirectional long short-term memory network in an initial model to obtain forward character feature data and reverse character feature data corresponding to each character feature data; Fusing the forward word feature data and the reverse word feature data to obtain context word feature data; Linearly projecting the context word feature data onto the conditional random field network in the initial model to obtain a slot recognition result of the labeled training sample; Matching the sequence labeling results of the labeled training samples with the slot recognition results, and updating the network parameters of the slot recognition training model according to the matching results; the slot recognition training model is the initial model in the training process; Repeat the steps of performing word segmentation processing on the labeled training samples and updating the network parameters of the slot recognition training model according to the matching results, until the matching results reach a preset matching result, thereby obtaining the slot recognition model.

2. The method according to claim 1, further comprising: Creating a set of named entities corresponding to each slot in a preset slot structure format according to the pre-acquired metadata table; Randomly extracting named entities from each of the sets to obtain multiple training samples; Sequence labeling is performed on the multiple training samples to obtain labeled training samples.

3. The method of claim 1, before inputting the natural language query statement of the current dialogue turn into the slot recognition model, further comprising: performing at least one of character conversion, special character processing, and character spelling correction on the natural language query statement to obtain a first candidate statement; Completing the first candidate sentence based on at least one of the context information of the natural language query sentence, historical query data, and a preset data graph to obtain a second candidate sentence; The second candidate sentence is rewritten to obtain a standardized natural language query sentence.

4. The method according to claim 3, wherein rewriting the second candidate sentence to obtain a standardized natural language query sentence comprises: performing synonym replacement on the characters and / or words in the second candidate sentence to obtain a third candidate sentence; Determining a data table where the data to be queried is located based on the context information and the third candidate statement; Obtain dimension enumeration values and indicator information of the data table; Calculating similarity by performing edit distance on the third candidate sentence according to the dimension enumeration value and the indicator information, and obtaining a fourth candidate sentence based on the similarity; String matching and sorting are performed on the fourth candidate sentence to obtain the standardized natural language query sentence.

5. The method according to any one of claims 1 to 4, wherein obtaining previous slot structure information corresponding to at least one natural language query statement in a previous dialogue turn, and filling empty slots in the current slot structure information with named entities in the previous slot structure information comprises: Obtaining the previous slot structure information corresponding to the natural language query statement of the previous dialogue round, and determining whether the slots corresponding to each empty slot in the current slot structure information have named entities; If so, fill the named entity into the corresponding empty slot; If not, obtain the previous slot structure information corresponding to at least one previous dialogue round close to the previous dialogue round according to the time distance from the current dialogue round, and fill the empty slot of the current slot structure information according to the previous slot structure information corresponding to the adjacent previous dialogue round.

6. The method according to claim 1, wherein the slots of the preset slot structure format include: Time slots are used to fill named entities corresponding to time; The data table name slot is used to be filled with a named entity corresponding to the data table name; The data table dimension slot is used to fill the named entity corresponding to the dimension enumeration value of the data table; Data table metric slots, which are used to fill named entities corresponding to the metrics of the data table; and Intent slots are used to fill in named entities corresponding to the query intent.

7. A method for generating a slot recognition model, comprising: Creating a set of named entities corresponding to each of the slots according to the pre-acquired metadata table; Randomly extracting named entities from each of the sets to obtain multiple training samples; Performing sequence labeling on the plurality of training samples to obtain labeled training samples; The initial model is trained based on the labeled training samples to obtain a slot recognition model, and the slot recognition model is used in the query statement generation method according to any one of claims 1 to 6.

8. A method for querying data in a database, comprising: Obtaining a query statement according to the method according to any one of claims 1 to 6; According to the query statement, query data is obtained from the database to generate query results.

9. A method for analyzing database data, comprising: Obtaining a query statement according to the method according to any one of claims 1 to 6; According to the query statement, query data is obtained from the database, and the corresponding data analysis interface is called to analyze the query data and generate analysis results.

10. A device for generating a query statement, comprising: The slot recognition module is used to input the natural language query sentence of the current dialogue turn into the slot recognition model to obtain the current slot structure information; The current slot structure information includes a slot in a preset slot structure format and a named entity of the natural language query statement in the slot; A previous slot structure information acquisition module, configured to acquire previous slot structure information corresponding to at least one natural language query statement in a previous dialogue turn if there is an empty slot in the current slot structure information; a slot structure information supplementing module, configured to fill empty slots in the current slot structure information with named entities in the previous slot structure information; A query statement determination module is used to concatenate the named entities corresponding to the slots in the filled current slot structure information to obtain a query statement; Before the slot recognition module, it is also used to process the labeled training samples into words to obtain word feature data corresponding to each word; Inputting the character feature data into a bidirectional long short-term memory network in an initial model to obtain forward character feature data and reverse character feature data corresponding to each character feature data; Fusing the forward word feature data and the reverse word feature data to obtain context word feature data; Linearly projecting the context word feature data onto the conditional random field network in the initial model to obtain a slot recognition result of the labeled training sample; Matching the sequence labeling results of the labeled training samples with the slot recognition results, and updating the network parameters of the slot recognition training model according to the matching results; The slot recognition training model is the initial model in the training process; Repeat the steps of performing word segmentation processing on the labeled training samples and updating the network parameters of the slot recognition training model according to the matching results, until the matching results reach a preset matching result, thereby obtaining the slot recognition model.

11. A device for generating a slot recognition model, comprising: A set determination module, configured to create a set of named entities corresponding to each of the slots according to a pre-acquired metadata table; A sample acquisition module, configured to randomly extract named entities from each of the sets to obtain a plurality of training samples; A sample labeling module is used to perform sequence labeling on the plurality of training samples to obtain labeled training samples; A model training module is used to train the initial model based on the labeled training samples to obtain a slot recognition model, and the slot recognition model is used in the query statement generation method according to any one of claims 1 to 6.

12. A data query device for a database, comprising: The slot recognition module is used to input the natural language query sentence of the current dialogue turn into the slot recognition model to obtain the current slot structure information; The current slot structure information includes a slot in a preset slot structure format and a named entity of the natural language query statement in the slot; A previous slot structure information acquisition module, configured to acquire previous slot structure information corresponding to at least one natural language query statement in a previous dialogue turn if there is an empty slot in the current slot structure information; a slot structure information supplementing module, configured to fill empty slots in the current slot structure information with named entities in the previous slot structure information; A query statement determination module is used to concatenate the named entities corresponding to the slots in the filled current slot structure information to obtain a query statement; A query result determination module is used to obtain query data from the database according to the query statement to obtain the query result; Before the slot recognition module, it is also used to process the labeled training samples into words to obtain word feature data corresponding to each word; Inputting the character feature data into a bidirectional long short-term memory network in an initial model to obtain forward character feature data and reverse character feature data corresponding to each character feature data; Fusing the forward word feature data and the reverse word feature data to obtain context word feature data; Linearly projecting the context word feature data onto the conditional random field network in the initial model to obtain a slot recognition result of the labeled training sample; Matching the sequence labeling results of the labeled training samples with the slot recognition results, and updating the network parameters of the slot recognition training model according to the matching results; The slot recognition training model is the initial model in the training process; Repeat the steps of performing word segmentation processing on the labeled training samples and updating the network parameters of the slot recognition training model according to the matching results, until the matching results reach a preset matching result, thereby obtaining the slot recognition model.

13. A data analysis device for a database, comprising: The slot recognition module is used to input the natural language query sentence of the current dialogue turn into the slot recognition model to obtain the current slot structure information; The current slot structure information includes a slot in a preset slot structure format and a named entity of the natural language query statement in the slot; A previous slot structure information acquisition module, configured to acquire previous slot structure information corresponding to at least one natural language query statement in a previous dialogue turn if there is an empty slot in the current slot structure information; a slot structure information supplementing module, configured to fill empty slots in the current slot structure information with named entities in the previous slot structure information; A query statement determination module is used to concatenate the named entities corresponding to the slots in the filled current slot structure information to obtain a query statement; An analysis result determination module is used to obtain query data from the database according to the query statement, and call the corresponding data analysis interface to analyze the query data to obtain analysis results; Before the slot recognition module, it is also used to process the labeled training samples into words to obtain word feature data corresponding to each word; Inputting the character feature data into a bidirectional long short-term memory network in an initial model to obtain forward character feature data and reverse character feature data corresponding to each character feature data; Fusing the forward word feature data and the reverse word feature data to obtain context word feature data; Linearly projecting the context word feature data onto the conditional random field network in the initial model to obtain a slot recognition result of the labeled training sample; Matching the sequence labeling results of the labeled training samples with the slot recognition results, and updating the network parameters of the slot recognition training model according to the matching results; The slot recognition training model is the initial model in the training process; Repeat the steps of performing word segmentation processing on the labeled training samples and updating the network parameters of the slot recognition training model according to the matching results, until the matching results reach a preset matching result, thereby obtaining the slot recognition model.

14. A computer-readable storage medium having computer instructions stored thereon, wherein when the instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.

15. A database query device comprising: A processor and a memory for storing processor-executable instructions; wherein the processor is configured to execute the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Voice inquiry method and device and electronic device

    CN109542929A

  • Natural language processing method, natural language processing device and intelligent question-answering system

    CN111026842A