Generation method and device of query statement of model, training method and device and electronic equipment

By using query statement prompt words in the big model and discarding historical data, the problem of poor memory stability of big model in multiple rounds of dialogue questions is solved, and the accuracy of query statement generation and the stability of big model are improved.

CN119415659APending Publication Date: 2025-02-11CHINA UNIONPAY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411610176.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

In the prior art, when asked multiple rounds of dialogue questions, the big model needs to memorize the data generated by historical rounds of dialogue questions, resulting in poor memory stability, which in turn affects the accuracy of query sentence generation.

Method used

By obtaining the query questions entered by the user, and based on the historical round of dialogue questions in the query questions and multiple rounds of dialogue questions, the query statement prompt word is determined, and the pre-constructed query statement is input to the big model to generate the query statement. This method simplifies memory of the big model by discarding indications of historical data, thereby improving stability and accuracy.

Benefits of technology

It improves the accuracy of query statement generation, enhances the memory stability of the big model, and ensures the reliability of query statement generation in multiple rounds of dialogue questions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415659A_ABST
    Figure CN119415659A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a generation method and device for a query statement of a model, a training method and device and electronic equipment. The method comprises the following steps: acquiring a query question input by a user; wherein the query questions are the current round of dialogue questions in the multiple rounds of dialogue questions; according to the query questions and historical rounds of dialogue questions in the multiple rounds of dialogue questions, determining query statement cues corresponding to the query questions; wherein the query statement prompt word is used for indicating discarding processing of historical data generated in the query statement generation process; and inputting the query statement prompt word into a pre-constructed query statement generation large model to obtain a query statement corresponding to the query question. The method is used for achieving the effect of improving the accuracy of query statement generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method for generating query statements of a model, a training method, a device and an electronic device. Background Art

[0002] In the field of financial technology, when a user raises a query requirement, a corresponding query statement can be generated through a large model to obtain information corresponding to the query requirement. Furthermore, when the query requirement raised by the user is in the form of a multi-round dialogue question, a corresponding query statement can also be generated through a large model.

[0003] In the prior art, if the query requirements raised by the user are in the form of multi-round dialogue questions, in the process of using the big model to generate query statements corresponding to the query questions, the big model needs to memorize the data in the process of generating query statements corresponding to historical rounds of dialogue questions, and generate corresponding query statements based on the memorized data.

[0004] However, the methods in the prior art may lead to poor memory stability of large models, thereby causing inaccurate generation of query statements. Summary of the invention

[0005] The embodiments of the present application provide a method for generating a query statement of a model, a training method, a device and an electronic device, so as to achieve the effect of improving the accuracy of the generation of the query statement.

[0006] In a first aspect, an embodiment of the present application provides a method for generating a query statement based on a model, comprising:

[0007] Obtaining a query question input by a user; wherein the query question is a current round of dialogue questions among multiple rounds of dialogue questions;

[0008] Determine, according to the query question and the historical round dialogue questions in the multiple round dialogue questions, a query sentence prompt word corresponding to the query question; wherein the query sentence prompt word is used to indicate that historical data generated during the query sentence generation process is to be discarded;

[0009] The query statement prompt word is input into a pre-built query statement generation model to obtain a query statement corresponding to the query question.

[0010] In a possible implementation, determining a query sentence prompt word corresponding to the query question based on the query question and historical round dialogue questions in the multiple rounds of dialogue questions includes: performing word slot information extraction processing on the query question based on word slot extraction technology to obtain word slot information corresponding to the query question; obtaining status bit information corresponding to a previous round dialogue question in the historical round dialogue questions; updating the status bit information corresponding to the previous round dialogue question based on the word slot information corresponding to the query question to obtain the status bit information corresponding to the query question; and determining a query sentence prompt word corresponding to the query question based on the status bit information corresponding to the query question.

[0011] In a possible implementation, determining a query sentence prompt word corresponding to the query question based on status bit information corresponding to the query question includes: obtaining the status bit information corresponding to the question in the previous round of dialogue, and determining reference information corresponding to the query question based on the status bit information corresponding to the question in the previous round of dialogue; determining a query sentence prompt word corresponding to the query question based on the status bit information corresponding to the query question and the reference information corresponding to the query question.

[0012] In a possible implementation, determining reference information corresponding to the query question based on the status bit information corresponding to the question in the previous round of dialogue includes: determining a set of related questions corresponding to the query question from a pre-constructed multi-round dialogue corpus based on the status bit information corresponding to the question in the previous round of dialogue; obtaining a query statement sample corresponding to each related question in the set of related questions from a pre-constructed query statement sample library, and determining a set consisting of query statement samples corresponding to all related questions as the reference information corresponding to the query question.

[0013] In a possible implementation, based on the status bit information corresponding to the question in the previous round of dialogue, a set of related questions corresponding to the query question is determined from a pre-constructed multi-round dialogue corpus, including: vectorizing the status bit information corresponding to the question in the previous round of dialogue to obtain the status bit information corresponding to the question in the previous round of dialogue after vectorization; and determining the set of related questions corresponding to the query question from the pre-constructed multi-round dialogue corpus based on vectorized retrieval technology and the status bit information corresponding to the question in the previous round of dialogue after vectorization.

[0014] In a possible implementation, the method further includes: determining whether the question intention corresponding to the query question is complete based on the status bit information corresponding to the query question; if it is determined that the question intention corresponding to the query question is complete, executing the process of determining the query statement prompt word corresponding to the query question based on the status bit information corresponding to the query question; otherwise, repeating the following process: obtaining a supplementary question, and determining again whether the question intention corresponding to the query question is complete based on the obtained supplementary question, until it is determined that the question intention corresponding to the query question is complete, and then executing the process of determining the query statement prompt word corresponding to the query question based on the status bit information corresponding to the question.

[0015] In a possible implementation, determining whether the question intention corresponding to the query question is complete based on the status bit information corresponding to the query question includes: obtaining the question intention type corresponding to the query question; under the corresponding question intention type, determining whether the question intention corresponding to the query question is complete based on the status bit information corresponding to the query question.

[0016] In a possible implementation, obtaining the question intention type corresponding to the query question includes: obtaining the question intention type corresponding to the previous round of dialogue questions in the historical rounds of dialogue questions; determining whether a question intention type jump occurs based on the status bit information corresponding to the query question; if it is determined that no question intention type jump occurs, determining the question intention type corresponding to the previous round of dialogue questions as the question intention type corresponding to the query question; if it is determined that a question intention type jump occurs, determining the question intention type corresponding to the query question based on the status bit information corresponding to the query question.

[0017] In a possible implementation, obtaining a supplementary question includes: generating and presenting a supplementary question prompt; and receiving a supplementary question input by a user based on the supplementary question prompt.

[0018] In a possible implementation, determining again whether the question intention corresponding to the query question is complete based on the obtained supplementary question includes: updating the status bit information corresponding to the query question based on the obtained supplementary question; and determining again whether the question intention corresponding to the query question is complete based on the status bit information corresponding to the query question after the updated processing.

[0019] In a possible implementation, the method further includes: if it is determined that the query question is a first-round dialogue question in the multiple-round dialogue questions, determining a query sentence prompt word corresponding to the query question according to the query question.

[0020] In a possible implementation, determining a query statement prompt word corresponding to the query question according to the query question includes: performing word slot information extraction processing on the query question based on word slot extraction technology to obtain word slot information corresponding to the query question; generating status bit information corresponding to the query question according to the word slot information corresponding to the query question; and determining a query statement prompt word corresponding to the query question according to the status bit information corresponding to the query question.

[0021] In a possible implementation, the method further includes: acquiring and presenting answer content corresponding to the query question according to a query statement corresponding to the query question.

[0022] In a second aspect, an embodiment of the present application provides a method for training a model for generating query statements, including:

[0023] Obtain the initial query statement to generate a large model and a model training set;

[0024] The model training set includes a plurality of training samples; the training samples include: query sentence prompt word samples, and query sentences corresponding to the query sentence prompt word samples; the query sentence prompt word samples are used to indicate that historical data generated during the query sentence generation process is discarded;

[0025] According to the training samples included in the model training set, the initial query statement generation large model is trained to obtain the query statement generation large model;

