Dialogue model training method and device, electronic equipment and storage medium
By obtaining dialogue configuration information in stored information and automatically generating dialogue configuration files, the difficulty of manually maintaining configuration files in dialogue model training in the prior art is solved, and more efficient and lower-cost dialogue model training is achieved.
Patent Information
- Application Number
- CN202411985478.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-29
AI Technical Summary
In the prior art, the training of dialogue models requires developers to manually maintain the dialogue configuration files required for training, resulting in code block duplication, increased difficulty in decoupling and high risk of misoperation, reducing training efficiency and cost.
By obtaining the conversation configuration information of the conversation configuration field in the stored information and automatically generating the conversation configuration file, the conversation model is trained based on all conversation configuration files, reducing the need for manual writing and maintenance.
It reduces the difficulty of maintaining dialogue configuration files, reduces the training cost of dialogue models, improves training efficiency, and reduces the risk of misoperation.
Smart Images

Figure CN119903154A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and more specifically to a dialogue model training method, a dialogue model training device, an electronic device, a storage medium and a computer program product. Background Art
[0002] With the continuous development of the information interaction industry, the frequency of interaction between users and electronic devices is gradually increasing. As an important system to improve the interactive experience and reduce labor costs, the dialogue model that can generate response information can realize functions such as after-sales service and business inquiry.
[0003] For example, in a scenario where the dialogue model can provide business query functions, users can enter questions related to product information, order status, return policy, etc. Then, the dialogue model can output response information based on the questions entered by the user, combined with the actual product information, actual order status, and actual return policy. In the related art, the training of the dialogue model requires developers to manually maintain the dialogue configuration files required for training. On the one hand, there may be repeated code blocks in different dialogue configuration files. As the training data in the dialogue configuration files continues to increase, the difficulty of decoupling the dialogue configuration files will also increase; on the other hand, manual maintenance of the dialogue configuration files may also result in misoperation. Therefore, how to better train the dialogue model is a technical problem that technicians in this field urgently need to solve. Summary of the invention
[0004] The present invention is proposed in view of the above problems. The present invention provides a method for training a dialogue model, a device for training a dialogue model, an electronic device, a storage medium and a computer program product.
[0005] According to one aspect of the present invention, a method for training a dialogue model is provided, the method comprising:
[0006] For each conversation configuration field corresponding to each conversation configuration file, conversation configuration information of the conversation configuration field is obtained from the storage information, wherein the storage information stores a plurality of conversation configuration fields and conversation configuration information corresponding to each conversation configuration field;
[0007] Generate the conversation configuration file according to the conversation configuration information corresponding to each conversation configuration file;
[0008] Based on all the conversation profiles, train the conversation model.
[0009] Exemplarily, the conversation configuration file includes a first configuration file, the first configuration file includes a plurality of text areas, wherein each text area is used to store a group of conversation configuration information having a corresponding relationship, and each group of conversation configuration information having a corresponding relationship is associated and stored in the storage information;
[0010] Generate the dialog configuration file according to the dialog configuration information corresponding to each dialog configuration file, including:
[0011] For each dialog configuration field corresponding to each first configuration file, the blank text area in the first configuration file is filled text area by text area based on the dialog configuration information of the dialog configuration field to obtain the first configuration file.
[0012] Exemplarily, the first configuration file is a dialog rule file, and the dialog configuration fields corresponding to the dialog rule file include: an intent field, a form field, and an action function field.
[0013] For each dialog configuration field corresponding to each dialog configuration file, the dialog configuration information of the dialog configuration field is obtained from the storage information, including:
[0014] Read the intent configuration information of the intent field in the storage information;
[0015] Based on each intent configuration information read, the form information of the form field associated with the intent configuration information and the action function information of the action function field associated with the stored intent configuration information are read in the storage information, wherein the form information includes at least one slot to be filled, and the action function information is used to save the identifier of the preset data processing flow.
[0016] Exemplarily, the above training method further includes:
[0017] For each action function information, based on the execution condition information and response content information corresponding to the action function information in the storage information, the preset function framework corresponding to the action function information is filled in to obtain the data processing flow corresponding to the action function information, wherein the execution condition information is used to save the execution conditions in the data processing flow, and the response content information is used to save the response content of the dialogue model in the data processing flow.
[0018] Exemplarily, the execution condition information includes first verification condition information,
[0019] The data processing flow includes:
[0020] Verify whether the slot value to be filled into the slot meets the first verification condition information corresponding to the slot, and determine whether to fill the slot value into the slot according to the verification result; or verify whether the slot value to be filled into the slot meets the first verification condition information corresponding to the slot, and delete or update the slot value of the slot according to the verification result, wherein the slot is a slot in the form information corresponding to the data processing flow;
[0021] The above training methods also include:
[0022] For each slot in each form information, based on the slot identifier corresponding to the slot, the first verification condition information corresponding to the slot identifier is determined in the storage information.
[0023] Exemplarily, the execution condition information includes second verification condition information, and the response content information includes filling guide information.
[0024] The data processing flow includes:
[0025] Verifying whether the slot meets the second verification condition information corresponding to the slot, and determining whether to generate filling guidance information corresponding to the slot according to the verification result, where the filling guidance information is used to save the text responded by the dialogue model in the data processing flow and used to guide the filling of the slot, wherein the slot is the slot in the form information corresponding to the data processing flow;
[0026] The above training methods also include:
[0027] For each slot in each form information, based on the slot identifier corresponding to the slot, the second verification condition information and the filling guide information respectively corresponding to the slot identifier are determined in the storage information.
[0028] Exemplarily, the dialogue model includes a natural language processing module and a dialogue management module, and the dialogue configuration file includes a natural language processing configuration file, a response content file, a dialogue rule file, and a dialogue domain file;
[0029] Based on all the conversation profiles, train the conversation model, including:
[0030] Training a natural language processing module based on a natural language processing configuration file, wherein the natural language processing configuration file is generated according to intent configuration information of an intent field in a dialog configuration field;
[0031] The dialogue management module is trained based on the response content file, the dialogue rule file and the dialogue domain file, wherein the response content file is generated based on the response content information of the response field in the dialogue configuration field, the dialogue rule file is generated based on the intent configuration information, the form information of the form field in the dialogue configuration field and the action function information of the action function field in the dialogue configuration field, and the dialogue domain file is generated according to the dialogue configuration information corresponding to all the dialogue configuration fields.
[0032] According to yet another aspect of the present invention, there is provided a device for training a dialogue model, the device comprising: a dialogue configuration information acquisition module, a dialogue configuration file generation module and a model training module.
[0033] A dialog configuration information acquisition module, for acquiring the dialog configuration information of the dialog configuration field corresponding to each dialog configuration file in the storage information, and saving it to the dialog configuration file, wherein the storage information stores a plurality of dialog configuration fields and the dialog configuration information corresponding to each dialog configuration field;
[0034] A dialog configuration file generation module, used to generate the dialog configuration file according to the dialog configuration information corresponding to each dialog configuration file;
[0035] The model training module is used to train the dialogue model based on all saved dialogue configuration files.
[0036] According to another aspect of the present invention, an electronic device is provided. The electronic device comprises: a processor and a memory. The memory stores computer program instructions, and the computer program instructions are used to execute the training method of the dialogue model when the processor is running.
[0037] According to another aspect of the present invention, a storage medium is provided, on which program instructions are stored, and the program instructions are used to execute the above-mentioned dialogue model training method when running.
[0038] According to another aspect of the present invention, a computer program product is also provided. The computer program product includes computer program instructions, and the computer program instructions are used to execute the above-mentioned dialogue model training method when running.
[0039] According to the above scheme of the embodiment of the present invention, for each dialogue configuration field corresponding to each dialogue configuration file, the dialogue configuration information of the dialogue configuration field can be determined in the storage information and saved to the dialogue configuration file. Then, based on all the saved dialogue configuration files, the dialogue model is trained. The above scheme can automatically generate the dialogue configuration file to be used for dialogue model training through the storage information. Compared with the method of manually writing dialogue configuration files, the above scheme can reduce the difficulty of maintaining the dialogue configuration file, which is conducive to reducing the training cost of the dialogue model and can also improve the training efficiency of the dialogue model. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The above and other purposes, features and advantages of the present invention will become more apparent by describing the embodiments of the present invention in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0041] Figure 1 A schematic flow chart of a method for training a dialogue model according to an embodiment of the present invention is shown;
[0042] Figure 2 A schematic block diagram showing a training device for a dialogue model according to an embodiment of the present invention; and
[0043] Figure 3 A schematic block diagram of an electronic device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical scheme and advantages of the present invention more obvious, the exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments of the present invention, and it should be understood that the present invention is not limited to the exemplary embodiments described herein. Based on the embodiments of the present invention described in the present invention, all other embodiments obtained by those skilled in the art without creative work should fall within the protection scope of the present invention.
[0045] With the development and widespread application of intelligent technology, artificial intelligence has profoundly changed the way people live and work. In this context, the demand for dialogue models that can generate response information has become more and more urgent. With the continuous advancement of large language model (LLM) technology, its application areas are constantly expanding. The dialogue model that can generate response information integrates advanced technologies such as natural language processing and machine learning, and is committed to quickly and accurately generating response information based on the user's questions to answer the user's questions.
[0046] In the prior art, developers need to write corresponding custom codes according to the dialogue process to implement the dialogue logic of the dialogue model that can generate response information. When the dialogue process changes, developers need to manually rewrite the content in the yaml file for training the dialogue model that can generate response information. This method is not only cumbersome and complicated to operate, but also consumes a lot of manpower and time, thereby increasing the training cost of the dialogue model that can generate response information. In addition, due to the lack of programming knowledge, developers may not be able to directly modify the yaml file through the above solution, which leads to the inability to train the dialogue model that can generate response information according to actual needs.
[0047] In order to at least partially solve the above problems, an embodiment of the present invention provides a method for training a dialogue model. Figure 1 FIG. 1 is a schematic flow chart of a method for training a dialogue model according to an embodiment of the present invention. Figure 1 As shown, the training method may include the following steps S110 to S130.
[0048] In step S110, for each dialog configuration field corresponding to each dialog configuration file, the dialog configuration information of the dialog configuration field is obtained from the storage information.
[0049] The storage information stores multiple dialogue configuration fields and dialogue configuration information corresponding to each dialogue configuration field. For example, the storage information stores a dialogue configuration field indicating "intention" and dialogue configuration information corresponding to the dialogue configuration field, a dialogue configuration field indicating "response information" and dialogue configuration information corresponding to the dialogue configuration field, etc. Taking the dialogue configuration field indicating "intention" as an example, the dialogue configuration field indicating "intention" may correspond to multiple dialogue configuration information indicating "intention", such as dialogue configuration information indicating "asking about the weather", dialogue configuration information indicating "asking about the wind speed", etc.
[0050] In one example, the dialogue configuration information of the dialogue configuration field representing "intent" may correspond to dialogue configuration information including multiple dialogue configuration information representing "intent" and at least one query information corresponding to the dialogue configuration information. In other words, the storage information may also include at least one query information corresponding to the dialogue configuration information. For example, taking the above-mentioned dialogue configuration information representing "ask about the weather" as an example, the dialogue configuration information representing "ask about the weather" may correspond to query information representing "how is the weather", query information representing "will it rain", query information representing "will it snow", etc.
[0051] According to the conversation configuration field corresponding to each conversation configuration file, the conversation configuration information of the conversation configuration field can be obtained in the storage information. For example, if the conversation configuration field corresponding to the conversation configuration file is a conversation configuration field indicating "intention", the conversation configuration information of the conversation configuration field indicating "intention" in the storage information is obtained. For another example, if the conversation configuration field corresponding to the conversation configuration file is a conversation configuration field indicating "response information", the conversation configuration information of the conversation configuration field indicating "response information" in the storage information is obtained.
[0052] In step S120, the dialog configuration files are generated according to the dialog configuration information corresponding to each dialog configuration file.
[0053] The blank dialogue configuration file can be filled according to the dialogue configuration information corresponding to each dialogue configuration file obtained from the storage information, so as to generate the dialogue configuration file in step S120. For example, if the dialogue configuration field corresponding to the dialogue configuration file is a dialogue configuration field indicating "intention", the dialogue configuration information of the dialogue configuration field indicating "intention" is obtained from the storage information, such as dialogue configuration information indicating "asking about the weather" and dialogue configuration information indicating "asking about the wind force". The dialogue configuration information indicating "asking about the weather" and dialogue configuration information indicating "asking about the wind force" are used as dialogue configuration information of the dialogue configuration field indicating "intention", and the dialogue configuration file indicating "intention" is generated. For another example, if the dialogue configuration field corresponding to the dialogue configuration file is a dialogue configuration field indicating "response information", the dialogue configuration information of the dialogue configuration field indicating "response information" is obtained from the storage information, such as dialogue configuration information indicating "clear sky" and dialogue configuration information indicating "northwest wind level 4". The dialogue configuration information indicating "clear sky" and the dialogue configuration information indicating "northwest wind level 4" are used as the dialogue configuration information of the dialogue configuration field indicating "response information" to generate a dialogue configuration file indicating "response information".
[0054] In step S130 , a dialogue model is trained based on all dialogue configuration files.
[0055] The dialogue model may be trained according to the dialogue configuration information of all the dialogue configuration fields in all the dialogue configuration files. For example, the training process of the dialogue model may include: obtaining a plurality of training data according to the dialogue configuration information of all the dialogue configuration fields in all the dialogue configuration files. Iteratively training the dialogue model through the plurality of training data, and adjusting the model parameters of the dialogue model through the loss function until the training is completed. The conditions for the completion of the training may be that the loss value calculated through the loss function tends to be stable, the number of iterations reaches a preset number, etc. In the case where the dialogue configuration information of all dialogue configuration fields in all dialogue configuration files includes dialogue configuration information representing "intent", query information corresponding to the dialogue configuration information representing "intent", multiple dialogue configuration information representing "slots", slot values corresponding to each dialogue configuration information representing "slots", and multiple dialogue configuration information representing "response information", each of the above training data may include: dialogue configuration information representing "intent" for training, query information corresponding to the dialogue configuration information representing "intent" for training, multiple dialogue configuration information representing "slots" for training, slot values corresponding to each dialogue configuration information representing "slots" for training, and multiple dialogue configuration information representing "response information" for training. The above loss value may include the difference between the predicted response information output by the dialogue model and the corresponding dialogue configuration information representing "response information" for training, and may also include the loss value calculated by other loss functions in the related art, so that the predicted response information output by the dialogue model during the iterative training process is closer to the response information used for training. After the training is completed, the dialogue model can generate response information corresponding to the query information based on the query information input by the user. For the specific training process, reference may be made to related technologies, and the embodiments of the present invention are not limited here.
[0056] According to the above scheme of the embodiment of the present invention, for each dialogue configuration field corresponding to each dialogue configuration file, the dialogue configuration information of the dialogue configuration field can be determined in the storage information and saved to the dialogue configuration file. Then, based on all the saved dialogue configuration files, the dialogue model is trained. The above scheme can automatically generate the dialogue configuration file to be used for dialogue model training through the storage information. Compared with the method of manually writing dialogue configuration files, the above scheme can reduce the difficulty of maintaining the dialogue configuration file, which is conducive to reducing the training cost of the dialogue model and can also improve the training efficiency of the dialogue model.
[0057] Exemplarily, the conversation configuration file includes a first configuration file, and the first configuration file includes a plurality of text areas.
[0058] Each text area is used to store a group of corresponding dialogue configuration information, and each group of corresponding dialogue configuration information is stored in association in the storage information. For example, the first configuration file includes the dialogue configuration information of the dialogue configuration field representing "intention" and the dialogue configuration information of the dialogue configuration field representing "response information". In the multiple text areas of the first configuration file, each text area stores a group of dialogue configuration information of the dialogue configuration field representing "intention" and the dialogue configuration information of the dialogue configuration field representing "response information" corresponding to the dialogue configuration information of the dialogue configuration field representing "intention". The dialogue configuration information of the dialogue configuration field representing "intention" stored in different text areas may be different. The dialogue configuration information of the dialogue configuration field representing "intention" and the dialogue configuration information of the dialogue configuration field representing "response information" stored in each text area are stored in association in the storage information. For example, the dialogue configuration information of the dialogue configuration field representing "intention" includes dialogue configuration information representing "asking about the weather" and dialogue configuration information representing "asking about the wind force", and the dialogue configuration information of the dialogue configuration field representing "response information" includes dialogue configuration information representing "clear sky" and dialogue configuration information representing "southwest wind level 4". The first configuration file may include two text areas. The first text area stores dialogue configuration information representing "asking about the weather" and dialogue configuration information representing "clear sky", and the second text area stores dialogue configuration information representing "asking about the wind force" and dialogue configuration information representing "southwest wind level 4". The dialogue configuration information representing "asking about the weather" and dialogue configuration information representing "clear sky" are stored in association in the storage information, and the dialogue configuration information representing "asking about the wind force" and dialogue configuration information representing "southwest wind level 4" are stored in association in the storage information. It should be understood that the dialogue configuration information with corresponding relationships stored in each of the above text areas can be a one-to-one correspondence or a one-to-many correspondence.
[0059] The above step S120 of “generating the dialog configuration file according to the dialog configuration information corresponding to each dialog configuration file” includes step S121.
[0060] In step S121, for each dialog configuration field corresponding to each first configuration file, the blank text area in the first configuration file is filled text area by text area based on the dialog configuration information of the dialog configuration field to obtain the first configuration file.
[0061] According to the dialogue configuration fields corresponding to each first configuration file, the dialogue configuration information of the dialogue configuration field is obtained from the storage information. According to the obtained dialogue configuration information, the blank text area in the first configuration file is filled in one by one text area to obtain the first configuration file. For example, taking the first configuration file in the above text as an example, the dialogue configuration information of the dialogue configuration field representing "intention" and the dialogue configuration information of the dialogue configuration field representing "response information" (the dialogue configuration information is hereinafter referred to as response content information, and the response content information is used to save the response content that can be output by the dialogue model), the dialogue configuration fields corresponding to the first configuration file are the dialogue configuration field representing "intention" and the dialogue configuration field representing "response information". The dialogue configuration information representing "asking about the weather" (that is, the dialogue configuration information of the dialogue configuration field representing "intention" in this example) is obtained from the storage information, and the obtained dialogue configuration information representing "asking about the weather" is filled into the first text area. The dialog configuration information indicating "clear sky" stored in association with the dialog configuration information is obtained (in this example, it indicates the response content information), and the obtained dialog configuration information indicating "clear sky" is filled into the first text area. The filled first text area stores the dialog configuration information indicating "ask about the weather" and the dialog configuration information indicating "clear sky".
[0062] The dialog configuration information indicating "asking about the wind force" (that is, the dialog configuration information of the dialog configuration field indicating "intention" in this example) is obtained from the storage information, and the obtained dialog configuration information indicating "asking about the wind force" is filled into the second text area. The dialog configuration information indicating "southwest wind level 4" stored in association with the dialog configuration information is obtained (that is, the response content information in this example), and the obtained dialog configuration information indicating "southwest wind level 4" is filled into the second text area. The filled second text area stores the dialog configuration information indicating "asking about the wind force" and the dialog configuration information indicating "southwest wind level 4".
[0063] According to the above solution provided by the embodiment of the present invention, for each dialogue configuration field corresponding to each first configuration file, the blank text area in the first configuration file can be filled text area by text area based on the dialogue configuration information of the dialogue configuration field to obtain the first configuration file. The above solution can save the dialogue configuration information stored in the storage information in association with the text area, so that the dialogue configuration information stored in the first configuration file has an association relationship, which is convenient for the subsequent use of the dialogue configuration files with corresponding relationships in the first configuration file to train the above dialogue model.
[0064] Exemplarily, the first configuration file is a dialog rule file.
[0065] The dialog configuration fields corresponding to the dialog rule file include: an intent field, a form field, and an action function field. It should be understood that the dialog model can also be trained in conjunction with the dialog rule file so that the dialog model can determine the dialog strategy in different situations.
[0066] The intent field can be the dialog configuration field representing "intent" as described above. The dialog configuration information of the intent field can be used as intent configuration information (i.e., the dialog configuration information of the dialog configuration field representing "intent" as described above). For example, the intent configuration information representing "asking about the weather", the intent configuration information representing "asking about the wind speed", etc.
[0067] The dialog configuration information of the form field includes at least one slot. The corresponding slot identifiers are different between different slots. For example, the slot identifier of the first slot is "date", and the slot identifier of the second slot is "place". The slots in the form field may correspond to the intent configuration information in the intent field. For example, each intent configuration information in the intent field may correspond to at least one slot in the form field. Specifically, for example, the intent configuration information representing "how is the weather" corresponds to the slot identified as "date" and the slot identified as "region" in the form field.
[0068] The dialogue configuration information of the action function field may include an identifier of the data processing flow. For example, in the case where the dialogue configuration information of the action function field includes a representation of the data processing flow, the data processing flow may include the representation "if (here determined according to the slot value of the slot), then execute (here also determined according to the slot value of the slot, and the reply information corresponding to the slot value)". For example, the data processing flow may be "If the slot value of the slot identified as "date" is today, and the slot value of the slot identified as "place" is city A, then output the weather conditions of city A today". It should be understood that the specific content of the above-mentioned data processing flow can be stored separately in the file corresponding to the data processing flow. When the identifier of the data processing flow in the storage information is determined, the corresponding data processing flow can be found in the file.
[0069] The above step S110, for each conversation configuration field corresponding to each conversation configuration file, obtains the conversation configuration information of the conversation configuration field in the storage information, which may include step S111 and step S112.
[0070] In step S111, the intent configuration information of the intent field is read in the storage information.
[0071] The intention configuration information of the intention field can be read in the storage information, that is, the dialogue configuration field representing "intention" of the intention field mentioned above. According to each intention configuration information read, the blank text area in the dialogue rule file is filled text area by text area. For example, the blank text area in the dialogue rule file includes a first text area and a second text area, and the first intention configuration information read from the storage information (for example, the intention configuration information representing "asking about the weather") is filled in the first text area. The second intention configuration information read from the storage information (for example, the intention configuration information representing "asking about the wind speed") is filled in the second text area to achieve the above-mentioned filling of the blank text area in the dialogue rule file text area by text area.
[0072] In step S112, based on each read intent configuration information, the form information of the form field stored in association with the intent configuration information and the action function information of the action function field stored in association with the intent configuration information are read in the storage information.
[0073] The form information includes at least one slot to be filled. For example, the form information includes a slot marked as "date" and a slot marked as "region". The slot marked as "date" and the slot marked as "region" are not filled with corresponding slot values.
[0074] The action function information is used to store the identifier of the preset data processing flow. Please refer to the above content about the action information function, and the embodiment of the present invention will not be described in detail here.
[0075] According to the multiple intention configuration information read from the storage information, the form information of the form field associated with each intention configuration information and the action function information of the action function field associated with each intention configuration information are read in the storage information. For example, the form information associated with the intention configuration information representing "ask about the weather" in the storage information includes a slot marked as "date" and a slot marked as "region", then the slot marked as "date" and the slot marked as "region" are stored in the text area where the intention configuration information representing "ask about the weather" is stored. The action function information associated with the intention configuration information representing "ask about the weather" in the storage information includes the identifier "action1", which "action1" can be an identifier of a data processing flow. The identifier "action1" is stored in the text area where the intention configuration information representing "ask about the weather" is stored. Through the above process, the first text area obtained includes: the intention configuration information representing "ask about the weather", the slot marked as "date", the slot marked as "region" and the identifier "action1". The filling method of other text areas in the dialogue rule file is the same as the filling method of the first text area, and the embodiment of the present invention will not be described in detail here.
[0076] According to the above scheme provided by the embodiment of the present invention, the intent configuration information of the intent field can be read in the storage information. Then, based on each intent configuration information read, the form information of the form field associated with the intent configuration information and the action function information of the action function field associated with the stored intent configuration information are read in the storage information. The above scheme can automatically generate the dialogue rule file required for dialogue model training through the storage information, which is conducive to reducing the labor cost of manually writing dialogue rule files.
[0077] Exemplarily, the above generation method may further include step S210.
[0078] In step S210, for each action function information, based on the execution condition information and response content information corresponding to the action function information in the storage information, the preset function framework corresponding to the action function information is filled to obtain the data processing flow corresponding to the action function information.
[0079] The execution condition information is used to save the execution condition in the data processing flow, and the response content information can be used to save the response content of the dialogue model in the data processing flow. For example, the above-mentioned execution condition and the above-mentioned response content can be determined manually. The above-mentioned execution condition information can be related to at least one of the following stored in association with the corresponding action function information in the storage information: intention configuration information, slot values of each slot in the form information, and the filling status of each slot. The response content information can be determined manually based on the execution condition information. For example, the intention configuration information associated with the action function in the storage information is the intention configuration information indicating "ask what the weather is like", and the form information associated with the intention configuration information indicating "ask what the weather is like" includes a slot marked as "date" and a slot marked as "region". The execution condition can include that the slot marked as "date" is not filled, the slot marked as "region" is not filled, and the slot marked as "date" and the slot marked as "region" are not filled. The response content information may include response content for requesting the user to add a date, response content information for requesting the user to add a region, and response content information for requesting the user to add a date and a region. For another example, the execution condition may be the intention to end the conversation contained in the user's query information, such as goodbye, bye, no questions, etc. The response content information corresponding to the execution condition may be goodbye, bye, etc.
[0080] The preset function framework of the action function information may include keywords of a programming language, such as an “if” keyword, an “else” keyword, and the like.
[0081] The execution condition information and response content information corresponding to the action function information in the storage information can be directly filled into the preset function framework corresponding to the action function information to obtain the data processing flow corresponding to the action function information. For example, taking the preset function framework including the "if" keyword of the programming language as an example, the pseudocode of the preset function framework that is not filled in the action function information can be "if (execution condition information), (response content information)". The execution condition information corresponding to the action function information in the storage information is that the slot marked as "date" is not filled, and the response content information corresponding to the action function information in the storage information is used to request the user to supplement the response content of the date (for example, "What day do you mean?"). The preset function framework is filled in according to the execution condition information and response content information corresponding to the action function information in the storage information. The filled action function information indicates that "if the slot marked as "date" is not filled, send "which day do you mean" to the user", that is, the data processing flow corresponding to the obtained action function information is: when the slot marked as "date" is not filled, send "which day do you mean" to the user (that is, the response content information requesting to supplement the date). It should be understood that, for each intent information, the execution condition information associated with the intent information and stored in the data processing flow that is not filled in can be filled. For example, when a specific identifier is read, the execution condition information can be placed in the position of the specific identifier. Specifically, for example, a different identifier can be set for each execution condition information, or the execution condition information can be read in sequence for filling, and the embodiments of the present invention are not limited here.
[0082] According to the above scheme provided by the embodiment of the present invention, for each action function information, based on the execution condition information and response content information respectively corresponding to the action function information in the storage information, the preset function framework corresponding to the action function information can be filled to obtain the data processing flow corresponding to the action function information. The above scheme can automatically fill the preset function framework based on the execution condition information and response content information in the storage information to obtain the data processing flow required for dialogue model training, which is conducive to reducing the labor cost of manually writing data processing flows.
[0083] Exemplarily, the execution condition information may include first verification condition information.
[0084] The above-mentioned first verification condition information can be used to determine whether the slot value to be filled needs to be filled into the corresponding slot. The first verification condition information may include the slot value range of the slot. For example, the slot value range of the slot represented by the first verification condition information is that the slot value of the slot is less than 10. If the slot value to be filled into the slot is "12", it is determined that the slot value to be filled into the slot does not meet the first verification condition information. For another example, the slot value range of the slot represented by the first verification condition information is that the slot value in the slot is one of "teacher" and "student". If the slot value to be filled into the slot is "parent", it is determined that the slot value to be filled into the slot does not meet the first verification condition information.
[0085] Exemplarily, the data processing flow in the above step S210 may include: verifying whether the slot value to be filled into the slot meets the first verification condition information corresponding to the slot, and determining whether to fill the slot value into the slot according to the verification result.
[0086] The slot may be a slot in the form information corresponding to the data processing flow. For example, the data processing flow is a data processing flow of sending a message "Which day do you mean?" to the user when the slot marked as "date" is not filled in the step S210. The slot in the form corresponding to the data processing flow is a slot marked as "date".
[0087] According to the first verification condition information, the slot value to be filled into the slot is verified. And according to the verification result, it is determined whether to fill the slot value into the slot. For example: taking the slot identified as "date" in the above text as an example, the first verification condition information is that the part of the slot value of the slot representing "month" is an integer less than 13, and the part representing "day" is an integer corresponding to the part representing "month", that is, when the part representing "month" is 1, the part representing "day" is an integer less than 32, and when the part representing "month" is 4, the part representing "day" is an integer less than 31. If the slot value to be filled into the slot is "January 33", according to the first verification condition information, the slot value to be filled into the slot with the slot value of "January 33" is verified, and a verification result indicating "verification failure" is obtained. According to the verification result indicating "verification failure", it is determined not to fill the slot value to be filled into the slot (in this example, "January 33") into the slot. If the slot value to be filled into the slot is "January 31st", the slot value to be filled into the slot with the slot value "January 31st" is verified according to the first verification condition information, and a verification result indicating "verification successful" is obtained. According to the verification result indicating "verification successful", it is determined that the slot value to be filled into the slot (in this example, "January 31st") is filled into the slot.
[0088] In the case of obtaining a verification result indicating "verification failed", a response content information for requesting the user to re-provide information related to the slot to be filled can be generated. For example, taking the above content as an example, the slot value to be filled in the slot with a slot value of "January 33" corresponds to the verification result of "verification failed". In this case, a response content information indicating "the date you entered is incorrect, please re-enter" can be generated to request the user to re-provide information related to the slot marked as "date".
[0089] The above generation method also includes: step S310.
[0090] In step S310, for each slot in each form information, based on the slot identifier corresponding to the slot, first verification condition information corresponding to the slot identifier is determined in the storage information.
[0091] The slot identifier corresponding to the slot may be stored in association with the first verification condition information corresponding to the slot identifier in the storage information. For example, the slot identifier representing "date" is stored in association with the first verification condition information that the part of the slot value representing the "month" is an integer less than 13, and the part representing the "day" is an integer corresponding to the part representing the "month". The slot identifier representing "age" is stored in association with the first verification condition information that the slot value representing the slot is less than 200.
[0092] According to the slot identifier corresponding to each slot in the form, the first verification condition information corresponding to the slot identifier can be determined in the storage information. For example, in the storage information, the slot identifier can be stored in association with the first verification condition information as described above. In the case of determining the slot identifier corresponding to the slot, the first verification condition information corresponding to it in the storage information can be determined according to the slot identifier. For example, in the storage information, the slot identifier representing "age" is stored in association with the first verification condition information indicating that the slot value of the slot is less than 200. Then, according to the slot identifier representing "age" in the form, the first verification condition information corresponding to the slot identifier is determined, that is, the first verification condition information indicating that the slot value of the slot is less than 200.
[0093] According to the above scheme provided by the embodiment of the present invention, it is possible to verify whether the slot value to be filled into the slot meets the first verification condition information corresponding to the slot through the data processing process, and determine whether to fill the slot value into the slot according to the verification result. The above scheme can determine whether the slot value to be filled into the slot meets the first verification condition information corresponding to the slot through the data processing process, and then guide the dialogue model to determine whether to fill the slot based on the generated slot value under the first verification condition, which is conducive to enriching the dialogue strategy of the dialogue model. In addition, the above scheme can also determine the first verification condition information corresponding to the slot identifier in the storage information for each slot in each form information based on the slot identifier corresponding to the slot, so as to automatically generate the above data processing process, which is conducive to reducing the labor cost of manually writing the data processing process.
[0094] Exemplarily, the data processing flow in the above step S210 may include: verifying whether the slot value to be filled into the slot meets the first verification condition information corresponding to the slot, and deleting or updating the slot value of the slot according to the verification result.
[0095] For example, the first verification condition information can be used to determine whether the slot corresponding to the slot value to be filled already has a slot value. If so, the slot value in the slot can be updated to the slot value to be filled. For another example, the first verification condition information can be used to determine whether the slot corresponding to the slot value to be filled is the slot corresponding to the intent (extracted from the query information) in this round of dialogue (the slot of the intent configuration information matched by the intent can be used as the slot corresponding to the intent). If not, the slot in this round of dialogue can be deleted, and the corresponding slot can be determined again based on the intent in the query information.
[0096] The above generation method also includes step S310 mentioned above, for each slot in each form information, based on the slot identifier corresponding to the slot, determining the first verification condition information corresponding to the slot identifier in the storage information, which is not described in detail in the embodiment of the present invention.
[0097] According to the above scheme provided by the embodiment of the present invention, it is possible to verify whether the slot value to be filled in the slot meets the first verification condition information corresponding to the slot through the data processing process, and delete or update the slot value of the slot according to the verification result. The above scheme can determine whether the slot value to be filled in the slot meets the first verification condition information corresponding to the slot through the data processing process, and then guide the dialogue model to determine whether to update or delete the slot based on the generated slot value under the first verification condition, which is conducive to enriching the dialogue strategy of the dialogue model. In addition, the above scheme can also determine the first verification condition information corresponding to the slot identifier in the storage information for each slot in each form information based on the slot identifier corresponding to the slot, so as to automatically generate the above data processing process, which is conducive to reducing the labor cost of manually writing the data processing process.
[0098] Exemplarily, the execution condition information includes second verification condition information, and the response content information includes filling guide information.
[0099] The above data processing flow may include: verifying whether the slot meets the second verification condition information corresponding to the slot, and determining whether to generate filling guide information corresponding to the slot according to the verification result.
[0100] The slot is a slot in the form information corresponding to the data processing flow. For example, take the data processing flow of sending a message "What date do you mean?" (i.e., the response content of requesting to supplement the date) to the user in the case where the slot marked as "date" is not filled in the above step S210 as an example. The slot in the form corresponding to the above data processing flow is the slot marked as "date".
[0101] The second verification condition information may be used to verify whether the slot is filled with a slot value.
[0102] The filling guide information is used to store the text that the dialogue model responds to in the data processing flow and is used to guide the filling of the slot. The filling guide information is used to guide the user to supplement the information. For example, when it is determined that the slot marked as "date" is not filled with a slot value, the filling guide information included in the response content can be information indicating that the user is asked about the date, such as "Excuse me, which day do you mean?"
[0103] The slot can be verified according to the second verification condition information, and according to the verification result, it is determined whether to generate the filling guidance information corresponding to the slot. For example, taking the slot in the above text as the slot marked as "date" as an example, the second verification condition information indicates that the slot value has been filled in the slot, then when the slot value (such as "January 31st") is filled in the slot marked as "date", a verification result indicating "verification successful" is obtained. In the case of obtaining a verification result indicating "verification successful", it is determined not to generate the filling guidance information corresponding to the slot marked as "date". And in the case of not filling the slot value in the slot marked as "date", a verification result indicating "verification failed" is obtained. In the case of obtaining a verification result indicating "verification failed", it is determined to generate the filling guidance information corresponding to the slot marked as "date", such as "What day do you mean?"
[0104] The above generation method also includes step S410.
[0105] In step S410, for each slot in each form information, based on the slot identifier corresponding to the slot, the second verification condition information and the filling guide information respectively corresponding to the slot identifier are determined in the storage information.
[0106] The slot identifier corresponding to the slot, the second verification condition information corresponding to the slot identifier, and the filling guide information corresponding to the slot identifier can be stored in association in the storage information. For example, the slot identifier representing "date" is associated with the second verification condition information that determines that the slot identified as "date" is filled, and the filling guide information for requesting the date from the user (such as "Which day do you mean?").
[0107] According to the slot identifier corresponding to each slot in the form, the second verification condition information corresponding to the slot identifier and the filling guide information can be determined in the storage information. For example, in the storage information, the slot identifier can be stored in association with the second verification condition information and the filling guide information as described above. In the case of determining the slot identifier corresponding to the slot, the second verification condition information corresponding to it in the storage information and the filling guide information corresponding to it can be determined according to the slot identifier. For example, in the storage information, the slot identified as "date" is associated with the second verification condition that the slot identified as "date" is filled, and the filling guide information for requesting the date from the user (such as "which day do you mean"). According to the slot identifier representing "date" in the form, the second verification condition information corresponding to the slot identifier and the filling guide information for requesting the date from the user (such as "which day do you mean") are determined.
[0108] According to the above scheme provided by the embodiment of the present invention, it is possible to verify whether the slot meets the second verification condition information corresponding to the slot, and determine whether to generate the filling guide information corresponding to the slot based on the verification result. The above scheme can determine whether the slot value to be filled into the slot meets the second verification condition information corresponding to the slot through the data processing flow, and then guide the dialogue model to determine whether to generate the filling guide information corresponding to the slot under the second verification condition, which can enrich the dialogue strategy of the dialogue model, and is conducive to guiding the user to fill the slot to generate response information that is more adaptable to the query information input by the user. In addition, the above scheme can also determine the second verification condition information and filling guide information corresponding to the slot identifier in the storage information for each slot in each form information based on the slot identifier corresponding to the slot, so as to automatically generate the above data processing flow, which is conducive to reducing the labor cost of manually writing the data processing flow.
[0109] Exemplarily, the dialogue model includes a natural language processing module and a dialogue management module.
[0110] The dialog configuration file includes a natural language processing configuration file, a response content file, a dialog rule file, and a dialog domain file.
[0111] The above step S130 may include: step S131 and step S132.
[0112] In step S131, the natural language processing module is trained based on the natural language processing configuration file.
[0113] The natural language processing configuration file is generated according to the intent configuration information of the intent field of the dialogue configuration field. The above natural language processing configuration file can be the Nlu.yml file in the related art (the file with the suffix yml can be regarded as the yaml file above). The above natural language processing module can be the Nlu module in the related art.
[0114] In step S132, the dialogue management module is trained based on the response content file, the dialogue rule file and the dialogue domain file.
[0115] The response content file is generated based on the response content information of the response field in the dialog configuration field. The dialog rule file is generated based on the intent configuration information, the form information of the form field in the dialog configuration field, and the action function information of the action function field in the dialog configuration field. The dialog domain file can be generated according to the dialog configuration information corresponding to each of all dialog configuration fields.
[0116] The above-mentioned response content file may be Response.yml in the related art. The dialogue rule file may be Rules.yml in the related art. The dialogue domain file may be Domain.yml file in the related art. The generation process of the response content file and the dialogue rule file may be based on the corresponding dialogue configuration fields and the generation process of the dialogue rule file in the above text, and the embodiments of the present invention will not be described in detail here. The above-mentioned dialogue management module may be the Core module in the related art, which is used to determine the dialogue strategy.
[0117] According to the above solution provided by the embodiment of the present invention, the natural language processing module can be trained based on the natural language processing configuration file. Then, the dialogue management module can be trained based on the response content file, the dialogue rule file and the dialogue domain file. The above solution can train the natural language processing module and the dialogue management module in the dialogue model respectively to achieve targeted training for different modules in the dialogue model. The trained dialogue model obtained therefrom can, on the one hand, perform natural language understanding on the query information input by the user; on the other hand, can determine the dialogue strategy for the query information input by the user, which is conducive to improving the generation of response information that is more adaptable to the query information.
[0118] The embodiment of the present invention also provides a training device for a dialogue model. Figure 2 FIG. 5 is a schematic block diagram of a training device 500 for a dialogue model according to an embodiment of the present invention. Figure 2 As shown, the training device 500 includes: a dialogue configuration information acquisition module 510, a dialogue configuration file generation module 520, and a model training module 530.
[0119] The dialogue configuration information acquisition module is used to obtain the dialogue configuration information of each dialogue configuration file corresponding to the dialogue configuration field in the storage information, and save it to the dialogue configuration file, wherein the storage information stores multiple dialogue configuration fields and the dialogue configuration information corresponding to each dialogue configuration field. The dialogue configuration file generation module is used to generate the dialogue configuration file according to the dialogue configuration information corresponding to each dialogue configuration file. The model training module is used to train the dialogue model based on all the saved dialogue configuration files.
[0120] Exemplarily, the conversation configuration file includes a first configuration file, the first configuration file includes multiple text areas, wherein each text area is used to store a group of corresponding conversation configuration information, and each group of corresponding conversation configuration information is associated and stored in the storage information.
[0121] The dialog configuration file generating module 520 includes: a first configuration file obtaining module.
[0122] The first configuration file obtaining module is used to fill blank text areas in the first configuration file text area by text area based on the dialog configuration information of the dialog configuration field corresponding to each first configuration file, so as to obtain the first configuration file.
[0123] Exemplarily, the first configuration file is a dialog rule file, and the dialog configuration fields corresponding to the dialog rule file include: an intent field, a form field, and an action function field.
[0124] The dialog configuration information acquisition module 510 includes: a first intention configuration information reading module and a second intention configuration information reading module.
[0125] The first intent configuration information reading module is used to read the intent configuration information of the intent field in the storage information.
[0126] The second intention configuration information reading module is used to read the form information of the form field associated with the intent configuration information and the action function information of the action function field associated with the intent configuration information in the storage information based on each intent configuration information read, wherein the form information includes at least one slot to be filled, and the action function information is used to save the identifier of the preset data processing flow.
[0127] Exemplarily, the training device 500 further includes: a data processing flow acquisition module.
[0128] The data processing flow acquisition module is used to fill in the preset function framework corresponding to each action function information based on the execution condition information and response content information corresponding to the action function information in the storage information, so as to obtain the data processing flow corresponding to the action function information, wherein the execution condition information is used to save the execution conditions in the data processing flow, and the response content information is used to save the response content of the dialogue model in the data processing flow.
[0129] Exemplarily, the execution condition information includes first verification condition information.
[0130] The above data processing flow includes: verifying whether the slot value to be filled into the slot meets the first verification condition information corresponding to the slot, and determining whether to fill the slot value into the slot according to the verification result.
[0131] The training device 500 further includes: a first module.
[0132] The first module is used to determine, for each slot in each form information, first verification condition information corresponding to the slot identifier in the storage information based on the slot identifier corresponding to the slot.
[0133] Exemplarily, the above data processing process includes: verifying whether the slot value to be filled in the slot meets the first verification condition information corresponding to the slot, and deleting or updating the slot value of the slot according to the verification result, wherein the slot is the slot in the form information corresponding to the data processing process.
[0134] The training device 500 further includes: a second module.
[0135] The second module is used to determine, for each slot in each form information, first verification condition information corresponding to the slot identifier in the storage information based on the slot identifier corresponding to the slot.
[0136] Exemplarily, the execution condition information includes second verification condition information, and the response content information includes filling guide information.
[0137] The data processing process includes: verifying whether the slot meets the second verification condition information corresponding to the slot, and determining whether to generate filling guidance information corresponding to the slot based on the verification result, the filling guidance information is used to save the text responded by the dialogue model in the data processing process and used to guide the filling of the slot, wherein the slot is the slot in the form information corresponding to the data processing process.
[0138] The training device 500 further includes: a third module.
[0139] The third module is used to determine, for each slot in each form information, based on the slot identifier corresponding to the slot, the second verification condition information and the filling guide information respectively corresponding to the slot identifier in the storage information.
[0140] Exemplarily, the dialogue model includes a natural language processing module and a dialogue management module, and the dialogue configuration file includes a natural language processing configuration file, a response content file, a dialogue rule file, and a dialogue domain file.
[0141] The model training module 530 includes: a first training module and a second training module.
[0142] The first training module is used to train the natural language processing module based on a natural language processing configuration file, wherein the natural language processing configuration file is generated according to the intent configuration information of the intent field in the dialogue configuration field.
[0143] The second training module is used to train the dialogue management module based on the response content file, the dialogue rule file and the dialogue domain file, wherein the response content file is generated based on the response content information of the response field in the dialogue configuration field, the dialogue rule file is generated based on the intent configuration information, the form information of the form field in the dialogue configuration field and the action function information of the action function field in the dialogue configuration field, and the dialogue domain file is generated according to the dialogue configuration information corresponding to all the dialogue configuration fields.
[0144] According to another aspect of the present invention, an electronic device is also provided. Figure 3 FIG. 6 shows a schematic block diagram of an electronic device 600 according to an embodiment of the present invention. Figure 3 As shown, the electronic device 600 includes a processor 610 and a memory 620, in which a computer program is stored. When the computer program instructions are run by the processor 610, they are used to execute the above-mentioned training method of the dialogue model.
[0145] In addition, according to another aspect of the present invention, a storage medium is provided, on which program instructions are stored, and when the program instructions are executed by a computer or a processor, the computer or the processor executes the corresponding steps of the training method of the above-mentioned dialogue model according to the embodiment of the present invention, and is used to implement the corresponding modules in the training device of the above-mentioned dialogue model according to the embodiment of the present invention or the corresponding modules in the above-mentioned electronic device. The storage medium may include, for example, a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a USB memory, or any combination of the above storage media. The computer-readable storage medium may be any combination of one or more computer-readable storage media. According to another aspect of the present invention, a computer program product is provided, including computer program instructions, and when the computer program instructions are executed by a computer or a processor, the computer or the processor executes the corresponding steps of the training method of the above-mentioned dialogue model.
[0146] A person skilled in the art may understand the specific implementation scheme of the above-mentioned electronic device and storage medium by reading the above-mentioned description of the training method of the dialogue model, and for the sake of brevity, it will not be described here.
[0147] Although example embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above example embodiments are merely exemplary and are not intended to limit the scope of the present invention thereto. Various changes and modifications may be made therein by one of ordinary skill in the art without departing from the scope and spirit of the present invention. All such changes and modifications are intended to be included within the scope of the present invention as required by the appended claims.
[0148] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0149] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.
[0150] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0151] Similarly, it should be understood that in order to streamline the present invention and help understand one or more of the various inventive aspects, in the description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, the method of the present invention should not be interpreted as reflecting the following intention: the claimed invention requires more features than the features explicitly stated in each claim. More specifically, as reflected in the corresponding claims, the inventive point is that the corresponding technical problem can be solved with less than all the features of a single disclosed embodiment. Therefore, the claims following the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present invention.
[0152] It will be understood by those skilled in the art that, except for mutually exclusive features, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this specification may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature that provides the same, equivalent or similar purpose.
[0153] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims, any one of the claimed embodiments may be used in any combination.
[0154] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some modules in the training device for the dialogue model according to an embodiment of the present invention. The present invention may also be implemented as a device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0155] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
[0156] The above is only a specific embodiment of the present invention or an explanation of a specific embodiment. The protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. The protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for training a dialogue model, characterized in that: The method comprises: For each conversation configuration field corresponding to each conversation configuration file, the conversation configuration information of the conversation configuration field is obtained from the storage information, wherein the storage information stores a plurality of conversation configuration fields and the conversation configuration information corresponding to each conversation configuration field; Generate the conversation configuration file according to the conversation configuration information corresponding to each conversation configuration file; Based on all the conversation profiles, train the conversation model.
2. The method according to claim 1, characterized in that The dialog configuration file includes a first configuration file, the first configuration file includes a plurality of text areas, wherein each text area is used to store a group of dialog configuration information having a corresponding relationship, and each group of dialog configuration information having a corresponding relationship is associated and stored in the storage information; The step of generating the dialog configuration file according to the dialog configuration information corresponding to each dialog configuration file comprises: For each dialog configuration field corresponding to each first configuration file, the blank text area in the first configuration file is filled text area by text area based on the dialog configuration information of the dialog configuration field to obtain the first configuration file.
3. The method according to claim 2, characterized in that The first configuration file is a dialog rule file, and the dialog configuration fields corresponding to the dialog rule file include: an intent field, a form field, and an action function field. The step of acquiring the dialog configuration information of the dialog configuration field corresponding to each dialog configuration file from the storage information includes: Read the intent configuration information of the intent field in the storage information; Based on each intent configuration information read, the form information of the form field associated with the intent configuration information and the action function information of the action function field associated with the stored intent configuration information are read in the storage information, wherein the form information includes at least one slot to be filled, and the action function information is used to save the identifier of the preset data processing flow.
4. The method according to claim 1, characterized in that The method further comprises: For each action function information, based on the execution condition information and response content information respectively corresponding to the action function information in the storage information, fill in the preset function framework corresponding to the action function information to obtain the data processing flow corresponding to the action function information, wherein the execution condition information is used to save the execution condition in the data processing flow, and the response content information is used to save the response content of the dialogue model in the data processing flow.
5. The method according to claim 4, characterized in that The execution condition information includes first verification condition information, The data processing flow includes: Verify whether the slot value to be filled into the slot meets the first verification condition information corresponding to the slot, and determine whether to fill the slot value into the slot according to the verification result; or verify whether the slot value to be filled into the slot meets the first verification condition information corresponding to the slot, and delete or update the slot value of the slot according to the verification result, wherein the slot is a slot in the form information corresponding to the data processing flow; The method further comprises: For each slot in each form information, based on the slot identifier corresponding to the slot, the first verification condition information corresponding to the slot identifier is determined in the storage information.
6. The method according to claim 4, characterized in that The execution condition information includes second verification condition information, and the response content information includes filling guide information. The data processing flow includes: Verifying whether the slot meets the second verification condition information corresponding to the slot, and determining whether to generate filling guide information corresponding to the slot according to the verification result, wherein the filling guide information is used to store text responded by the dialogue model in the data processing flow and used to guide filling in the slot, wherein the slot is a slot in the form information corresponding to the data processing flow; The method further comprises: For each slot in each form information, based on the slot identifier corresponding to the slot, the second verification condition information and the filling guide information respectively corresponding to the slot identifier are determined in the storage information.
7. The method according to claim 1, characterized in that The dialogue model includes a natural language processing module and a dialogue management module, and the dialogue configuration file includes a natural language processing configuration file, a response content file, a dialogue rule file, and a dialogue domain file; The dialog model is trained based on all dialog configuration files, including: Training the natural language processing module based on a natural language processing configuration file, wherein the natural language processing configuration file is generated according to the intent configuration information of the intent field in the dialogue configuration field; The dialogue management module is trained based on the response content file, the dialogue rule file and the dialogue domain file, wherein the response content file is generated based on the response content information of the response field in the dialogue configuration field, the dialogue rule file is generated based on the intention configuration information, the form information of the form field in the dialogue configuration field and the action function information of the action function field in the dialogue configuration field, and the dialogue domain file is generated according to the dialogue configuration information corresponding to all the dialogue configuration fields.
8. A training device for a dialogue model, characterized in that: The device comprises: A dialog configuration information acquisition module, for acquiring the dialog configuration information of each dialog configuration field corresponding to each dialog configuration file from the storage information, and saving it to the dialog configuration file, wherein the storage information stores a plurality of dialog configuration fields and the dialog configuration information corresponding to each dialog configuration field; A dialog configuration file generation module, used to generate the dialog configuration file according to the dialog configuration information corresponding to each dialog configuration file; The model training module is used to train the dialogue model based on all saved dialogue configuration files.
9. An electronic device, characterized in that: It comprises a memory and a processor, wherein: the memory is used to store a computer program; the processor is used to execute the computer program to implement the training method of the dialogue model as described in any one of claims 1-7.
10. A storage medium storing a computer program / instruction, characterized in that: The computer program / instructions are used to execute the method for training a dialogue model as described in any one of claims 1 to 7 when running.