Multi-round dialogue data generation method and device, storage medium and electronic equipment
Through the combination of configuration files and large language models, high-quality multi-round dialogue data is generated, which solves the problem of low quality of multi-round dialogue data in the existing technology, and improves the intelligence and adaptability of the dialogue system.
Patent Information
- Application Number
- CN202311314806.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-11
- Publication Date
- 2025-04-18
AI Technical Summary
The multi-round dialogue data obtained by the prior art is mixed with a lot of noise, and the dialogue content is not comprehensive and the form is not standardized, resulting in low data quality and a more intelligent and humanized large language model cannot be trained.
By obtaining the configuration files required to generate multiple rounds of conversation data, reading the configuration information of each round of conversation, using the first largest language model to generate question information, and the second largest language model to generate reply information, recording each round of conversation data generated, forming a high-quality multi-round conversation data set.
It has achieved multi-round dialogue data generation without noise, comprehensive dialogue content and standardized forms, expanded high-quality multi-round dialogue data sets, improved the quality and diversity of multi-round dialogue data, and enhanced the adaptability and intelligence of dialogue systems.
Smart Images

Figure CN119848177A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, storage medium and electronic device for generating multi-round conversation data. Background Art
[0002] With the continuous development of artificial intelligence (AI) technology, large language models have become an important technology in the field of natural language processing. Large language models can be used to achieve single-round dialogue with users and meet single-round dialogue capabilities, while large language models' multi-round dialogue capabilities are crucial for users' later use.
[0003] In order to realize the multi-round dialogue capability of the large language model, multi-round dialogue data is needed as training samples to train the large language model. Currently, the dialogue data between users can be obtained on the Internet and multi-round dialogue data can be screened out. However, the multi-round dialogue data obtained in this way will be mixed with a lot of noise, and the dialogue content is not comprehensive enough and the form is not standardized enough, which will result in low quality of multi-round dialogue data, and thus it is impossible to use these data to train a more intelligent and humanized large language model. Summary of the invention
[0004] In view of this, the present application provides a method, device, storage medium and electronic device for generating multi-round conversation data, the main purpose of which is to improve the technical problems that the multi-round conversation data obtained by the current existing technology is mixed with a lot of noise, and the conversation content is not comprehensive enough and the format is not standardized enough.
[0005] In a first aspect, the present application provides a method for generating multi-round dialogue data, comprising:
[0006] Get the configuration file required to generate multi-round dialogue data;
[0007] Reading configuration information of each round of dialogue from the configuration file, wherein the configuration information of other rounds of dialogue except the first round of dialogue includes requirement information for generating the content of the current round of dialogue based on the content of the previous round of dialogue;
[0008] Based on the configuration information of each round of dialogue, using the first language model and the second language model in sequence to generate each round of dialogue data, wherein the first language model is used to generate question information of each round of dialogue data, and the second language model is used to generate reply information corresponding to the question information;
[0009] Each round of dialogue data generated in sequence is recorded to obtain the multiple rounds of dialogue data.
[0010] In a second aspect, the present application provides a device for generating multi-round conversation data, comprising:
[0011] An acquisition module, configured to acquire a configuration file required to generate multi-round dialogue data;
[0012] A reading module is configured to read configuration information of each round of dialogue from the configuration file, wherein the configuration information of other rounds of dialogue except the first round of dialogue includes requirement information for generating the content of the current round of dialogue based on the content of the previous round of dialogue;
[0013] a generating module configured to use the first language model and the second language model to sequentially generate each round of dialogue data based on the configuration information of each round of dialogue, wherein the first language model is used to generate question information of each round of dialogue data, and the second language model is used to generate reply information corresponding to the question information;
[0014] The recording module is configured to record each round of dialogue data generated in sequence to obtain the multiple rounds of dialogue data.
[0015] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for generating multi-round dialogue data described in the first aspect is implemented.
[0016] In a fourth aspect, the present application provides an electronic device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the method for generating multi-round conversation data as described in the first aspect when executing the computer program.
[0017] By means of the above technical scheme, the present application provides a method, device, storage medium and electronic device for generating multiple rounds of dialogue, specifically, obtaining a configuration file required for generating multiple rounds of dialogue data; then reading the configuration information of each round of dialogue from the configuration file, wherein the configuration information of other rounds of dialogue except the first round of dialogue includes the demand information for generating the content of the current round of dialogue based on the content of the previous round of dialogue; then based on the configuration information of each round of dialogue, using the first largest language model and the second largest language model to sequentially generate each round of dialogue data, wherein the first largest language model is used to generate question information for each round of dialogue data, and the second largest language model is used to generate reply information corresponding to the question information; recording each round of dialogue data generated sequentially to obtain the multiple rounds of dialogue data. Compared with the current existing technology, this application sets predefined configuration information for the large language model, allowing different large language models to generate and reply dialogues, and obtains noise-free multi-round dialogue data with comprehensive dialogue content and standardized form, thereby expanding a high-quality multi-round dialogue data set with diversity and wide coverage of scenarios. The efficiency of multi-round dialogue data generation can be improved, and the performance of multi-round dialogue systems can be improved when data is scarce and scene coverage is insufficient, the quality and diversity of multi-round dialogue data can be improved, and the adaptability and intelligence of dialogue systems can be enhanced. By constructing different multi-round dialogue data for different types of multi-round dialogues and meeting different types of data requirements, the performance and effect of multi-domain dialogue systems can be improved, and these data can be used to train more intelligent and humanized large language models in the future.
[0018] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] 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.
[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0021] Figure 1 A schematic diagram showing a flow chart of a method for generating multi-round conversation data provided by an embodiment of the present application;
[0022] Figure 2A schematic diagram showing a flow chart of a method for generating multi-round conversation data provided by an embodiment of the present application;
[0023] Figure 3 A schematic diagram of an example structure provided by an embodiment of the present application is shown;
[0024] Figure 4 A schematic diagram of an example process provided by an embodiment of the present application is shown;
[0025] Figure 5 A schematic diagram of the structure of a device for generating multi-round dialogue data provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0026] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0027] In order to improve the technical problems that the multi-round dialogue data obtained by the current existing technology is mixed with a lot of noise, the dialogue content is not comprehensive, and the format is not standardized. This embodiment provides a method for generating multi-round dialogue data, such as Figure 1 As shown, the method includes:
[0028] Step 101: Obtain a configuration file required to generate multi-round dialogue data.
[0029] In the embodiment of the present application, a multi-round dialogue can be a series of communication processes between a user and a robot in a dialogue system. In each round of dialogue, the user and the robot speak alternately, the user asks questions or requests, and the robot answers or performs corresponding operations based on the user's input. The multi-round dialogue can include processes such as asking questions, understanding context, and maintaining context. The purpose of multi-round dialogue is to achieve a more natural and smooth dialogue experience.
[0030] Optionally, the configuration file may include a type file for the multi-round dialogue, a data file required for the multi-round dialogue, a template file required for the multi-round dialogue, etc.
[0031] In the embodiment of the present application, the type file of the multi-round dialogue can be customized according to the data requirements of the multi-round dialogue data set to be constructed (such as multi-round dialogues in which topics in different fields are narrated from different angles), and the specific type of each round of dialogue contained in the type file of the multi-round dialogue is not specifically limited in the embodiment of the present application. For example, if the demand for obtaining data is to improve the richness of data, the specific types contained in the type file of the multi-round dialogue can be type A corresponding to the first round, type B corresponding to the second round, type C corresponding to the third round, and type D corresponding to the fourth round; correspondingly, if the demand for obtaining data is to increase the amount of type A data, the specific types contained in the type file of the multi-round dialogue can be type A corresponding to the first round, type A corresponding to the second round, type A corresponding to the third round, and type A corresponding to the fourth round, and no further examples are given here.
[0032] In the embodiment of the present application, the data files required for conducting multiple rounds of dialogue and the template files required for conducting multiple rounds of dialogue can also be obtained in the form of input files.
[0033] Step 102: Read the configuration information of each round of dialogue from the configuration file.
[0034] The configuration information of other rounds of dialogue except the first round of dialogue includes the requirement information for generating the content of the current round of dialogue based on the content of the previous round of dialogue.
[0035] In an embodiment of the present application, the configuration information of the first round of dialogue may include type information of multiple rounds of dialogue, data information required for multiple rounds of dialogue, and template information required for multiple rounds of dialogue.
[0036] Optionally, configuration information of other rounds of dialogue except the first round of dialogue needs to be generated based on the previous round of dialogue.
[0037] Step 103: Based on the configuration information of each round of dialogue, the first language model and the second language model are used to sequentially generate each round of dialogue data.
[0038] The first language model is used to generate question information for each round of dialogue data, and the second language model is used to generate reply information corresponding to the question information.
[0039] In an embodiment of the present application, a large language model (LLM) is a deep learning model trained using a large amount of text data, which can generate natural language text or understand language text.
[0040] Optionally, question information for each round of dialogue data may be generated based on type information of multiple rounds of dialogues, data information required for multiple rounds of dialogues, and template information required for multiple rounds of dialogues.
[0041] In an embodiment of the present application, the reply information can be generated based on the data information required for multiple rounds of conversations.
[0042] Optionally, the first language model and the second language model can be a ChatGenerative Pre-trained Transformer (ChatGPT), a Wenxinyiyan knowledge-enhanced large language model, etc.
[0043] Step 104: Record each round of dialogue data generated in sequence to obtain multiple rounds of dialogue data.
[0044] Compared with the current existing technology, this embodiment does not need to manually write and construct multi-round dialogue data, which can save labor costs. This embodiment sets predefined configuration information for the large language model, allowing different large language models to generate and reply dialogues, and obtains noise-free, comprehensive dialogue content and standardized multi-round dialogue data, thereby expanding a high-quality multi-round dialogue data set with diversity and wide coverage of scenarios, which can improve the efficiency of multi-round dialogue data generation, and can improve the performance of the multi-round dialogue system in the case of data scarcity and insufficient scene coverage, improve the quality and diversity of multi-round dialogue data, enhance the adaptability and intelligence of the dialogue system, and construct different multi-round dialogue data for different types of multi-round dialogues to meet different types of data requirements. The performance and effect of the multi-domain dialogue system can be improved, and these data can be used to train a more intelligent and humanized large language model in the future.
[0045] Further, as a refinement and extension of the above embodiment, in order to fully illustrate the specific implementation process of the method of this embodiment, this embodiment provides the following Figure 2 The specific method shown includes:
[0046] Step 201: Obtain a configuration file required to generate multi-round dialogue data.
[0047] In the embodiment of the present application, the configuration file may include a type file of a multi-round dialogue, a data file required for a multi-round dialogue, a template file required for a multi-round dialogue, etc. Correspondingly, the data file required for a multi-round dialogue and the template file required for a multi-round dialogue may also be obtained in the form of an input file.
[0048] Exemplarily, if the configuration file required to generate multi-round dialogue data is configuration file A, configuration file A includes the type file of the multi-round dialogue, the data files required for the multi-round dialogue, and the template files required for the multi-round dialogue; the configuration file and input file required to generate multi-round dialogue data can also be obtained, for example, configuration file A includes the type file of the multi-round dialogue, and input file B includes the data files required for the multi-round dialogue and the template files required for the multi-round dialogue.
[0049] Step 202: Read configuration information for each round of dialogue from the configuration file.
[0050] The configuration information of other rounds of dialogue except the first round of dialogue includes the requirement information for generating the content of the current round of dialogue based on the content of the previous round of dialogue.
[0051] In an embodiment of the present application, the configuration information of the first round of dialogue may include type information of multiple rounds of dialogue, data information required for multiple rounds of dialogue, and template information required for multiple rounds of dialogue.
[0052] Exemplarily, based on step 201, the configuration information of the first round of dialogue may be type information of multiple rounds of dialogue, data information required for multiple rounds of dialogue, and template information required for multiple rounds of dialogue read from configuration file A.
[0053] Accordingly, the configuration information of other rounds of dialogue except the first round needs to be generated based on the previous round of dialogue.
[0054] Step 203: For the generation process of each round of dialogue data except the first round of dialogue, the question requirement information and the reply requirement information of the current round of dialogue are obtained from the configuration information of the current round of dialogue.
[0055] The question demand information is the question demand information for generating the current round of dialogue content based on the previous round of dialogue content, and the reply demand information includes the reply demand information corresponding to the question demand information;
[0056] Optionally, step 203 may specifically include: determining the multi-round type of the current round of dialogue from the configuration information of the current round of dialogue; obtaining question template information and reply template information corresponding to the multi-round type; filling in the question template information and the reply template information according to the content of the previous round of dialogue to obtain the question requirement information and the reply requirement information.
[0057] For this embodiment, different multi-round types may have their own corresponding question template information and reply template information. For example, the question template information of the current round of dialogue may include "Based on the given dialogue text {i.e., the previous round of dialogue text}, it is necessary to generate the questions for the next round of this group of dialogues, requirements: N1, N2, N3... Please ask questions:". Among them, "Based on the given dialogue text {i.e., the previous round of dialogue text}, it is necessary to generate the questions for the next round of this group of dialogues" may be a specific sentence pattern in the question template information, in which the dialogue text content needs to be filled in according to the content of the previous round of dialogue; and for these requirements such as N1, N2, N3, etc., they can be set according to the question template information corresponding to different multi-round types.
[0058] In some embodiments, the question template information may include specific question requirement information corresponding to the multi-round type of the current round of dialogue. For example, if the multi-round type of the current round of dialogue is referential multi-round, then the specific question requirement information corresponding to the referential multi-round may be "ask a simple question that has a clear referential relationship with the keywords in the previous round of dialogue, and the keywords are replaced with referential words. It is easy to understand and has M (such as 10 or 15, etc.) words or less." In addition, the question template information may also include general question requirement information, which can be used to further improve the question content, such as "cannot ask questions about subjective feelings" and "cannot apologize". Correspondingly, the reply template information may include specific reply requirement information and general reply requirement information corresponding to the multi-round type of the current round of dialogue.
[0059] Correspondingly, the above-mentioned filling in the question template information and the reply template information according to the content of the previous round of dialogue to obtain the question requirement information and the reply requirement information may specifically include: filling in the dialogue text in the question template information according to the content of the previous round of dialogue to obtain the first sentence that needs to be asked based on the dialogue text, and combining the first sentence with the specific question requirement information and the general question requirement information to obtain the question requirement information; and combining the second sentence used for question reply in the reply template information with the specific reply requirement information and the general reply requirement information to obtain the reply requirement information.
[0060] Exemplarily, a question template of a multi-round type (inherited multi-round) may include: "Based on the given dialogue text (i.e., the dialogue text of the previous round), it is necessary to generate the statement or question of the next round of this dialogue, with the following requirements: 1. {Please ask a simple question related to this dialogue (i.e., the previous dialogue) within 10 words}; 2. You cannot ask questions about subjective feelings; 3. You cannot apologize; please ask questions." In this template, "Based on the given dialogue text, it is necessary to generate the statement or question of the next round of this dialogue" plus the following "Please ask questions" can be considered as the first sentence, and the given dialogue text needs to be filled in according to the content of the previous dialogue. In addition, it also includes the question requirements of these three dimensions. Question requirement 1 is a specific question requirement corresponding to inherited multi-rounds, and question requirements 2 and 3 are general question requirements. The first sentence is combined with the specific question requirement information and the general question requirement information to obtain the question requirement information of this dialogue, and this question requirement information is input into the first language model, and then the corresponding question information can be generated according to these requirements.
[0061] For example, a reply template for a multi-round type (multi-round error correction) may include: "Reply to the questions raised, requirements: 1. {Reply to the questions raised, and reply with the correct viewpoint}; 2. Do not reply to content about subjective feelings; 3. Do not apologize; please reply." In this template, "Reply to the questions raised" plus the following "Please reply" can be considered as the second sentence. In addition, it also includes reply requirements in these three dimensions. Reply requirement 1 is a specific reply requirement corresponding to the multi-round error correction, while reply requirements 2 and 3 are general reply requirements. The second sentence is combined with the specific reply requirement information and the general reply requirement information to obtain the reply requirement information of this round of dialogue. This reply requirement information and the question information (obtained from the first language model) are input into the second language model, and then the corresponding reply information can be generated according to these requirements.
[0062] Optionally, step 203 specifically also includes: using a first prompt text obtained by filling in the question template information as the question requirement information; and using a second prompt text obtained by filling in the reply template information as the reply requirement information.
[0063] Optionally, the method of this embodiment also includes: for the generation process of the first round of dialogue data, obtaining preset question requirement information and preset reply requirement information of the first round of dialogue from the configuration information of the first round of dialogue; based on the preset question requirement information, using the first largest language model to generate the question information of the first round of dialogue; based on the question information of the first round of dialogue and the preset reply requirement information, using the second largest language model to generate the reply information of the first round of dialogue.
[0064] Among them, the preset question demand information is the question demand information in the field corresponding to the keywords in the first round of dialogue, or the question demand information corresponding to the hot topics, and the preset reply demand information is the reply demand information for replying to the questions corresponding to the preset question demand information.
[0065] For example, if there are keywords in the first round of dialogue, the corresponding question demand information can be set according to the field corresponding to the keyword to generate multi-round dialogue data with topics in different fields, thereby improving the quality of multi-round dialogue data. If there are no keywords in the first round of dialogue, then some hot topics can be referred to and the corresponding question demand information can be set to meet the diversity of the generated multi-round dialogue data.
[0066] In the embodiments of the present application, Figure 3 As shown in Figure 1, multi-round conversations can include three types: deep conversation, wide conversation, and conversation evaluation. These three conversation types can summarize nearly 90% of multi-round conversations.
[0067] Optionally, deep conversations are questions and responses that focus on a topic or field. Deep conversation rounds can be divided into successive rounds and referential rounds. Successive rounds ask related questions based on the content of the previous round, and referential rounds ask questions about keywords in the previous round of conversations and use pronouns to refer to keywords to ask questions.
[0068] Optionally, the breadth dialogue can be conducted around multiple topics across multiple fields. The questions generated for the breadth dialogue can be completely unrelated to the previous round or can be questions in a different field from the previous round.
[0069] Optionally, the evaluation round is to evaluate and generate the previous round, which is mainly divided into three types, namely affirmation round, expansion round, and correction round. The affirmation round is to give a positive evaluation to the model's response. The expansion round is to ask further questions to the model in the previous round of responses. The questions can be based on the detailed development of the content of the previous round, or they can be the expected summary description of the above content. The correction round is mainly to correct the model's response. The correction round can be divided into true correction and false correction. True correction means that the model gives an incorrect response. After the user asks questions through questioning, the model gives the correct response and appeases. False correction means that the model's response is correct, but the user questions the model's response and may give reasons. The model needs to give a further correct response and appease.
[0070] In an embodiment of the present application, the large model prompt can be the initial prompt or instruction given when using a pre-trained large language model to generate a task. This prompt can be a question, a text description, a sentence, or a complete conversation context. The role of the large model prompt is to guide the generation model to generate text output related to the given prompt. By giving a specific prompt, the output of the generation model can be more accurately controlled and influenced to meet the user's expectations and needs. The large model prompt is widely used in natural language processing tasks such as task-based dialogue, summary generation, and machine translation.
[0071] Step 204: Based on the questioning requirement information, the first language model is used to generate questioning information for the current round of dialogue.
[0072] Optionally, step 204 may specifically include: inputting the first prompt text and the content of the previous round of dialogue into the first large language model for calculation to generate question information for the current round of dialogue.
[0073] Step 205: Based on the question information and reply requirement information of the current round of dialogue, the second largest language model is used to generate reply information of the current round of dialogue.
[0074] Optionally, step 205 may specifically include: inputting the second prompt text and the question information of the current round of dialogue into the second largest language model for calculation to generate reply information of the current round of dialogue.
[0075] Exemplarily, as shown in Table 1, if the first largest language model is large language model a and the second largest language model is large language model b, the first round of dialogue can determine that the current multi-round dialogue type is inherited multi-round based on the configuration information.
[0076] Table 1
[0077]
[0078] Correspondingly, by filling in the first round of templates based on the configuration information, it can be determined that the question information of the large language model a is "Is AA a city?" According to the question information of the large language model a, the large language model b can obtain the reply information "AA is a city in country 1".
[0079] For example, based on the above-mentioned first round of dialogue and configuration file, the question requirement information for generating the next round of dialogue can be obtained as "ask a simple question related to the previous round of dialogue, within 10 words". According to the question requirement information, the large language model a can generate question information such as "What is the weather like in AA city?" or "What attractions are there in AA city?" or "What delicacies are there in AA city?" or "What cultural customs are there in AA city?" and so on.
[0080] For example, in this round, the large language model a generates the question information "What is the weather like in city AA?", and the large language model b can get the response information "The weather in city AA is sunny, and the temperature is BB."
[0081] Exemplarily, as shown in Table 2, if the first largest language model is large language model a and the second largest language model is large language model b, the first round of dialogue can determine that the current multi-round dialogue type is inherited multi-round based on the configuration information.
[0082] Table 2
[0083]
[0084] Correspondingly, by filling in the first round of templates based on the configuration information, it can be determined that the question information of the large language model a is "Is AA a city?" According to the question information of the large language model a, the large language model b can obtain the reply information "AA is a city in country 1".
[0085] For example, based on the above-mentioned first round of dialogue and configuration file, the question requirement information used to generate the next round of dialogue can be obtained as "ask any question". According to the question requirement information, the large language model a can generate question information such as "which country's mountain CC is" or "how many people are there in country 2" or "who is the author of article DD" or "who sings the song EE", etc.
[0086] For example, in this round, the large language model a generates the question information as "CC is the peak of which country", and the large language model b can get the response information as "CC is the peak of country 3".
[0087] It can be seen that by setting multiple rounds of exclusive prompt texts, providing content in the prompt to guide the direction of the next round of dialogue, and giving certain restrictions, the model will generate inherited questions.
[0088] Optionally, the prompt for referring to multiple rounds can be designed as: "Based on the given human-computer dialogue, I need you to generate questions for the next round of this dialogue. Requirements: 1. Propose a simple question that has a clear reference relationship with the keywords in the previous round of dialogue, with the keywords replaced by pronouns and easy to understand, within 10 words. Please ask the question:"
[0089] Exemplarily, as shown in Table 3, if the first largest language model is large language model a and the second largest language model is large language model b, the first round of dialogue can determine that the current multi-round dialogue type is referring to multiple rounds based on the configuration information.
[0090] Table 3
[0091]
[0092]
[0093] Correspondingly, by filling in the first round of templates based on the configuration information, it can be determined that the question information of the large language model a is "Is AA a city?" According to the question information of the large language model a, the large language model b can obtain the reply information "AA is a city in country 1".
[0094] Exemplarily, based on the above-mentioned first round of dialogue and configuration file, the question requirement information for generating the next round of dialogue can be obtained as "ask a simple question that has a clear referential relationship with the keywords in the previous round of dialogue, with the keywords replaced by pronouns and easy to understand, within 10 words". According to the question requirement information, the large language model a can generate question information such as "Is AA the capital of country 1?" or "What is the population of city AA?" or "What are the cities adjacent to AA?" or "Is city AA a coastal city?" and so on.
[0095] For example, in this round, the large language model a generates the question information "Is AA the capital of country 1?", and the large language model b can get the response information "Yes, AA is the capital of country 1".
[0096] It can be seen that in the embodiment of the present application, according to the limited prompt, the model can well inherit the previous topic and can use pronouns to refer to the keywords of the previous round, which is more in line with the spoken habits of humans during conversations and appears to be more intelligent. However, without a limited prompt, there is only a simple inheritance relationship, and it is more like a single-round conversation, which is a simple knowledge acquisition and lacks interactivity.
[0097] Therefore, the principle of prompt design is to limit the prompt to a finite set of statements based on the multi-round definition, to ensure that there are both diverse generalized sentences and data that meet the requirements. Based on the multi-round dialogue system, the general prompt template that can be used can be: "Based on the given human-computer dialogue {human-computer dialogue text}, I need you to generate the next round of statements or questions for this set of dialogues, with the following requirements: {specific multi-round requirements}, no questions about subjective feelings, no apologies. Please ask questions:" When the prompt design for all multi-round scenarios is completed, you only need to output the multi-round requirements to generate diverse data in a configurable manner.
[0098] Step 206: Record each round of dialogue data generated in sequence to obtain multiple rounds of dialogue data.
[0099] For example, Figure 4The following is a flowchart of an example. The large language model first reads the configuration file, and uses the configuration file to determine whether the multi-round scenario is in the existing multi-round configuration. If not, it displays an abnormal end; if it is, it determines the specific type of multi-round dialogue, constructs the next round of data based on the type of multi-round dialogue and the multi-round dialogue prompt, and so on, and records each round of dialogue until all configuration files are processed.
[0100] Compared with the current existing technology, this embodiment sets predefined different multi-round types and prompts for the large language model, allowing different large language models to generate and reply dialogues, and obtains noise-free multi-round dialogue data with comprehensive dialogue content and standardized form, thereby expanding a high-quality multi-round dialogue data set with diversity and wide coverage of scenarios. It can improve the performance of the multi-round dialogue system when data is scarce and scenario coverage is insufficient, improve the quality and diversity of multi-round dialogue data, enhance the adaptability and intelligence of the dialogue system, and construct different multi-round dialogue data for different types of multi-round dialogues to meet different types of data requirements. The performance and effect of the multi-domain dialogue system can be improved, and these data can be used to train a more intelligent and humanized large language model in the future.
[0101] Further, as Figure 1 The specific implementation of the method shown in the embodiment provides a device for generating multi-round dialogue data, such as Figure 5 As shown, the device includes: an acquisition module 31, a reading module 32, a generation module 33, and a recording module 34.
[0102] An acquisition module 31 is configured to acquire a configuration file required to generate multi-round dialogue data;
[0103] The reading module 32 is configured to read the configuration information of each round of dialogue from the configuration file, wherein the configuration information of other rounds of dialogue except the first round of dialogue includes the requirement information for generating the content of the current round of dialogue based on the content of the previous round of dialogue;
[0104] A generating module 33 is configured to use the first language model and the second language model to sequentially generate each round of dialogue data based on the configuration information of each round of dialogue, wherein the first language model is used to generate question information of each round of dialogue data, and the second language model is used to generate reply information corresponding to the question information;
[0105] The recording module 34 is configured to record each round of dialogue data generated in sequence to obtain the multiple rounds of dialogue data.
[0106] In a specific application scenario, the generation module 33 is specifically configured to obtain the question requirement information and reply requirement information of the current round of dialogue from the configuration information of the current round of dialogue for the generation process of each round of dialogue data except the first round of dialogue, wherein the question requirement information is the question requirement information for generating the content of the current round of dialogue based on the content of the previous round of dialogue, and the reply requirement information includes reply requirement information corresponding to the question requirement information; based on the question requirement information, the first largest language model is used to generate the question information of the current round of dialogue; based on the question information and the reply requirement information of the current round of dialogue, the second largest language model is used to generate the reply information of the current round of dialogue.
[0107] In a specific application scenario, the generation module 33 is further configured to determine the multi-round type of the current round of dialogue from the configuration information of the current round of dialogue; obtain the question template information and the reply template information corresponding to the multi-round type; fill in the question template information and the reply template information according to the content of the previous round of dialogue, and obtain the question requirement information and the reply requirement information.
[0108] In a specific application scenario, the question template information includes specific question requirement information and general question requirement information corresponding to the multiple round types, and the reply template information includes specific reply requirement information and general reply requirement information corresponding to the multiple round types; accordingly, the generation module 33 is also specifically configured to fill in the specific question requirement information in the question template information according to the content of the previous round of conversation, and combine the general question requirement information to obtain the question requirement information; and, fill in the specific reply requirement information in the reply template information according to the content of the previous round of conversation, and combine the general reply requirement information to obtain the reply requirement information.
[0109] In a specific application scenario, the generation module 33 is further configured to use the first prompt text obtained by filling in the question template information as the question requirement information; and, use the second prompt text obtained by filling in the reply template information as the reply requirement information.
[0110] In a specific application scenario, the generation module 33 is further configured to input the first prompt text and the content of the previous round of dialogue into the first large language model for calculation to generate the question information of the current round of dialogue; input the second prompt text and the question information of the current round of dialogue into the second large language model for calculation to generate the reply information of the current round of dialogue.
[0111] In a specific application scenario, the generation module 33 is further configured to obtain preset question requirement information and preset reply requirement information of the first round of dialogue from the configuration information of the first round of dialogue during the generation process of the first round of dialogue data, wherein the preset question requirement information is the question requirement information in the field corresponding to the keywords in the first round of dialogue, or the question requirement information corresponding to the hot topics, and the preset reply requirement information is the reply requirement information for replying to the questions corresponding to the preset question requirement information; based on the preset question requirement information, the question information of the first round of dialogue is generated using the first largest language model; based on the question information of the first round of dialogue and the preset reply requirement information, the reply information of the first round of dialogue is generated using the second largest language model.
[0112] It should be noted that for other corresponding descriptions of the functional units involved in the device for generating multi-round dialogue data provided in this embodiment, reference can be made to Figure 1 to Figure 2 The corresponding description in will not be repeated here.
[0113] Based on the above Figure 1 to Figure 2 The method shown in the embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned Figure 1 to Figure 2 The method shown.
[0114] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0115] Based on the above Figure 1 to Figure 2 The method shown, and Figure 5 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides an electronic device, which can be configured on a vehicle (such as a new energy vehicle) or a server, etc. The device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 to Figure 2 The method shown.
[0116] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0117] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.
[0118] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
[0119] Through the description of the above implementation methods, the technicians in this field can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform, or by hardware. By applying the solution of this embodiment, compared with the current existing technology, this embodiment sets predefined different multi-round types and prompts for the large language model, allowing different large language models to generate and reply dialogues, and obtains noise-free, comprehensive dialogue content and standardized multi-round dialogue data, thereby expanding a high-quality multi-round dialogue data set with diversity and wide coverage of scenarios, which can improve the performance of the multi-round dialogue system in the case of data scarcity and insufficient scene coverage, improve the quality and diversity of multi-round dialogue data, enhance the adaptability and intelligence of the dialogue system, and construct different multi-round dialogue data for different types of multi-round dialogues to meet different types of data requirements. The performance and effect of the multi-domain dialogue system can be improved, and these data can be used to train a more intelligent and humanized large language model in the future.
[0120] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0121] The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features applied for herein.
Claims
1. A method for generating multi-round dialogue data, characterized in that: include: Get the configuration file required to generate multi-round dialogue data; Reading configuration information of each round of dialogue from the configuration file, wherein the configuration information of other rounds of dialogue except the first round of dialogue includes requirement information for generating the content of the current round of dialogue based on the content of the previous round of dialogue; Based on the configuration information of each round of dialogue, using the first language model and the second language model in sequence to generate each round of dialogue data, wherein the first language model is used to generate question information of each round of dialogue data, and the second language model is used to generate reply information corresponding to the question information; Each round of dialogue data generated in sequence is recorded to obtain the multiple rounds of dialogue data.
2. The method according to claim 1, characterized in that The step of sequentially generating each round of dialogue data using the first language model and the second language model based on the configuration information of each round of dialogue includes: For each round of dialogue data generation process except the first round of dialogue, the question requirement information and reply requirement information of the current round of dialogue are obtained from the configuration information of the current round of dialogue, wherein the question requirement information is the question requirement information for generating the current round of dialogue content based on the previous round of dialogue content, and the reply requirement information includes the reply requirement information corresponding to the question requirement information; According to the question demand information, the first language model is used to generate question information for the current round of dialogue; The second largest language model is used to generate reply information for the current round of dialogue according to the question information and the reply requirement information for the current round of dialogue.
3. The method according to claim 2, characterized in that The obtaining of the question requirement information and the answer requirement information of the current round of dialogue from the configuration information of the current round of dialogue includes: Determining the multi-round type of the current round of dialogue from the configuration information of the current round of dialogue; Acquire question template information and answer template information corresponding to the multiple round types; The question template information and the reply template information are filled in according to the content of the previous round of dialogue to obtain the question requirement information and the reply requirement information.
4. The method according to claim 3, characterized in that The question template information includes specific question requirement information and general question requirement information corresponding to the multi-round type, and the reply template information includes specific reply requirement information and general reply requirement information corresponding to the multi-round type; Filling in the question template information and the reply template information according to the content of the previous round of dialogue to obtain the question requirement information and the reply requirement information includes: Fill in the dialogue text in the question template information according to the content of the previous round of dialogue, obtain a first sentence that needs to be asked based on the dialogue text, and combine the first sentence with the specific question requirement information and the general question requirement information to obtain the question requirement information; and, The second sentence for replying to the question in the reply template information is combined with the specific reply requirement information and the general reply requirement information to obtain the reply requirement information.
5. The method according to claim 3, characterized in that: Filling in the question template information and the reply template information according to the content of the previous round of dialogue to obtain the question requirement information and the reply requirement information includes: Filling in the question template information to obtain the first prompt text as the question requirement information; and, The second prompt text obtained by filling in the reply template information is used as the reply requirement information.
6. The method according to claim 5, characterized in that The step of generating question information for the current round of dialogue using the first language model according to the question demand information includes: Inputting the first prompt text and the content of the previous round of dialogue into the first large language model for calculation to generate question information for the current round of dialogue; The step of using the second largest language model to generate the reply information of the current round of dialogue according to the question information of the current round of dialogue and the reply requirement information includes: The second prompt text and the question information of the current round of dialogue are input into the second largest language model for calculation to generate the reply information of the current round of dialogue.
7. The method according to claim 1, characterized in that The step of sequentially generating each round of dialogue data using the first language model and the second language model based on the configuration information of each round of dialogue includes: In the process of generating the first round of dialogue data, the preset question requirement information and the preset reply requirement information of the first round of dialogue are obtained from the configuration information of the first round of dialogue, wherein the preset question requirement information is the question requirement information in the field corresponding to the keywords in the first round of dialogue, or the question requirement information corresponding to the hot topics, and the preset reply requirement information is the reply requirement information for replying to the questions corresponding to the preset question requirement information; According to the preset question requirement information, the first language model is used to generate question information for a first round of dialogue; According to the question information of the first round of dialogue and the preset response requirement information, the response information of the first round of dialogue is generated using the second largest language model.
8. A device for generating multi-round dialogue data, characterized in that: include: An acquisition module, configured to acquire a configuration file required to generate multi-round dialogue data; A reading module is configured to read configuration information of each round of dialogue from the configuration file, wherein the configuration information of other rounds of dialogue except the first round of dialogue includes requirement information for generating the content of the current round of dialogue based on the content of the previous round of dialogue; a generating module configured to use the first language model and the second language model to sequentially generate each round of dialogue data based on the configuration information of each round of dialogue, wherein the first language model is used to generate question information of each round of dialogue data, and the second language model is used to generate reply information corresponding to the question information; The recording module is configured to record each round of dialogue data generated in sequence to obtain the multiple rounds of dialogue data.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.