[0026] In a possible implementation, the initial query statement generation large model is trained according to the training samples included in the model training set to obtain the query statement generation large model, including: obtaining one of the training samples from the model training set; inputting the query statement prompt word sample included in the training sample into the initial query statement generation large model, and outputting the initial query statement corresponding to the query statement prompt word sample; training the initial query statement generation large model according to the initial query statement corresponding to the query statement prompt word sample and the query statement corresponding to the query statement prompt word sample to obtain the query statement generation large model.

[0027] In a third aspect, an embodiment of the present application provides a device for generating a query statement based on a model, comprising:

[0028] An acquisition module is used to acquire a query question input by a user; wherein the query question is a current round of dialogue questions among multiple rounds of dialogue questions;

[0029] A determination module, configured to determine a query statement prompt word corresponding to the query statement according to the query statement and the historical round dialogue questions in the multi-round dialogue questions; wherein the query statement prompt word is used to indicate that historical data generated during the query statement generation process is discarded;

[0030] The generation module is used to input the query statement prompt word into the pre-built query statement generation model to obtain the query statement corresponding to the query question.

[0031] In a possible implementation, the determination module is specifically used to perform word slot information extraction processing on the query question based on the word slot extraction technology to obtain the word slot information corresponding to the query question; obtain the status bit information corresponding to the previous round of dialogue questions in the historical rounds of dialogue questions; according to the word slot information corresponding to the query question, update the status bit information corresponding to the previous round of dialogue questions to obtain the status bit information corresponding to the query question; according to the status bit information corresponding to the query question, determine the query sentence prompt word corresponding to the query question.

[0032] In a possible implementation, the determination module is further specifically used to obtain the status bit information corresponding to the question in the previous round of dialogue, and determine the reference information corresponding to the query question based on the status bit information corresponding to the question in the previous round of dialogue; determine the query sentence prompt word corresponding to the query question based on the status bit information corresponding to the query question and the reference information corresponding to the query question.

[0033] In a possible implementation, the determination module is further specifically used to determine a set of related questions corresponding to the query question from a pre-constructed multi-round dialogue corpus based on the state bit information corresponding to the question in the previous round of dialogue; obtain a query statement sample corresponding to each related question in the set of related questions from a pre-constructed query statement sample library, and determine a set consisting of query statement samples corresponding to all related questions as reference information corresponding to the query question.

[0034] In a possible implementation, the determination module is further specifically used to vectorize the status bit information corresponding to the question in the previous round of dialogue to obtain the status bit information corresponding to the question in the previous round of dialogue after vectorization; based on the vectorization retrieval technology and the status bit information corresponding to the question in the previous round of dialogue after vectorization, determine the set of related questions corresponding to the query question from the pre-constructed multi-round dialogue corpus.

[0035] In a possible implementation, the determination module is further specifically used to determine whether the question intention corresponding to the query question is complete based on the status bit information corresponding to the query question; if it is determined that the question intention corresponding to the query question is complete, then executing the process of determining the query statement prompt word corresponding to the query question based on the status bit information corresponding to the query question; otherwise, repeating the following process: obtaining a supplementary question, and determining again whether the question intention corresponding to the query question is complete based on the obtained supplementary question, until it is determined that the question intention corresponding to the query question is complete, and then executing the process of determining the query statement prompt word corresponding to the query question based on the status bit information corresponding to the question.

[0036] In a possible implementation, the determination module is further specifically used to obtain the question intention type corresponding to the query question; under the corresponding question intention type, determine whether the question intention corresponding to the query question is complete based on the status bit information corresponding to the query question.

[0037] In a possible implementation, the determination module is further specifically used to obtain the question intention type corresponding to the previous round of dialogue questions in the historical round of dialogue questions; determine whether a question intention type jump occurs based on the status bit information corresponding to the query question; if it is determined that the question intention type jump does not occur, determine the question intention type corresponding to the previous round of dialogue questions as the question intention type corresponding to the query question; if it is determined that the question intention type jump occurs, determine the question intention type corresponding to the query question based on the status bit information corresponding to the query question.

[0038] In a possible implementation manner, the determination module is further specifically configured to generate and present a supplementary question prompt; and receive a supplementary question input by the user based on the supplementary question prompt.

[0039] In a possible implementation, the determination module is further specifically used to update the status bit information corresponding to the query question based on the acquired supplementary question; and determine again whether the question intention corresponding to the query question is complete based on the status bit information corresponding to the query question after the update.

[0040] In a possible implementation manner, the determination module is further configured to determine a query sentence prompt word corresponding to the query question according to the query question if it is determined that the query question is a first round of dialogue questions in the multiple rounds of dialogue questions.

[0041] In a possible implementation, the determination module is further specifically used to perform word slot information extraction processing on the query question based on word slot extraction technology to obtain word slot information corresponding to the query question; generate status bit information corresponding to the query question based on the word slot information corresponding to the query question; and determine the query statement prompt word corresponding to the query question based on the status bit information corresponding to the query question.

[0042] In a possible implementation, the generation module is further used to obtain and present the answer content corresponding to the query question according to the query statement corresponding to the query question. The model-based query statement generation device provided in this embodiment can execute the method provided in the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.

[0043] In a fourth aspect, an embodiment of the present application provides a training device for a model for generating query statements, comprising:

[0044] The acquisition module is used to obtain the initial query statement to generate a large model and a model training set;

[0045] The model training set includes a plurality of training samples; the training samples include: query sentence prompt word samples, and query sentences corresponding to the query sentence prompt word samples; the query sentence prompt word samples are used to indicate that historical data generated during the query sentence generation process is discarded;

[0046] A training module, used for training the initial query statement generation large model according to the training samples included in the model training set to obtain the query statement generation large model;

[0047] Among them, the query statement generates a large model, which is the model described in the first aspect and / or various possible implementation methods of the first aspect above.

[0048] In a possible implementation, the training module is specifically used to obtain a training sample from the model training set; input the query statement prompt word sample included in the training sample into the initial query statement generation large model, and output the initial query statement corresponding to the query statement prompt word sample; train the initial query statement generation large model according to the initial query statement corresponding to the query statement prompt word sample and the query statement corresponding to the query statement prompt word sample to obtain the query statement generation large model.

[0049] In a fifth aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;

[0050] The memory stores computer-executable instructions;

[0051] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect, or the above second aspect and / or various possible implementations of the second aspect.

[0052] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-readable storage medium is stored computer execution instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementation methods of the first aspect, or the second aspect and / or various possible implementation methods of the second aspect.

[0053] In the seventh aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect, or the second aspect and / or various possible implementations of the second aspect.

[0054] The query statement generation method, training method, device and electronic device of the model provided in the embodiments of the present application obtain the query question input by the user, determine the query statement prompt word corresponding to the query question according to the query question and the historical round dialogue questions in multiple rounds of dialogue questions, input the query statement prompt word into the pre-built query statement generation large model, and obtain the query statement corresponding to the query question, wherein, since the query prompt word corresponding to the query question is generated according to the query question and the historical round dialogue questions in the multiple round dialogue questions, and carries the information of the historical dialogue questions, therefore, when instructing to generate the query statement corresponding to the query question, it can be instructed to discard the historical data generated in the query statement generation process to simplify the memory of the pre-built query statement generation large model, thereby improving the stability of the large model and improving the accuracy of query statement generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0056] Figure 1 A schematic diagram of an application scenario provided for this application;

[0057] Figure 2 Schematic diagram of the process of generating a query statement based on a model provided in this application Figure 1 ;

[0058] Figure 3 Schematic diagram of the process of generating a query statement based on a model provided in this application Figure 2 ;

[0059] Figure 4 Schematic diagram of the process of generating a query statement based on a model provided in this application Figure 3 ;

[0060] Figure 5 Schematic diagram of the training method of the model for generating query statements provided in this application Figure 1 ;

[0061] Figure 6 Schematic diagram of the training method of the model for generating query statements provided in this application Figure 2 ;

[0062] Figure 7 A schematic diagram of the structure of a device for generating a query statement based on a model provided in the present application;

[0063] Figure 8 A schematic diagram of the structure of a training device for a model for generating query statements provided in the present application;

[0064] Fig. 9 A schematic diagram of the structure of the electronic device provided in this application.

[0065] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0066] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0067] Figure 1 A schematic diagram of an application scenario provided for this application, such as Figure 1 As shown, the specific application scenario of the present application includes an electronic device 101 and a user 102. The user 102 inputs a query question on the electronic device 101 to instruct to obtain a query sentence corresponding to the query question, and the electronic device 101 determines the query sentence prompt word corresponding to the query question according to the query question input by the user 102 and the historical round dialogue questions in the multi-round dialogue questions, and inputs the query sentence prompt word into the pre-built query sentence generation model to obtain the query sentence corresponding to the query question, so that the electronic device 101 obtains and presents the reply content corresponding to the query question according to the query sentence corresponding to the query question.

[0068] In combination with the above scenario, it can be seen that in the prior art, if the query requirements raised by the user are in the form of multi-round dialogue questions, in the process of using the big model to generate the query statement corresponding to the query question, the big model needs to remember the data in the process of generating the query statement corresponding to the historical round dialogue question, and generate the corresponding query statement based on the remembered data. However, the method in the prior art will lead to the problem of poor memory stability of the big model, thereby leading to the problem of inaccurate query statement generation.

[0069] The model-based query statement generation method provided in the present application obtains a query question input by a user, determines a query statement prompt word corresponding to the query question based on the query question and historical rounds of dialogue questions in multiple rounds of dialogue questions, inputs the query statement prompt word into a pre-built query statement generation large model, and obtains a query statement corresponding to the query question, wherein, since the query prompt word corresponding to the query question is generated based on the query question and historical rounds of dialogue questions in multiple rounds of dialogue questions, and carries information of the historical dialogue questions, when instructing to generate a query statement corresponding to the query question, it can be instructed to discard the historical data generated in the query statement generation process to simplify the memory of the pre-built query statement generation large model, thereby improving the stability of the large model and improving the accuracy of query statement generation.

[0070] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0071] Figure 2 Schematic diagram of the process of generating a query statement based on the model provided in this application Figure 1 ,like Figure 2 As shown, the method includes:

[0072] Step S201: Obtain a query question input by a user.

[0073] Specifically, the query question input by the user can be obtained. Among them, the query question is the current round of dialogue question in the multi-round dialogue question. Among them, multi-round questioning means that the user interacts with the electronic device through multiple questions, and each dialogue question is based on the historical round dialogue question or the corresponding reply content of the historical round dialogue question. This method makes the question more in-depth and detailed, and is usually used to obtain more detailed or specific information. For example, in the process of interactive dialogue data analysis, if the historical round dialogue question is "Query the transaction amount in Shanghai in July this year", the current dialogue question can be "How about August?", or "How about Beijing?".

[0074] Among them, this application does not limit the process of obtaining the query question input by the user, and any process that can obtain the query question input by the user can be used as the process of obtaining the query question input by the user provided by this application. Optionally, the query question input by the user through voice can be obtained, or the query question input by the user through text can be obtained, or the query question input by the user through keywords can be obtained, or the query question input by the user through natural language can be obtained.

[0075] Step S202: Determine a query sentence prompt word corresponding to the query question according to the query question and the historical round dialogue questions in the multi-round dialogue questions.

[0076] Specifically, according to the query question obtained in step S103 and the historical round dialogue questions in the multi-round dialogue questions to which the query sentence belongs, the query sentence prompt word corresponding to the query question can be determined. The query sentence prompt word is used to indicate the generation of the query sentence corresponding to the query question, and the query sentence corresponding to the query question is used to search for the answer content corresponding to the query question.

[0077] The query prompt is used to instruct the discarding of historical data generated in the query statement generation process. Specifically, since the query prompt corresponding to the query question is generated based on the query question and the historical round of dialogue questions in the multi-round dialogue questions, and carries the information of the historical dialogue questions, when instructing the generation of the query statement corresponding to the query question, it can be instructed to discard the historical data generated in the query statement generation process to simplify the memory of the pre-built query statement generation large model, thereby improving the stability of the large model and improving the accuracy of query statement generation.

[0078] Among them, the present application does not limit the process of determining the query sentence prompt word corresponding to the query question based on the query question and the historical round dialogue question in the multi-round dialogue question. Any process of determining the query sentence prompt word corresponding to the query question based on the query question and the historical round dialogue question in the multi-round dialogue question can be used as the process of determining the query sentence prompt word corresponding to the query question based on the query question and the historical round dialogue question in the multi-round dialogue question provided by the present application. Optionally, based on the word slot extraction technology, the query question can be processed by word slot information extraction to obtain the word slot information corresponding to the query question, and the state bit information corresponding to the previous round dialogue question in the historical round dialogue question is obtained. According to the word slot information corresponding to the query question, the state bit information corresponding to the previous round dialogue question is updated to obtain the state bit information corresponding to the query question, and the query sentence prompt word corresponding to the query question is determined according to the state bit information corresponding to the query question.

[0079] Step S203: input the query statement prompt word into the pre-built query statement generation model to obtain a query statement corresponding to the query question.

[0080] Specifically, the query statement prompt word determined in step S102 can be input into the pre-constructed query statement generation big model to obtain the query statement corresponding to the query question. The pre-constructed query statement generation big model is a pre-constructed big model for generating query statements corresponding to the query statement prompt word. The present application does not limit the pre-constructed query statement generation big model, and any pre-constructed big model for generating query statements corresponding to the query statement prompt word can be used as the pre-constructed query statement generation big model provided by the present application.

[0081] The model-based query statement generation method provided in the embodiment of the present application obtains the query question input by the user, determines the query statement prompt word corresponding to the query question according to the query question and the historical round dialogue questions in the multi-round dialogue questions, inputs the query statement prompt word into the pre-built query statement generation big model, and obtains the query statement corresponding to the query question, wherein, since the query prompt word corresponding to the query question is generated according to the query question and the historical round dialogue questions in the multi-round dialogue questions, it carries the information of the historical dialogue questions, therefore, when instructing to generate the query statement corresponding to the query question, it can be instructed to discard the historical data generated in the query statement generation process, so as to simplify the memory of the pre-built query statement generation big model, thereby improving the stability of the big model and improving the accuracy of the query statement generation.

[0082] The query statement corresponding to the query question is used to indicate the query address of the reply content corresponding to the query question. For example, in the process of interactive data analysis of dialogue, the query statement corresponding to the query question is used to indicate the storage address of the data corresponding to the query question. If the query question is "query the transaction amount in Shanghai in July this year", the query statement example can be "Select transaction amount from table A where region='Shanghai company''July this year'", where table A is the table storing the transaction amount in Shanghai in July this year.

[0083] In a possible embodiment, the method for generating a query statement based on a model further includes: acquiring and presenting a reply content corresponding to the query question according to the query statement corresponding to the query question.

[0084] Specifically, as described above, the query statement corresponding to the query question is used to query the answer content corresponding to the query question. Therefore, the answer content corresponding to the query question can be obtained and presented according to the query statement corresponding to the query question. Figure 1The description of the query statement corresponding to the query question in the illustrated embodiment can obtain the reply content corresponding to the query question according to the query address of the reply content corresponding to the query question indicated by the query statement. Among them, this application does not limit the method of presenting the reply content corresponding to the query question. Any method that can present the reply content corresponding to the query question can be used as the method of presenting the reply content corresponding to the query question provided by this application. Optionally, it can include but is not limited to: at least one of the following methods: text method, table method, chart method, card method, report method, file method, pop-up window method, prompt box method, voice feedback method, interactive form method, etc.

[0085] In a possible embodiment, the model-based query statement generation method further includes: if it is determined that the query question is a first-round dialogue question in multiple rounds of dialogue questions, determining a query statement prompt word corresponding to the query question according to the query question.

[0086] Specifically, if it is determined that the query question is the first round of dialogue question in multiple rounds of dialogue questioning, the multiple rounds of dialogue corresponding to the query question do not include historical round dialogue questions, and therefore, the process of determining the query sentence prompt word corresponding to the query question according to the query question and the historical round dialogue questions in the multiple rounds of dialogue questioning described in step S202 cannot be performed. At this time, the query sentence prompt word corresponding to the query question can be determined according to the query question. Among them, the query sentence prompt word corresponding to the query question determined according to the query question is also used to indicate the generation of the query sentence corresponding to the query question, and the query sentence prompt word is also used to indicate the discarding of the historical data generated in the query sentence generation process. Among them, the present application does not limit the process of determining the query sentence prompt word corresponding to the query question according to the query question, and any process of determining the query sentence prompt word corresponding to the query question according to the query question can be used as the process of determining the query sentence prompt word corresponding to the query question according to the query question provided by the present application.

[0087] In a possible embodiment, if it is determined that the query question is the first round of dialogue questioning in multiple rounds of dialogue questioning, the process of determining the query sentence prompt word corresponding to the query question according to the query question may include:

[0088] Firstly, based on the word slot extraction technology, the word slot information of the query question is extracted to obtain the word slot information corresponding to the query question.

[0089] Among them, slot filling technology is an important technology in natural language processing (NLP), which is often used in application scenarios such as information extraction, dialogue systems, and question-answering systems, especially in the task of extracting and identifying key information when querying based on user input text. Specifically, the goal of slot filling technology is to identify specific entities and corresponding attributes from the natural language input by the user, and fill the preset "slots" or fields so that the system can better understand the user's intention and generate appropriate responses. In slot extraction technology, slot refers to a field or attribute predefined in a specific task or system. For example, in the process of interactive data analysis of dialogue, if the query question is "Query the transaction amount in Shanghai in July this year", then "date", "region", "indicator name", "transaction channel", etc. can be slots. Slot value refers to the specific information extracted from the input text, that is, the content filled in the slot. For example, in the process of interactive data analysis, if the query statement is "query the transaction amount in Shanghai in July this year", the value of the "date" slot is "July this year", the value of the "region" slot is "Shanghai", the value of the "indicator name" slot is "income", and the value of the "transaction channel" slot is "offline transaction". Slot filling technology: that is, identifying the corresponding slot from the natural language text entered by the user and extracting the corresponding value.

[0090] Secondly, based on the word slot information corresponding to the query question, the state bit information corresponding to the query question is generated.

[0091] Among them, status bit information (or called status information, status flag, etc.) usually refers to the status data that records the current operation or processing step in the system, application or query process. It is usually used to identify or track the current progress, status or result of a task, operation or event. These status bit information can help the system understand whether an operation has been completed, whether further user input is required, or whether there is an error.

[0092] Among them, the present application does not limit the status bit information corresponding to the query question, and any information that can characterize the current status corresponding to the query question can be used as the status bit information provided by the present application.

[0093] For example: in the process of interactive data analysis of dialogue, if the word slot information corresponding to the query word is: the value of the "date" slot is "July this year", the value of the "region" slot is "Shanghai", the value of the "indicator name" slot is "income", and the value of the "transaction channel" slot is "offline transaction", then the corresponding status bit information example is: "Date: July this year; Region: Shanghai; Indicator name: Income; Transaction channel: Offline transaction".

[0094] Among them, the present application does not limit the process of generating the status bit information corresponding to the query question according to the word slot information corresponding to the query question. Optionally, a large model can be generated according to the word slot information corresponding to the query question and the preset status bit information to generate the status bit information corresponding to the query question. Among them, in the process of generating the large model according to the preset status bit information to generate the status bit information corresponding to the query question, the corresponding status bit information prompt word can be first constructed according to the word slot information corresponding to the query question, and then the constructed status bit information prompt word can be input into the preset status bit information generation large model to output the status bit information corresponding to the query question. Among them, the present application does not limit the process of constructing the corresponding status bit information prompt word according to the word slot information corresponding to the query question. Optionally, the corresponding status bit information prompt word can be constructed according to the word slot information corresponding to the query question and the preset status bit information prompt word template.

[0095] Optionally, the status information corresponding to the query question can also be directly determined based on the query question. Among them, the present application does not limit the process of directly determining the status information corresponding to the query question based on the query question. Optionally, a model can be generated based on another preset status bit information to generate the status bit information corresponding to the query question. Among them, in the process of generating a large model based on another preset status bit information to generate the status bit information corresponding to the query question, the corresponding status bit information prompt word can be first constructed based on the query question, and then the constructed status bit information prompt word is input into the preset another status bit information generation large model, and the status bit information corresponding to the query question is output. Among them, the present application does not limit the process of constructing the corresponding status bit information prompt word based on the query question. Optionally, the corresponding status bit information prompt word can be constructed based on the query question and the preset another status bit information prompt word template.

[0096] Then, according to the state bit information corresponding to the query question, the query sentence prompt word corresponding to the query question is determined.

[0097] Specifically, the query statement prompt word corresponding to the query question can be determined according to the status bit information corresponding to the query question, wherein the present application does not limit the process of determining the query statement prompt word corresponding to the query question according to the status bit information corresponding to the query question, and optionally, the query statement prompt word corresponding to the query question can be constructed according to the status bit information corresponding to the query question and a preset prompt word construction strategy. Among them, the present application does not limit the preset prompt word construction strategy, and optionally, the preset prompt word construction strategy may include: a preset constraint statement, for example, discarding the historical data generated during the query statement generation process, and a preset prompt word composition content, for example, including: the status bit information corresponding to the query question, the query question, and the word slot information corresponding to the query question.

[0098] The query sentence prompt words corresponding to the query question are as follows:

[0099] “Preset constraint statement: discard the historical data generated during the query statement generation process;

[0100] The query asks: "How was August?";

[0101] The word slot information corresponding to the query question is: the value of the "date" slot is "this August", the value of the "region" slot is "empty", the value of the "indicator name" slot is "empty", and the value of the "trading channel" slot is "empty";

[0102] The status information corresponding to the query question is: "Date: August this year; Region: Shanghai; Indicator name: Revenue; Transaction channel: Offline transaction";

[0103] Please output the query statement corresponding to the query question according to the above rules. "

[0104] Figure 3 Schematic diagram of the process of generating a query statement based on a model provided in this application Figure 2 ,like Figure 3 As shown, in this embodiment Figure 2 Based on the illustrated embodiment, a process of determining a query sentence prompt word corresponding to a query question according to a query question and a historical round of dialogue questions in a multi-round dialogue questioning is described in detail. The method includes:

[0105] Step S301: Based on the word slot extraction technology, word slot information is extracted from the query question to obtain word slot information corresponding to the query question.

[0106] Specifically, based on the word slot extraction technology, the word slot information can be extracted from the query question to obtain the word slot information corresponding to the query question. The description of the word slot extraction technology can refer to the description in the above embodiment, which will not be repeated here.

[0107] Among them, if the query question is not a complete question sentence, for example, in the process of interactive data analysis of dialogue, if the query question is "How about August?", then the word slot information corresponding to the query question includes the slots of some word slots. For example, if the query dialogue is "How about August?", then based on the word slot extraction technology, after the query question is processed by word slot information extraction, the word slot information corresponding to the query question is obtained: the value of the "date" slot is "August this year", the value of the "region" slot is "empty", the value of the "indicator name" slot is "empty", and the value of the "transaction channel" slot is "empty".

[0108] Step S302: Obtain the status bit information corresponding to the previous round of dialogue questions in the historical rounds of dialogue questions.

[0109] Specifically, the state bit information corresponding to the previous round of dialogue questions in the historical round of dialogue questions can be obtained. Among them, the description of the state bit information can refer to the description in the above embodiment, which will not be repeated here.

[0110] Among them, after obtaining the questions in the previous round of dialogue input by the user, the corresponding state bit information will be determined. Therefore, the state bit information corresponding to the questions in the previous round of dialogue can be directly obtained from the historical data.

[0111] Step S303: Update the state bit information corresponding to the question in the previous round of dialogue according to the word slot information corresponding to the query question to obtain the state bit information corresponding to the query question.

[0112] Specifically, according to the word slot information corresponding to the query question obtained in step S301, the state bit information corresponding to the previous round of dialogue question obtained in step S302 is updated to obtain the state bit information corresponding to the query question. Among them, the present application does not limit the process of updating the state bit information corresponding to the previous round of dialogue question according to the word slot information corresponding to the query question to obtain the state bit information corresponding to the query question. Optionally, the information corresponding to the empty slot value in the word slot information corresponding to the query question in the state bit information corresponding to the previous round of dialogue question can be retained, and the information corresponding to the non-empty slot value in the word slot information corresponding to the query question in the state bit information corresponding to the previous round of dialogue question can be replaced.

[0113] For example, in the process of interactive data analysis, if the word slot information corresponding to the query question is: the value of the "date" slot is "August this year", the value of the "region" slot is "empty", the value of the "indicator name" slot is "empty", and the value of the "transaction channel" slot is "empty", and the state bit information corresponding to the previous round of dialogue questions is: "Date: July this year; Region: Shanghai; Indicator name: Revenue; Transaction channel: Offline transaction". After the retention and replacement processing described above, the state bit information corresponding to the query question is "Date: August this year; Region: Shanghai; Indicator name: Revenue; Transaction channel: Offline transaction".

[0114] Step S304: Determine the query sentence prompt word corresponding to the query question according to the status bit information corresponding to the query question.

[0115] Specifically, the query sentence prompt word corresponding to the query question can be determined according to the state bit information corresponding to the query question obtained in step S303. For the description of the process of determining the query sentence prompt word corresponding to the query question according to the state bit information corresponding to the query question, reference can be made to the description in the above embodiment, which will not be repeated here.

[0116] The embodiment of the present application provides a process for determining a query sentence prompt word corresponding to a query question based on a query question and historical round dialogue questions in multiple rounds of dialogue questions, by extracting word slot information of the query question based on a word slot extraction technology to obtain word slot information corresponding to the query question, obtaining state bit information corresponding to a previous round dialogue question in the historical round dialogue questions, updating the state bit information corresponding to the previous round dialogue question based on the word slot information corresponding to the query question to obtain the state bit information corresponding to the query question, and determining the query sentence prompt word corresponding to the query question based on the state bit information corresponding to the query question, wherein, in the process of determining the state bit information corresponding to the query question, the state bit information corresponding to the previous round dialogue question is combined, so that the state bit information corresponding to the query question is complete state bit information, so that the query sentence prompt word corresponding to the query question determined according to the state bit information is more accurate, thereby improving the accuracy of query sentence generation.

[0117] In a possible embodiment, the method for generating a query statement based on a model further includes: determining whether the question intention corresponding to the query question is complete according to the status bit information corresponding to the query question.

[0118] Specifically, after obtaining the status bit information corresponding to the query question, it can be determined whether the question intention corresponding to the query question is complete according to the status bit information corresponding to the query question. Among them, the present application does not limit the process of determining whether the question intention corresponding to the query question is complete according to the status bit information corresponding to the query question. Optionally, the question intention type corresponding to the query question can be obtained first, and then under the corresponding question intention type, according to the status bit information corresponding to the query question, it is determined whether the question intention corresponding to the query question is complete. Among them, the question intention refers to the main purpose or demand behind the user when asking the question. In simple terms, the question intention is the motivation or goal of the user's question. It helps the system understand the user's true intention of asking the question, so as to make a more accurate answer or perform the corresponding operation. Among them, the query question described in this embodiment can be the first round of dialogue questioning in a multi-round dialogue questioning, or it can be a non-first round of dialogue questioning in a multi-round dialogue questioning.

[0119] According to the above confirmation process, if it is determined that the question intention corresponding to the query question is complete, the process of determining the query sentence prompt word corresponding to the query question according to the status bit information corresponding to the query question is executed. According to the status bit information corresponding to the query question, the process of determining the query sentence prompt word corresponding to the query question can refer to the description in the above embodiment, which will not be repeated here.

[0120] Among them, according to the confirmation process above, if it is determined that the question intention corresponding to the query question is incomplete, the following process is repeated: obtain supplementary questions, and determine again whether the question intention corresponding to the query question is complete based on the obtained supplementary questions, until it is determined that the question intention corresponding to the query question is complete, and then execute the status bit information corresponding to the question to determine the query sentence prompt word corresponding to the query question.

[0121] Among them, the present application does not limit the process of obtaining supplementary questions. Optionally, a supplementary prompt for questions can be generated and presented first. Then, a supplementary question input by the user based on the supplementary prompt for questions is received. Among them, the present application does not limit the process of re-determining whether the question intention corresponding to the query question is complete based on the obtained supplementary question. Optionally, the process of re-determining whether the question intention corresponding to the query question is complete based on the obtained supplementary question can include: updating the status bit information corresponding to the query question based on the obtained supplementary question. Based on the status bit information corresponding to the query question after the update, it is determined again whether the question intention corresponding to the query question is complete. Among them, if the result of the re-determination is that the question intention is complete, the process of determining the query sentence prompt word corresponding to the query question based on the status bit information corresponding to the query question after the update is executed, otherwise, the above process is repeated until it is determined that the question intention corresponding to the query question is complete.

[0122] Among them, by determining whether the question intention corresponding to the query question is complete, and after determining the question intention corresponding to the query question, improving the question intention by obtaining supplementary questions, the accuracy of the query statement prompt words can be improved, and the accuracy of query statement generation can be further improved.

[0123] In a possible embodiment, the process of determining whether the question intention corresponding to the query question is complete according to the status bit information corresponding to the query question may include: obtaining the question intention type corresponding to the query question. Under the corresponding question intention type, determining whether the question intention corresponding to the query question is complete according to the status bit information corresponding to the query question. The question intention type refers to the category or type used by the system to understand the user intention behind the question when the user asks the question.

[0124] Among them, in the process of determining whether the question intention corresponding to the query question is complete based on the status bit information corresponding to the query question, first determining the question intention type corresponding to the query question can more accurately determine whether the question intention corresponding to the query question is complete, thereby further improving the accuracy of query statement generation.

[0125] In a possible embodiment, if the query question is the first round of dialogue question in multiple rounds of dialogue questioning, the process of obtaining the question intention type corresponding to the query question may include: obtaining word slot information corresponding to the query question; and determining the question intention type corresponding to the query question based on the word slot information corresponding to the query question.

[0126] In a possible embodiment, the process of obtaining the question intention type corresponding to the query question may include: obtaining the question intention type corresponding to the previous round of dialogue questions in the historical rounds of dialogue questions. Determine whether a question intention type jump occurs based on the status bit information corresponding to the query question. If it is determined that the question intention type jump does not occur, determine the question intention type corresponding to the previous round of dialogue questions as the question intention type corresponding to the query question. If it is determined that the question intention type jump occurs, determine the question intention type corresponding to the query question based on the status bit information corresponding to the query question.

[0127] Among them, in the process of obtaining the question intention type corresponding to the query question, by determining whether the question intention type jumps according to the question intention type corresponding to the question in the previous round of dialogue, the efficiency of determining the question intention type corresponding to the query question can be improved, and the efficiency of query statement generation can be further improved.

[0128] In a possible embodiment, the process of obtaining the supplementary question may include: generating and presenting a supplementary question prompt; and receiving a supplementary question input by the user based on the supplementary question prompt.

[0129] The question supplement prompt is used to prompt the user to ask a supplementary question to the query question, wherein the question supplement prompt indicates the direction of asking supplementary questions to the query question, so that the user can input the corresponding supplementary question according to the direction of asking supplementary questions to the query question indicated by the question supplement prompt. The present application does not limit the process of receiving the supplementary question input by the user based on the question supplement prompt. Optionally, the process of obtaining the query question input by the user described in step S201 can be referred to, which will not be repeated here.

[0130] In the process of obtaining supplementary questions, generating and presenting supplementary information for questions can provide a basis for users to input supplementary questions, thereby improving the accuracy of obtaining supplementary questions and further improving the accuracy of query statement generation.

[0131] Figure 4 Schematic diagram of the process of generating a query statement based on a model provided in this application Figure 3 ,like Figure 4 As shown, in this embodiment Figure 2 or Figure 3Based on the embodiment shown, a process of determining a query sentence prompt word corresponding to a query question according to the status bit information corresponding to the query question is described in detail. The method includes:

[0132] Step S401: Obtain status bit information corresponding to the question in the previous round of dialogue, and determine reference information corresponding to the query question based on the status bit information corresponding to the question in the previous round of dialogue.

[0133] Specifically, the status bit information corresponding to the question in the previous round of dialogue can be obtained, wherein the description of the status bit information can refer to the description in the above embodiment, which will not be repeated here.

[0134] Specifically, after obtaining the status bit information corresponding to the question in the previous round of dialogue, the reference information corresponding to the query question can be determined according to the status bit information corresponding to the question in the previous round of dialogue. The reference information is information used for reference when generating the query statement corresponding to the query question. The present application does not limit the process of determining the reference information corresponding to the query question according to the status bit information corresponding to the question in the previous round of dialogue. Optionally, the process of determining the reference information corresponding to the query question according to the status bit information corresponding to the question in the previous round of dialogue may include: first, according to the status bit information corresponding to the question in the previous round of dialogue, determine the associated question set corresponding to the query question from the pre-constructed multi-round dialogue corpus. Then, from the pre-constructed query statement sample library, obtain the query statement sample corresponding to each associated question in the associated question set, and determine the set consisting of the query statement samples corresponding to all the associated questions as the reference information corresponding to the query question.

[0135] Among them, the pre-constructed multi-round dialogue corpus is a set of questions constructed based on each round of dialogue questions in the historical multi-round dialogue questions. Among them, the present application does not limit the process of determining the set of related questions corresponding to the query question from the pre-constructed multi-round dialogue corpus according to the state bit information corresponding to the previous round of dialogue questions. Optionally, the process of determining the set of related questions corresponding to the query question from the pre-constructed multi-round dialogue corpus according to the state bit information corresponding to the previous round of dialogue questions may include: vectorizing the state bit information corresponding to the previous round of dialogue questions to obtain the state bit information corresponding to the previous round of dialogue questions after vectorization. Based on the vectorized retrieval technology and the state bit information corresponding to the previous round of dialogue questions after vectorization, the set of related questions corresponding to the query question is determined from the pre-constructed multi-round dialogue corpus.

[0136] Among them, the related question set includes at least one related question, wherein the related question refers to a question that is more related to the question in the previous round of dialogue among the multiple questions included in the multi-round dialogue corpus. Among them, this application does not limit the number of related questions included in the related question set, and optionally, the number of related questions included in the related question set can be preset. Among them, if the status bit information corresponding to the question in the previous round of dialogue is date: July this year; region: Shanghai; indicator name: income; transaction channel: offline transaction, then the status bit information corresponding to the question in the previous round of dialogue after quantization processing is: <previous round of dialogue question: date: July this year; region: Shanghai; indicator name: income; transaction channel: offline transaction>.

[0137] The pre-constructed query statement sample library is a collection of query statement samples constructed based on each round of dialogue questions in the historical multi-round dialogue questions. The present application does not limit the process of obtaining the query statement sample corresponding to each related question in the related question set from the pre-constructed query statement sample library. Optionally, the query statement sample corresponding to each related question in the related question set can be obtained from the pre-constructed query statement sample library according to the preset mapping relationship. The preset mapping relationship represents the correspondence between the questions in the pre-constructed multi-round dialogue corpus and the query statement samples in the pre-constructed query statement sample library.

[0138] Specifically, after obtaining a query sample corresponding to each related question in the related question set from the pre-built query sample library, the set consisting of the query samples corresponding to all the related questions can be determined as reference information corresponding to the query question.

[0139] Step S402: Determine the query sentence prompt word corresponding to the query question according to the status bit information corresponding to the query question and the reference information corresponding to the query question.

[0140] Specifically, the query sentence prompt word corresponding to the query question can be determined according to the state bit information corresponding to the query question and the reference information corresponding to the query question determined in step S401.

[0141] The present application does not limit the process of determining the query statement prompt word corresponding to the query question according to the status bit information corresponding to the query question and the reference information corresponding to the query question. Optionally, the query statement prompt word corresponding to the query question can be constructed according to the status bit information corresponding to the query question and the preset prompt word construction strategy. The present application does not limit the preset prompt word construction strategy. Optionally, the preset prompt word construction strategy may include: a preset constraint statement, for example, discarding the historical data generated during the query statement generation process, and preset prompt word composition content, for example, including: the status bit information corresponding to the query question, the query question, the word slot information corresponding to the query question, and the reference information corresponding to the query question.

[0142] The query sentence prompt words corresponding to the query question are as follows:

[0143] “Preset constraint statement: discard the historical data generated during the query statement generation process;

[0144] The query asks: "How was August?";

[0145] The word slot information corresponding to the query question is: the value of the "date" slot is "this August", the value of the "region" slot is "empty", the value of the "indicator name" slot is "empty", and the value of the "trading channel" slot is "empty";

[0146] The status information corresponding to the query question is: "Date: August this year; Region: Shanghai; Indicator name: Revenue; Transaction channel: Offline transaction";

[0147] Combined with the questions in the previous round of dialogue, the query questions may be similar to the following types of questions, and the query sentence samples corresponding to the questions are as follows:

[0148] Related question 1: "Query the July revenue of Beijing branch"

[0149] Possible query examples:

[0150] Select transaction amount from table A where region = 'Beijing Branch' 'July this year'

[0151] Related question 2: "Query the revenue of Shanghai branch in August"

[0152] Possible query examples:

[0153] Select transaction amount from table A where region='Shanghai Company' 'August this year';

[0154] Please output the query statement corresponding to the query question according to the above rules. "

[0155] The embodiment of the present application provides a process for determining a query sentence prompt word corresponding to a query question based on status bit information corresponding to the query question, by obtaining the status bit information corresponding to the question in the previous round of dialogue, and determining reference information corresponding to the query question based on the status bit information corresponding to the question in the previous round of dialogue, and determining the query sentence prompt word corresponding to the query question based on the status bit information corresponding to the query question and the reference information corresponding to the query question, wherein the query sentence prompt word determined based on the reference information corresponding to the query question can control the generation process based on the reference information corresponding to the query question when a large model generates a query sentence, thereby improving the accuracy of query sentence generation.

[0156] Figure 5 Schematic diagram of the training method of the model for generating query statements provided in this application Figure 1 ,like Figure 5 As shown, the method includes:

[0157] Step S501: Obtain an initial query statement to generate a large model and a model training set.

[0158] Specifically, the initial query statement can be obtained to generate a large model and a model training set.

[0159] The initial query statement generates a large model, which is an initial model for training the query statement to generate a large model. The model training set includes multiple training samples. The training samples include: query statement prompt word samples, and query statements corresponding to the query statement prompt word samples. The query statement prompt word samples are used to indicate that the historical data generated during the query statement generation process is discarded.

[0160] For a description of the query prompt word samples, please refer to Figures 2 to 4 The description of the query sentence prompt words in any embodiment will not be repeated here.

[0161] Step S502: train the initial query statement generation large model according to the training samples included in the model training set to obtain the query statement generation large model.

[0162] Specifically, according to the training samples included in the model training set, the initial query statement generation large model can be trained to obtain the query statement generation large model.

[0163] Among them, the query statement generates a large model, which is Figures 2 to 4 The model described in any one of the embodiments.

[0164] Among them, the present application does not limit the process of training the initial query statement generation big model according to the training samples included in the model training set to obtain the query statement generation big model. Optionally, a training sample can be obtained from the model training set, and the query statement prompt word sample included in the training sample can be input into the initial query statement generation big model, and the initial query statement corresponding to the query statement prompt word sample can be output. According to the initial query statement corresponding to the query statement prompt word sample and the query statement corresponding to the query statement prompt word sample, the initial query statement generation big model is trained to obtain the query statement generation big model.

[0165] The training method of the model for query statement generation provided in the embodiment of the present application obtains an initial query statement generation large model and a model training set, and trains the initial query statement generation large model according to the training samples included in the model training set to obtain the query statement generation large model, wherein the training samples included in the model training set include query statement prompt word samples, and the sentence generation model is trained by the query statement prompt word samples, which can improve the accuracy of query statements generated by the query statement generation model obtained by training. Among them, the query statement prompt word samples are used to indicate that the historical data generated in the query statement generation process is discarded, which can simplify the memory of the query statement generation large model obtained by training, thereby improving the stability of the large model and improving the accuracy of query statement generation.

[0166] Figure 6 Schematic diagram of the training method of the model for generating query statements provided in this application Figure 2 ,like Figure 6 As shown, in this embodiment Figure 5 On the basis of the embodiment shown, the process of training the initial query statement to generate a large model according to the training samples included in the model training set to obtain the query statement to generate a large model is described in detail, and the method includes:

[0167] Step S601: Obtain a training sample from the model training set.

[0168] Specifically, a training sample may be obtained from the model training set. The present application does not limit the process of obtaining a training sample from the model training set. Optionally, a training sample may be randomly obtained from the model training set.

[0169] Step S602: Input the query sentence prompt word samples included in the training samples into the initial query sentence generation model, and output the initial query sentence corresponding to the query sentence prompt word samples.

[0170] Specifically, the query sentence prompt word samples included in the training samples obtained in step S602 are input into the initial query sentence generation model, and the initial query sentence corresponding to the query sentence prompt word samples is output.

[0171] Step S603: According to the initial query statement corresponding to the query statement prompt word sample and the query statement corresponding to the query statement prompt word sample, a large model for generating the initial query statement is trained to obtain a large model for generating the query statement.

[0172] Specifically, according to the initial query corresponding to the query prompt word sample obtained in step S602 and the query corresponding to the query prompt word sample, the initial query generation model can be trained to obtain the query generation model. Specifically, according to the initial query corresponding to the query prompt word sample and the query corresponding to the query prompt word sample, the loss function value of the initial query generation model can be calculated, and according to the calculated loss function threshold, the initial query generation model can be parameter adjusted to obtain the trained initial query generation model.

[0173] Optionally, after obtaining the trained initial query statement generation large model, a training sample can be obtained from the model training set, and the query statement prompt word sample included in the training sample can be input into the trained initial query statement generation large model, and the initial query statement corresponding to the query statement prompt word sample can be output. Then, based on the initial query statement corresponding to the query statement prompt word sample and the query statement corresponding to the query statement prompt word sample, it is determined whether the trained initial query statement generation large model has completed training. If it is determined that the training is completed, the trained initial query statement generation large model is determined as the query statement generation large model. Otherwise, the process described above is repeated until it is determined that the training is completed.

[0174] Among them, the present application does not limit the process of determining whether the training of the large model generated by the trained initial query statement has been completed. Optionally, the loss function value of the large model generated by the trained initial query statement can be calculated based on the initial query statement corresponding to the query statement prompt word sample and the query statement corresponding to the query statement prompt word sample. If the calculated loss function value is greater than the preset loss function threshold, it is determined that the training of the large model generated by the trained initial query statement has not been completed. Otherwise, it is determined that the training of the large model generated by the trained initial query statement has been completed.

[0175] The embodiment of the present application provides a process for training an initial query statement generation model according to a training sample included in a model training set to obtain a query statement generation model. The process comprises obtaining a training sample from the model training set, inputting a query statement prompt word sample included in the training sample into the initial query statement generation model, outputting an initial query statement corresponding to the query statement prompt word sample, training the initial query statement generation model according to the initial query statement corresponding to the query statement prompt word sample and the query statement corresponding to the query statement prompt word sample to obtain the query statement generation model. The process comprises training the initial query statement generation model according to the initial query statement corresponding to the query statement prompt word sample and the query statement corresponding to the query statement prompt word sample to improve the accuracy of model training and further improve the accuracy of query statement generation based on the query statement generation model obtained through training.

[0176] Figure 7 A schematic diagram of the structure of a device for generating a query statement based on a model provided in this application, such as Figure 7 As shown, the model-based query statement generation device 70 provided in this embodiment includes:

[0177] The acquisition module 701 is used to acquire a query question input by a user; wherein the query question is a current round of dialogue questions among multiple rounds of dialogue questions;

[0178] The determination module 702 is used to determine the query sentence prompt word corresponding to the query question according to the query question and the historical round dialogue question in the multi-round dialogue question; wherein the query sentence prompt word is used to indicate that the historical data generated in the query sentence generation process is discarded;

[0179] The generation module 703 is used to input the query statement prompt word into the pre-built query statement generation model to obtain the query statement corresponding to the query question.

[0180] In a possible embodiment, the determination module 702 is specifically used to perform word slot information extraction processing on the query question based on the word slot extraction technology to obtain the word slot information corresponding to the query question; obtain the state bit information corresponding to the previous round of dialogue questions in the historical rounds of dialogue questions; according to the word slot information corresponding to the query question, update the state bit information corresponding to the previous round of dialogue questions to obtain the state bit information corresponding to the query question; according to the state bit information corresponding to the query question, determine the query sentence prompt word corresponding to the query question.

[0181] In a possible embodiment, the determination module 702 is further specifically used to obtain the status bit information corresponding to the question in the previous round of dialogue, and determine the reference information corresponding to the query question based on the status bit information corresponding to the question in the previous round of dialogue; determine the query sentence prompt word corresponding to the query question based on the status bit information corresponding to the query question and the reference information corresponding to the query question.

[0182] In a possible embodiment, the determination module 702 is further specifically used to determine a set of related questions corresponding to the query question from a pre-constructed multi-round dialogue corpus based on the state bit information corresponding to the question in the previous round of dialogue; obtain a query sentence sample corresponding to each related question in the related question set from a pre-constructed query sentence sample library, and determine a set consisting of query sentence samples corresponding to all related questions as reference information corresponding to the query question.

[0183] In a possible embodiment, the determination module 702 is further specifically used to vectorize the status bit information corresponding to the question in the previous round of dialogue to obtain the status bit information corresponding to the question in the previous round of dialogue after vectorization processing; based on the vectorization retrieval technology and the status bit information corresponding to the question in the previous round of dialogue after vectorization processing, determine the set of related questions corresponding to the query question from the pre-constructed multi-round dialogue corpus.

[0184] In a possible embodiment, the determination module 702 is further specifically used to determine whether the question intention corresponding to the query question is complete based on the status bit information corresponding to the query question; if it is determined that the question intention corresponding to the query question is complete, then a process of determining the query sentence prompt word corresponding to the query question based on the status bit information corresponding to the query question is executed; otherwise, the following process is repeated: obtaining a supplementary question, and determining again whether the question intention corresponding to the query question is complete based on the obtained supplementary question, until it is determined that the question intention corresponding to the query question is complete, and then executing the status bit information corresponding to the question to determine the query sentence prompt word corresponding to the query question.

[0185] In a possible embodiment, the determination module 702 is further specifically used to obtain the question intention type corresponding to the query question; under the corresponding question intention type, determine whether the question intention corresponding to the query question is complete according to the status bit information corresponding to the query question.

[0186] In a possible embodiment, the determination module 702 is further specifically used to obtain the question intention type corresponding to the previous round of dialogue questions in the historical rounds of dialogue questions; determine whether a question intention type jump occurs based on the status bit information corresponding to the query question; if it is determined that the question intention type jump does not occur, determine the question intention type corresponding to the previous round of dialogue questions as the question intention type corresponding to the query question; if it is determined that the question intention type jump occurs, determine the question intention type corresponding to the query question based on the status bit information corresponding to the query question.

[0187] In a possible embodiment, the determination module 702 is further specifically configured to generate and present a supplementary question prompt; and receive a supplementary question input by the user based on the supplementary question prompt.

[0188] In a possible embodiment, the determination module 702 is further specifically used to update the status bit information corresponding to the query question according to the obtained supplementary question; and determine again whether the question intention corresponding to the query question is complete according to the status bit information corresponding to the query question after the update.

[0189] In a possible embodiment, the determination module 702 is further configured to determine a query sentence prompt word corresponding to the query question according to the query question if it is determined that the query question is a first-round dialogue question in multiple-round dialogue questions.

[0190] In a possible embodiment, the determination module 702 is further specifically used to perform word slot information extraction processing on the query question based on the word slot extraction technology to obtain the word slot information corresponding to the query question; generate the state bit information corresponding to the query question according to the word slot information corresponding to the query question; and determine the query sentence prompt word corresponding to the query question according to the state bit information corresponding to the query question.

[0191] In a possible embodiment, the generation module 703 is further used to obtain and present the answer content corresponding to the query question according to the query statement corresponding to the query question. The model-based query statement generation device provided in this embodiment can execute the method provided in the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.

[0192] Figure 8 A structural diagram of a training device for a model for generating query statements provided in this application, such as Figure 8 As shown, the training device 80 for the model for generating query statements provided in this embodiment includes:

[0193] An acquisition module 801 is used to acquire an initial query statement to generate a large model and a model training set;

[0194] The model training set includes a plurality of training samples; the training samples include: query sentence prompt word samples, and query sentences corresponding to the query sentence prompt word samples; wherein the query sentence prompt word samples are used to indicate that historical data generated during the query sentence generation process is discarded;

[0195] A training module 802 is used to train the initial query statement generation model according to the training samples included in the model training set to obtain the query statement generation model;

[0196] Among them, the query statement generates a large model, which is Figures 2 to 4 A model provided by any method embodiment.

[0197] In a possible embodiment, the training module 802 is specifically used to obtain a training sample from a model training set; input the query statement prompt word sample included in the training sample into the initial query statement generation large model, and output the initial query statement corresponding to the query statement prompt word sample; according to the initial query statement corresponding to the query statement prompt word sample and the query statement corresponding to the query statement prompt word sample, the initial query statement generation large model is trained to obtain the query statement generation large model.

[0198] The training device for the model for generating query statements provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.

[0199] Fig. 9 This is a schematic diagram of the structure of the electronic device provided in this application. Fig. 9 As shown, the electronic device 90 provided in this embodiment includes: at least one processor 901 and a memory 902. Optionally, the device 90 further includes a communication component 903. The processor 901, the memory 902 and the communication component 903 are connected via a bus 904.

[0200] In a specific implementation process, at least one processor 901 executes the computer execution instructions stored in the memory 902, so that at least one processor 901 executes the above method.

[0201] The specific implementation process of the processor 901 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0202] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.

[0203] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.

[0204] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0205] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0206] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0207] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0208] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0209] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

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

[0211] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0212] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0213] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0214] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A method for generating a query statement based on a model, characterized in that: include: Obtaining a query question input by a user; wherein the query question is a current round of dialogue questions among multiple rounds of dialogue questions; Determine, according to the query question and the historical round dialogue questions in the multiple round dialogue questions, a query sentence prompt word corresponding to the query question; wherein the query sentence prompt word is used to indicate that historical data generated during the query sentence generation process is to be discarded; The query statement prompt word is input into a pre-built query statement generation model to obtain a query statement corresponding to the query question.

2. The method according to claim 1, characterized in that Determining a query sentence prompt word corresponding to the query question according to the query question and the historical round dialogue questions in the multiple round dialogue questions includes: Based on the word slot extraction technology, the word slot information of the query question is extracted to obtain the word slot information corresponding to the query question; Obtaining the status bit information corresponding to the previous round of dialogue questions in the historical round of dialogue questions; According to the word slot information corresponding to the query question, the state bit information corresponding to the question in the previous round of dialogue is updated to obtain the state bit information corresponding to the query question; According to the status bit information corresponding to the query question, a query sentence prompt word corresponding to the query question is determined.

3. The method according to claim 2, characterized in that Determining the query sentence prompt word corresponding to the query question according to the state bit information corresponding to the query question includes: Acquire the status bit information corresponding to the question in the previous round of dialogue, and determine the reference information corresponding to the query question according to the status bit information corresponding to the question in the previous round of dialogue; The query sentence prompt word corresponding to the query question is determined according to the state bit information corresponding to the query question and the reference information corresponding to the query question.

4. The method according to claim 3, characterized in that Determining reference information corresponding to the query question according to the status bit information corresponding to the question in the previous round of dialogue includes: According to the state bit information corresponding to the question in the previous round of dialogue, a set of related questions corresponding to the query question is determined from a pre-constructed multi-round dialogue corpus; A query sample corresponding to each related question in the related question set is obtained from a pre-constructed query sample library, and a set consisting of query samples corresponding to all related questions is determined as reference information corresponding to the query question.

5. The method according to claim 4, characterized in that According to the state bit information corresponding to the previous round of dialogue question, a set of related questions corresponding to the query question is determined from a pre-constructed multi-round dialogue corpus, including: Performing vectorization processing on the state bit information corresponding to the question in the previous round of dialogue to obtain the state bit information corresponding to the question in the previous round of dialogue after vectorization processing; Based on the vectorized retrieval technology and the state bit information corresponding to the previous round of dialogue question after the vectorization processing, a set of related questions corresponding to the query question is determined from the pre-constructed multi-round dialogue corpus.

6. The method according to claim 2, characterized in that The method further comprises: Determining whether the question intention corresponding to the query question is complete according to the status bit information corresponding to the query question; If it is determined that the question intention corresponding to the query question is complete, a process of determining the query sentence prompt word corresponding to the query question according to the state bit information corresponding to the query question is executed; Otherwise, repeat the process as follows: A process of obtaining a supplementary question, and determining again whether the question intention corresponding to the query question is complete based on the obtained supplementary question, until it is determined that the question intention corresponding to the query question is complete, and then executing the status bit information corresponding to the question to determine the query sentence prompt word corresponding to the query question.

7. The method according to claim 6, characterized in that Determining whether the question intention corresponding to the query question is complete according to the status bit information corresponding to the query question includes: Obtaining the question intention type corresponding to the query question; Under the corresponding question intention type, determine whether the question intention corresponding to the query question is complete based on the status bit information corresponding to the query question.

8. The method according to claim 7, characterized in that Obtain the question intention type corresponding to the query question, including: Obtaining the question intention type corresponding to the previous round of dialogue questions in the historical round of dialogue questions; Determining whether a question intention type jump occurs according to the status bit information corresponding to the query question; If it is determined that no question intention type jump occurs, the question intention type corresponding to the question in the previous round of dialogue is determined as the question intention type corresponding to the query question; If it is determined that a question intention type jump has occurred, the question intention type corresponding to the query question is determined based on the status bit information corresponding to the query question.

9. The method according to claim 6, characterized in that Get additional questions, including: Generate and present supplemental prompts for questions; A supplementary question input by the user based on the supplementary question prompt is received.

10. The method according to claim 6, characterized in that Determining again whether the question intention corresponding to the query question is complete based on the obtained supplementary question, including: According to the obtained supplementary question, the status bit information corresponding to the query question is updated; According to the status bit information corresponding to the query question after the update processing, it is determined again whether the question intention corresponding to the query question is complete.

11. The method according to any one of claims 1 to 10, characterized in that: The method further comprises: If it is determined that the query question is a first round of dialogue question among the multiple rounds of dialogue questioning, a query sentence prompt word corresponding to the query question is determined according to the query question.

12. The method according to claim 11, characterized in that Determining a query sentence prompt word corresponding to the query question according to the query question includes: Based on the word slot extraction technology, the word slot information of the query question is extracted to obtain the word slot information corresponding to the query question; Generating state bit information corresponding to the query question according to the word slot information corresponding to the query question; According to the status bit information corresponding to the query question, a query sentence prompt word corresponding to the query question is determined.

13. The method according to any one of claims 1 to 10, characterized in that: The method further comprises: According to the query statement corresponding to the query question, the answer content corresponding to the query question is obtained and presented.

14. A method for training a model for generating query statements, characterized in that: include: Obtain the initial query statement to generate a large model and a model training set; The model training set includes a plurality of training samples; the training samples include: query sentence prompt word samples, and query sentences corresponding to the query sentence prompt word samples; the query sentence prompt word samples are used to indicate that historical data generated during the query sentence generation process is discarded; According to the training samples included in the model training set, the initial query statement generation large model is trained to obtain the query statement generation large model; The query statement generates a large model, which is the model described in any one of claims 1-13.

15. The method according to claim 14, characterized in that The initial query statement generation large model is trained according to the training samples included in the model training set to obtain the query statement generation large model, including: Acquire one of the training samples from the model training set; Inputting the query sentence prompt word sample included in the training sample into the initial query sentence generation model, and outputting the initial query sentence corresponding to the query sentence prompt word sample; According to the initial query statement corresponding to the query statement prompt word sample and the query statement corresponding to the query statement prompt word sample, the initial query statement generation large model is trained to obtain the query statement generation large model.

16. A training device for a model for generating query statements, characterized in that: include: An acquisition module is used to acquire a query question input by a user; wherein the query question is a current round of dialogue questions among multiple rounds of dialogue questions; A determination module, configured to determine a query statement prompt word corresponding to the query statement according to the query statement and the historical round dialogue questions in the multi-round dialogue questions; wherein the query statement prompt word is used to indicate that historical data generated during the query statement generation process is discarded; The generation module is used to input the query statement prompt word into the pre-built query statement generation model to obtain the query statement corresponding to the query question.

17. A device for generating query statements based on a model, characterized in that: include: The acquisition module is used to obtain the initial query statement to generate a large model and a model training set; The model training set includes a plurality of training samples; the training samples include: query sentence prompt word samples, and query sentences corresponding to the query sentence prompt word samples; the query sentence prompt word samples are used to indicate that historical data generated during the query sentence generation process is discarded; A training module, used for training the initial query statement generation large model according to the training samples included in the model training set to obtain the query statement generation large model; The query statement generates a large model, which is the model described in any one of claims 1-13.

18. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 13 or claims 14 to 15.

19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 13 or claims 14 to 15 when executed by a processor.

20. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 13 or claims 14 to 15.

Citation Information

Cited By

  • Model-based query statement generation method and apparatus, training method and apparatus, and electronic device

    WO2026097967A1