Conversation content generation method and device, equipment, storage medium and program product

By obtaining the cognitive attribute information of the response object and constructing a dialogue dataset to inject the response model, answering irrelevant questions in the human-computer dialogue system is solved, and higher intelligence and dialogue effects are achieved.

CN119808942APending Publication Date: 2025-04-11BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411846155.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The existing human-computer dialogue system is prone to expose the base model information it uses during human-computer intelligent dialogue, resulting in the answer being irrelevant to the business background, affecting intelligence and dialogue effect.

Method used

By obtaining the cognitive attribute information of the response object, constructing a dialogue data set, and injecting it into the pre-trained response model to generate the target dialogue content, thereby realizing intelligent generation and cognitive correction of dialogue content.

Benefits of technology

It improves the intelligence of human-computer dialogue, ensures that the respondents can conduct Q&A according to the corresponding business background, and improves the effect of human-computer intelligent dialogue.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808942A_ABST
    Figure CN119808942A_ABST
Patent Text Reader

Abstract

The invention relates to the field of data processing technologies, large model technologies, large language model technologies and artificial intelligence technologies, and discloses a dialogue content generation method and device, equipment, a storage medium and a program product. The method comprises the steps that cognitive attribute information of a response object is obtained, and the response object is a virtual object of a conversation; constructing a dialogue data set based on the cognitive attribute information; and injecting the dialogue data set into a pre-trained response model, and generating target dialogue content through the response model. According to the technical scheme, the response object can perform dialogue generation around the cognitive footstone, cognitive correction of the response object is achieved, it is guaranteed that the response object can perform questions and answers according to the corresponding service background, the intelligence of man-machine dialogue is improved, and the man-machine intelligent dialogue effect is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of data processing technology, large model technology, large language model technology, and artificial intelligence technology, and specifically to methods, devices, equipment, storage media, and program products for generating dialogue content. Background Art

[0002] With the development of artificial intelligence technology, intelligent human-computer dialogue systems are increasingly used in daily life. Intelligent human-computer dialogue systems not only make the public feel the progress of science and technology, but also bring a lot of convenience to daily life.

[0003] The core of the human-computer dialogue system is speech recognition and user intent recognition. The human-computer dialogue system competes on the accuracy of speech recognition and the fluency of the dialogue process. The robot's self-cognition in the human-computer dialogue system is the cornerstone of intelligent dialogue. All dialogue content revolves around the cornerstone, so that the robot can play a greater role in answering business scenarios. However, most of the current human-computer dialogue systems use large models to build question-and-answer systems, which easily expose the information of the base large model used during human-computer dialogue. This answer, which has nothing to do with the business background, largely destroys the intelligence of the human-computer dialogue system and affects the effect of human-computer intelligent dialogue. Summary of the invention

[0004] In view of this, the present disclosure provides a method, device, equipment, storage medium and program product for generating dialogue content to solve the problem of poor human-computer intelligent dialogue effect.

[0005] In a first aspect, the present disclosure provides a method for generating conversation content, comprising: obtaining cognitive attribute information of a response object, where the response object is a virtual object of the conversation; constructing a conversation data set based on the cognitive attribute information; injecting the conversation data set into a pre-trained response model, and generating target conversation content through the response model.

[0006] In a second aspect, the present disclosure provides a device for generating conversation content, comprising: an acquisition module for acquiring cognitive attribute information of a response object, where the response object is a virtual object of the conversation; a data set construction module for constructing a conversation data set based on the cognitive attribute information; and a content generation module for injecting the conversation data set into a pre-trained response model to generate target conversation content through the response model.

[0007] In a third aspect, the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for generating dialogue content of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0008] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for generating dialogue content of the first aspect or any corresponding embodiment thereof.

[0009] In a fifth aspect, the present disclosure provides a computer program product, including computer instructions, wherein the computer instructions are used to enable a computer to execute the method for generating dialogue content of the above-mentioned first aspect or any corresponding embodiment thereof.

[0010] The method, device, equipment, storage medium and program product for generating dialogue content provided by the embodiments of the present disclosure obtain cognitive attribute information of the response object, and construct a dialogue data set of the response object according to the cognitive attribute information, so as to facilitate the role shaping for the response object. Then, the dialogue data set is injected into the response model, so that the response model can learn the dialogue knowledge in the dialogue data set, so that the response object can generate dialogue around the dialogue data set as the cognitive cornerstone, realize the cognitive correction of the response object, ensure that the response object can ask and answer questions according to the corresponding business background, improve the intelligence of human-computer dialogue, and ensure the effect of human-computer intelligent dialogue. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0012] Figure 1 It is a schematic diagram of the implementation process of the human-computer dialogue system;

[0013] Figure 2 This is a schematic diagram of the robot’s self-cognition;

[0014] Figure 3 It is a schematic diagram of the response generation of the hit / miss knowledge database of the human-computer dialogue system;

[0015] Figure 4 is a flowchart of a method for generating conversation content according to an embodiment of the present disclosure;

[0016] Figure 5 is a flowchart of another method for generating conversation content according to an embodiment of the present disclosure;

[0017] Figure 6 is a schematic diagram of constructing a conversation data set according to an embodiment of the present disclosure;

[0018] Figure 7 is a flowchart of another method for generating dialogue content according to an embodiment of the present disclosure;

[0019] Figure 8 is a schematic diagram of role shaping of a response object according to an embodiment of the present disclosure;

[0020] Fig. 9 is a schematic diagram of updating parameters of a response model according to an embodiment of the present disclosure;

[0021] Fig.10 is a schematic diagram of conversation knowledge injection into a conversation data set according to an embodiment of the present disclosure;

[0022] Fig.11 is a schematic diagram of the change of the loss function of an embodiment of the present disclosure;

[0023] Fig.12 is a structural block diagram of a device for generating dialogue content according to an embodiment of the present disclosure;

[0024] Fig.13 It is a schematic diagram of the hardware structure of the computer device of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0026] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0027] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0028] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0029] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0030] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0031] As a hot subject actively explored by academia and industry, human-computer dialogue has blossomed in people's daily lives with the development of large language models. An intelligent human-computer dialogue system can not only let the public feel the progress of science and technology, but also bring a lot of convenience to daily life. At present, many electronic products have the ability to communicate with humans, such as in-vehicle smart cockpits, smart speakers, mobile phones, furniture robots, etc. Figure 1 shown.

[0032] Different manufacturers have different names, usage methods, and knowledge backgrounds for their human-computer dialogue products. The core of the human-computer dialogue system is speech recognition and user intent recognition. Each product competes on the accuracy of speech recognition and the fluency of the dialogue process. Accurate self-cognition is crucial to the accuracy of speech recognition and the fluency of the dialogue process.

[0033] The core of the robot's self-awareness (EGO) is to let the robot answer who you are and where you come from (extended to Figure 2 Who is your father? Where are you going? Figure 2 That is, give the robot a certain cultural or business background, and let the robot interact with people and respond based on its core capabilities. For example, if the robot's background is a medical expert, the robot should respond to the questioner based on relevant factors such as drug recommendations and eating habits. When the user says that he is not feeling well, the robot should use its professional background to guide the user to describe his or her own problems, rather than comforting or persuading like a general robot. For example, the reception robot of a functional department should speak in an enthusiastic and positive tone, and when interacting with visitors, it should take care of the visitor's status as much as possible, and needs to have a certain understanding of the basic situation of the department and introduce it during the reception process.

[0034] The human-computer dialogue system in the related technology generally includes three parts: speech-to-text module, expert system module, and text-to-speech module. Among them, the speech-to-text module (Speech-To-Text, STT) recognizes the user's voice and converts it into text; the expert system module generates results based on the input text, constructs a full question library, each question library is configured with multiple answers, and selects the appropriate answer for output based on the input question hitting the question library; the text-to-speech module (Text-To-Speech, TTS) converts the answer generated by the expert system module into voice output to communicate with the user.

[0035] like Figure 3 As shown in the figure, the algorithm for self-cognition setting of the human-computer dialogue system can be divided into three steps as a whole:

[0036] (1) Construct a self-awareness question-answering knowledge base, which contains commonly used questions, and each question has N answers;

[0037] (2) After the user's language is converted into text by TTS, the knowledge base is checked against the text to see if there is a hit;

[0038] (3) If the answer is a hit, a matching answer is randomly selected and output; if the answer is a miss, the user is answered with a preset answer such as "not sure" or "don't know".

[0039] The above method can realize a simple human-computer interaction system, but it requires the construction of a large knowledge base to cover potential user questions. According to the characteristics of Chinese words with multiple meanings and multiple words with one meaning, the same question can be expressed in many different ways, which is undoubtedly a great test for the hit logic of the knowledge base. In addition, this method does not correct the robot's EGO in essence, but uses manual correction. The robot cannot conduct effective question-and-answer based on EGO. For questions that do not hit the knowledge base and are related to self-cognition, the answers output by the system will be unsatisfactory.

[0040] With the rise of large language models, general large language models have gradually emerged in human-computer interactive dialogue systems. Compared with expert knowledge systems, the semantic understanding ability of large language models has been greatly improved. Setting a suitable sampling strategy can make the generation results of large language models diverse and reduce the implementation and maintenance costs of complex hit logic of knowledge bases. However, the self-cognition of large language models depends on the training process of its base large model, and the high training cost is unacceptable to most users. For most users of large models, when solving actual business problems, they will not choose to train the base large model from 0 to 1, but tend to choose a large model that fits the business scenario. However, when using a large language model to build a question-and-answer system, if the self-cognition of the large language model is not properly corrected, it is easy to expose the information of the base large language model used in the dialogue system, and this answer that has nothing to do with the business background will largely undermine the professionalism of the intelligent system. That is, the self-cognition of the pre-trained model does not actually meet the business requirements, and cognitive correction needs to be performed for business scenarios.

[0041] The method of constructing a self-cognition knowledge base and matching it with rules according to user questions can correct the self-cognition of the dialogue system to a certain extent. However, this method does not internalize the knowledge in the model or system. In addition, the same semantics has multiple expressions and social relations are complicated. It is difficult for the knowledge base to cover all self-cognition problems and their derivatives. When users ask questions using unfamiliar self-cognition derivatives, the dialogue system will be exposed.

[0042] Based on this, the present disclosure proposes a method for generating dialogue content suitable for a human-computer dialogue system. This method can be used to inject self-cognition background knowledge into the dialogue system and correct the self-cognition of the robot in the original dialogue system. Unlike knowledge base hits, the technical solution disclosed in the present disclosure is directly embedded into the response module corresponding to the human-computer dialogue system when injecting knowledge, making it the cornerstone of the dialogue system, and performing reasoning and decision-making on this basis. After upgrading the human-computer dialogue system using this method, the human-computer dialogue system can make correct and business-logical responses to self-cognition problems and their different types of derivatives, as well as complex social relationships.

[0043] The core idea of ​​the present invention is to transform the response module in the human-computer dialogue system. If the original response module is an expert knowledge system, expert knowledge data is collected to train the response model. If the original response module is already a response model, a self-cognition data set is constructed in combination with the business scenario, and knowledge is injected into the response model to integrate background knowledge into the response model and become the cornerstone of response model reasoning.

[0044] According to an embodiment of the present disclosure, an embodiment of a method for generating conversation content is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0045] In this embodiment, a method for generating conversation content is provided, which can be used in computer devices, such as computers, mobile phones, tablet computers, etc. Figure 4 is a flow chart of a method for generating dialogue content according to an embodiment of the present disclosure, such as Figure 4 As shown, the process includes the following steps:

[0046] Step S101, obtaining cognitive attribute information of a response object, wherein the response object is a virtual object in the dialogue.

[0047] Cognitive attribute information is used to characterize the cognitive data of the responding object about its own role, which may specifically include: basic information (such as version, etc.), basic response capabilities (such as singing, reading, conversation, etc.), response fields (such as medical, poets, translation, etc.), response types (such as medical health, economic analysis, poetry writing, etc.), and core response capabilities (i.e., the response capabilities of the responding object in its specialty response field).

[0048] For different response business scenarios, the corresponding response topics or response fields are different, so the emphasis of their cognitive attribute information is different, that is, there is a strong binding relationship between cognitive attribute information and response business scenarios, thereby ensuring that the reply content of the response object can be consistent with the response business scenario.

[0049] The answering object is a virtual object that realizes the answering task, that is, a robot used for intelligent dialogue. Specifically, the answering object realizes the intelligent dialogue between it and the user based on the pre-trained answering model.

[0050] Step S102: constructing a dialogue dataset based on cognitive attribute information.

[0051] The dialogue dataset includes a variety of question-and-answer information, and there is a one-to-one correspondence between the questions and their answers in the question-and-answer information. Specifically, when constructing the dialogue dataset, cognitive data is extracted from cognitive attribute information, and a variety of question-and-answer dialogues containing cognitive data are constructed to expand the amount of question-and-answer dialogue data, so that the constructed dialogue dataset can contain enough information to ensure that each question can hit the dialogue dataset. At the same time, professional knowledge question-and-answer data is incorporated into the process of constructing question-and-answer dialogues to make the question-and-answer dialogues more accurate.

[0052] Step S103, injecting the dialogue data set into the pre-trained response model, and generating the target dialogue content through the response model.

[0053] The pre-trained response model is a model that is pre-trained using question and answer samples and is used to implement human-computer dialogue. The response model can be trained using a large language model, a deep learning algorithm, or a machine learning algorithm. Of course, it can also be trained based on other methods. This is not specifically limited here, and those skilled in the art can determine it according to actual needs.

[0054] The target dialogue content is the answer content generated by the response model for the question raised by the user. As mentioned above, the pre-trained response model can realize human-computer dialogue. In order to ensure that the response model can match the response business scenario, the constructed dialogue dataset is used as the input of the response model to iteratively train the response model so that the response model can have the cognitive attribute information associated with the dialogue dataset. When the question raised by the user hits the dialogue dataset, the response model can generate the target dialogue content according to the dialogue dataset.

[0055] The method for generating dialogue content provided in this embodiment obtains cognitive attribute information of the response object and constructs a dialogue data set of the response object according to the cognitive attribute information, so as to facilitate the role shaping for the response object. Then, the dialogue data set is injected into the response model, so that the response model can learn the dialogue knowledge in the dialogue data set, so that the response object can generate dialogue around the dialogue data set as the cognitive cornerstone, realize the cognitive correction of the response object, ensure that the response object can ask and answer questions according to the corresponding business background, improve the intelligence of human-computer dialogue, and ensure the human-computer intelligent dialogue effect.

[0056] In this embodiment, a method for generating conversation content is provided, which can be used in computer devices, such as computers, mobile phones, tablet computers, etc. Figure 5 is a flow chart of a method for generating dialogue content according to an embodiment of the present disclosure, such as Figure 5 As shown, the process includes the following steps:

[0057] Step S201, obtaining cognitive attribute information of a response object, wherein the response object is a virtual object in the dialogue. Figure 4 Step S101 of the illustrated embodiment will not be described in detail here.

[0058] Step S202: constructing a dialogue dataset based on cognitive attribute information.

[0059] Specifically, the above step S202 includes:

[0060] Step S2021: extract key response information from the cognitive attribute information, and construct a first data set using the key response information.

[0061] Key response information is the key elements required by the respondent in the response process, such as the respondent's basic identity information, basic response capabilities, response fields, questions that can be answered, etc. Specifically, key response information can be a description, feature, attribute, etc. of a certain topic, field or question.

[0062] The first data set is a conversation data set generated based on the key information of the answer, and includes multiple question-answer pairs generated by the key information of the answer. Specifically, the cognitive attribute information is analyzed by using natural language processing technology, data mining algorithms, feature engineering, etc., and the key information of the answer related to the answer process is extracted from the cognitive attribute information. The key information of the answer is cleaned, preprocessed, and question and answer annotated to construct question-answer pairs of question data and answer data, and the first data set is obtained.

[0063] Step S2022: Acquire knowledge data associated with cognitive attribute information, and construct a second data set using the knowledge data.

[0064] Knowledge data is cognitive data related to the response topic or response field corresponding to cognitive attribute information. The knowledge data can come from a knowledge database related to the response field, or from a knowledge document related to the response field, or from network resources related to the response application. The method of obtaining knowledge data is not specifically limited here, and those skilled in the art can determine it according to actual needs.

[0065] The second data set is a conversation data set generated based on the knowledge data, and contains multiple sets of question-answer pairs corresponding to the knowledge data. Specifically, the collected knowledge data is processed to remove noise data, duplicate data, inconsistent data, etc., and then the question data and answer data related to the answering process are extracted from the processed knowledge data, and question-answer pairs are constructed to obtain the second data set.

[0066] Step S2023: Determine a conversation data set based on the fusion result of the first data set and the second data set.

[0067] The first data set and the second data set are merged to ensure that the related information of the first data set and the second data set can be combined. Specifically, the fusion of the first data set and the second data set can be achieved by merging, connecting or other data fusion methods.

[0068] The fused data set is processed by data cleaning, data standardization, data segmentation, etc. to remove the noise data, duplicate data, and inconsistent data in the fused data set. The conversation data such as questions, answers, and context in the conversation are identified from the fused data set, and the identified conversation data is assembled into a conversation data set.

[0069] In some optional implementations, the above step S2023 includes:

[0070] Step a1: supplement the first data set with the second data set to obtain a fused data set.

[0071] Step a2: perform data enhancement on the fused data set, and determine the data enhanced data set as the conversation data set.

[0072] Based on the above description, the second data set is constructed based on knowledge data, and the first data set is constructed based on key information of responses. The amount of data in the first data set is relatively small. The second data set is used as a supplement to the first data set, and the second data set is fused with the first data set to achieve expansion of the first data set to obtain a fused data set. In order to ensure that the fused data set can cover enough conversation data so that each question asked by the user can hit the data set, it is necessary to perform data enhancement on the fused data set to improve the generalization ability of the data set. Specifically, according to the characteristics of the fused data set, random data enhancement operations are performed on the conversation data in the fused data set to increase the diversity of the conversation data, and the data set obtained after the data enhancement process is determined as the conversation data set.

[0073] By supplementing the first data set with the second data set to obtain a corresponding fused data set, and performing data enhancement on the fused data set, the fused data set is expanded so that the conversation data set can contain more conversation content, which is convenient for improving the conversation generalization ability of the response model.

[0074] In some optional implementations, the step of performing data enhancement on the fused data set includes:

[0075] Step b1, obtaining each single-round dialogue and preset knowledge question and answer data in the fusion data set.

[0076] Step b2: Incorporating preset knowledge question and answer data into a single round of dialogue to obtain a first knowledge data set.

[0077] Step b3, breaking up each round of dialogue in the first knowledge data set to obtain a second knowledge data set.

[0078] Step b4: assembling each round of dialogue in the second knowledge data set according to the first preset sampling interval to obtain a third knowledge data set.

[0079] Step b5, filling the third knowledge dataset into the fusion dataset.

[0080] A single-round conversation is a conversation consisting of a question data and its corresponding answer data, such as "Who are you" and "I am XX" constitute a single-round conversation. The conversation data in the fusion data set is processed to extract each single-round conversation. The preset knowledge question and answer data is the question data associated with the answering business scenario and its corresponding answer data. The preset knowledge question and answer data can be extracted from a knowledge database, or from relevant knowledge documents, or from network resources. The source of the preset knowledge question and answer data is not specifically limited here.

[0081] Pre-process the preset knowledge question and answer data, match the questions in the single-round dialogue with the questions in the knowledge question and answer data, or select relevant knowledge question and answer data according to the context of the single-round dialogue to integrate it into each single-round dialogue. Specifically, the answer to the knowledge question and answer can be inserted into the single-round dialogue, or the knowledge question and answer data can be combined with the dialogue content in other ways. Then, each single-round dialogue carrying the preset knowledge question and answer data is constructed as a first knowledge data set.

[0082] The first preset sampling interval is a preset sampling interval of the number of conversation rounds, such as 2 rounds, 4 rounds, etc. The conversation rounds in the first knowledge data set are randomly scattered to generate a second knowledge data set. The conversation rounds in the second knowledge data set are sampled according to the first preset sampling interval to obtain the sampled conversation rounds, and the sampled conversation rounds are assembled to construct multiple multi-round conversations to obtain a third knowledge data set. Figure 6 As shown, when sampling is performed according to the first preset sampling interval of 2, each round of dialogue is sampled once, and 2 rounds of dialogue are assembled to obtain corresponding multiple 2-round dialogues. Similarly, corresponding multiple 4-round dialogues, multiple N-round dialogues, etc. can be obtained. Each multi-round dialogue is constructed as a third knowledge data set, and the third knowledge data set is filled into the fused data set to achieve dialogue expansion of the fused data set.

[0083] By integrating knowledge question and answer data of business scenarios into a single round of dialogue, the cognitive role dialogue data and knowledge question and answer data are mixed, which is conducive to expanding the dialogue content. The rounds of dialogue in the first data set are scattered to increase the randomness of the dialogue data, which is conducive to improving the generalization ability of the response model and avoiding overfitting of the response model. By assembling each round of dialogue according to the preset sampling interval, it is conducive to expanding the dialogue content of the dialogue data set.

[0084] In some optional implementations, the step of performing data enhancement on the fused data set further includes:

[0085] Step c1, converting the language of each round of dialogue in the first knowledge data set to obtain a fourth knowledge data set.

[0086] Step c2: Fill the fourth knowledge data set into the fusion data set.

[0087] Each round of dialogue in the first knowledge data set is translated into a preset language to achieve language conversion of the dialogue, for example, each single-round dialogue is translated into English to obtain each single-round English dialogue. After the language conversion is completed, each single-round English dialogue is constructed into a fourth knowledge data set, and the fourth knowledge data set is filled into the fused data set to achieve dialogue expansion in various language forms of the fused data set.

[0088] By converting the language of each round of conversation, the diversity of the conversation data is increased. When the conversation data set is injected into the response model, the response model can support multiple languages, promoting the response model to achieve cross-language communication.

[0089] In some optional implementations, on the basis of obtaining the fourth knowledge data set, the step of performing data enhancement on the fused data set further includes:

[0090] Step c3: assembling each round of dialogue in the fourth knowledge data set according to the second preset sampling interval to obtain a fifth knowledge data set.

[0091] Step c4, filling the fifth knowledge dataset into the fusion dataset.

[0092] The second preset sampling interval is a preset sampling interval for the number of dialogue rounds after language conversion, such as 2 rounds, 4 rounds, etc. The rounds of dialogue in the fourth knowledge data set are sampled according to the second preset sampling interval to obtain the sampled rounds of dialogue, and the sampled rounds of dialogue are assembled to construct multiple multi-round dialogues for the fourth knowledge data set, and the multiple multi-round dialogues constitute the fifth knowledge data set. The fifth knowledge data set is filled into the fused data set to achieve multiple forms of language dialogue expansion of the fused data set.

[0093] By assembling each round of dialogue according to the sampling interval, the diversity of dialogue data is further increased, which can improve the training efficiency and training performance of the response model. By selecting an appropriate preset sampling interval, the amount of dialogue data and the content of dialogue information can be balanced, so that the response model can better learn dialogue knowledge and improve the generalization ability of the response model.

[0094] In some optional implementations, the step of performing data enhancement on the fused data set further includes:

[0095] Step d1, merging the first knowledge data set and the fourth knowledge data set to obtain a sixth knowledge data set.

[0096] Step d2: assemble each round of dialogue in the sixth knowledge data set according to the third preset sampling interval to obtain a seventh knowledge data set.

[0097] Step d3, filling the seventh knowledge data set into the fusion data set.

[0098] The first knowledge data set and the fourth knowledge data set are merged to obtain a single-round dialogue or multiple-round dialogues containing different languages, and the multiple single-round dialogues or multiple-round dialogues are constructed into a sixth knowledge data set.

[0099] The third preset sampling interval is a preset sampling interval for the number of dialogue rounds for the sixth knowledge data set, such as 2 rounds, 4 rounds, etc. The number of dialogue rounds in the sixth knowledge data set is sampled according to the third preset sampling interval to obtain sampled dialogue rounds containing different languages, and the sampled dialogue rounds containing different languages ​​are assembled to construct multiple multi-round dialogues for the sixth knowledge data set, and the multiple multi-round dialogues constitute the seventh knowledge data set. The seventh knowledge data set is filled into the fusion data set to achieve dialogue expansion that integrates multiple forms of language.

[0100] By fusing the first knowledge data set and the fourth knowledge data set, a mixture of different languages ​​is achieved, and the expansion and enhancement of the fused data set is achieved through multiple rounds of dialogue.

[0101] Step S203: inject the conversation data set into the pre-trained response model, and generate the target conversation content through the response model. Figure 4 Step S103 of the illustrated embodiment will not be described in detail here.

[0102] The method for generating the dialogue content provided in this embodiment constructs a first data set through the key information of the response in the cognitive attribute information, and constructs a second data set through the knowledge data associated with the cognitive attribute information, thereby fusing the first data set and the second data set to generate a final dialogue data set, ensuring that the dialogue data in the dialogue data set is richer and improving the diversity of the dialogue data. By fusing the first data set and the second data set, the advantages of each data set can be comprehensively utilized to make up for each other's shortcomings, further improving the overall quality of the dialogue data.

[0103] In this embodiment, a method for generating conversation content is provided, which can be used in computer devices, such as computers, mobile phones, tablet computers, etc. Figure 7 is a flow chart of a method for generating dialogue content according to an embodiment of the present disclosure, such as Figure 7 As shown, the process includes the following steps:

[0104] Step S301, obtaining cognitive attribute information of a response object, wherein the response object is a virtual object in the dialogue.

[0105] Specifically, the above step S301 includes:

[0106] Step S3011, obtaining the response description information corresponding to the response object.

[0107] The response description information is the text description information for the response object. Different response business scenarios have different response description information for their response objects, that is, there is a strong binding relationship between the response object and its response business scenario. For the response business scenario corresponding to the response object, the role image of the response object is shaped by text description to obtain the corresponding response description information.

[0108] Specifically, by collecting the response requirements required for the response business scenario, the role played by the response object (such as a poet, economist, etc.) is determined, and the corresponding response description information is determined in combination with the role of the response object.

[0109] In some optional implementations, the above step S3011 includes:

[0110] Step e1, obtaining the response scenario corresponding to the response object.

[0111] Step e2: construct response description information corresponding to the response object based on the response target corresponding to the response scenario.

[0112] The response scenario is the response business scenario used by the response object; the response target is the response capability that the response object needs to have in the response scenario. There is a one-to-one correspondence between the response scenario and the response target. When the response object is used in the response scenario for human-computer dialogue, the response capability that the response object needs to have can be determined in combination with the correspondence between the response scenario and the response target, and then the role image of the response object can be shaped according to the response capability, and the response description information corresponding to the response object can be constructed in combination with the role image.

[0113] By obtaining the response scenario in which the response object is located and constructing the response description information according to the response target required by the response scenario, role shaping for the response object is achieved.

[0114] Step S3012: extract cognitive data from the response description information, and determine cognitive attribute information of the response object based on the cognitive data.

[0115] The response description information contains a variety of cognitive data associated with the response object, mainly including the five elements of the response object's basic cognition, basic ability, self-positioning, role goals and core capabilities, such as Figure 8As shown. Among them, basic cognition represents the basic information possessed by the role, including version information, etc.; basic ability represents the basic work that the role can complete, including conversation, reading, singing, etc., similar to human walking, running and other abilities; self-positioning represents the core positioning areas of the role, including the medical field, economic field, and poetry creation field; role goals represent the core goals of the role developed, that is, the problems that the responding object needs to solve; core capabilities represent the professional capabilities required to achieve the role goals, that is, the professional problems that the responding object can help users solve. The above cognitive data are related to each other, paved with each other, and strongly bound to the response business scenario, which is used to drive the response object to respond at the cognitive level.

[0116] Semantic recognition is performed on the descriptive information contained in the response description information, and the cognitive data possessed by the response object at the cognitive level is extracted from it. The response object's own role is shaped in combination with the cognitive data, thereby determining the cognitive attribute information possessed by the role.

[0117] Step S302: construct a dialogue dataset based on cognitive attribute information. Figure 5 Step S202 of the illustrated embodiment will not be described in detail here.

[0118] Step S303, injecting the dialogue data set into the pre-trained response model, and generating the target dialogue content through the response model.

[0119] Specifically, the above step S303 includes:

[0120] Step S3031, constructing a response prediction task based on the question data in the dialogue dataset, where the dialogue dataset includes the question data and its corresponding target response data.

[0121] The reply prediction task is a task set to predict the reply of the reply object. The output of the reply prediction task is the training target of the reply model. The dialogue dataset is used as the input data of the reply model so that the reply model can learn the dialogue knowledge in the dialogue dataset. The dialogue dataset includes question data and target reply data corresponding to the question data.

[0122] Specifically, when injecting the logarithmic data set into the response model, it is necessary to determine whether the object role is a user or a response object. When the object role is a response object, the reply prediction task is performed. In a specific example, in the conversation data, only the content (target conversation content) field whose role is robot (i.e., the response object) needs to be predicted. The content of this field is the valid target in the training process, and the target of other fields can be set to -1. The specific example is as follows:

[0123] {"role":"user","content":"Who are you?"

[0124] "role":"robot","content":"I'm Alex, your personal health manager. How can I help you?"}.

[0125] {"role":"user","content":"what's your name?"

[0126] "role":"robot","content":"I'm your personal health partner,and myname is Alex."}

[0127] Step S3032, obtain the predicted answer data output by the answer prediction task for the question data, and determine the error information between the predicted answer data and the target answer data.

[0128] The predicted answer data is the prediction result output by the answer model for the question data. The error information is the deviation between the predicted answer data and the target answer data. When the answer model performs the answer prediction task based on the dialogue dataset, it will generate corresponding predicted answer data for the question data in the dialogue dataset.

[0129] The predicted response data is compared with the target response data to determine the loss function between the predicted response data and the target response data, that is, to determine the error information of the predicted response data compared with the target response data.

[0130] Step S3033: Use the error information to adjust the response model.

[0131] The response model is iteratively trained using the error information so that the predicted response data output by the response prediction task of the response model approaches the target response data.

[0132] In some optional implementations, the above step S3033 includes:

[0133] Step f1, extracting key layer parameters corresponding to the reply prediction task from the response model.

[0134] Step f2: adjusting the key layer parameters based on the error information and freezing the non-key layer parameters.

[0135] Keyword parameters are training layer parameters that have a greater impact on the update of predicted answer data during the training of the response model based on the dialogue dataset. Non-key layer parameters are training layer parameters that have no impact or little impact on the update of predicted answer data.

[0136] In a specific example, the network structure of the response model is as follows Fig. 9 As shown in the figure, an autoregressive approach is used to construct a prediction reply task, that is, the task of predicting the reply data (Answer) using the question data (Question) in the dialogue dataset, and the generation process of the predicted reply data is generated word by word. The generation process of the predicted reply data is as follows:

[0137] Question: Who are you? -> Prediction: Me

[0138] Question: Who are you? Answer: Me -> Prediction: Yes ......

[0140] Question: Who are you? Answer: I am Alex, your personal health manager -> Prediction: Home.

[0141] Using the method of full parameter fine-tuning, the parameters of the training layers that have a greater impact on the predicted response data are updated during the training of the response model using the dialogue dataset, including the parameters of the embedding representation layer, the parameters of the fully connected layer of the classifier, the parameters of the first feature extraction layer (Transformer layer), and the parameters of the last feature extraction layer (Transformer layer). At the same time, the parameters of all other Transformer layers except the first and last ones are frozen.

[0142] The Embedding layer is used to represent the question data text in the input dialogue dataset as a low-dimensional vector to capture the semantic and grammatical information of the question data text. The output of the Embedding layer serves as the input of the subsequent layer.

[0143] Among them, the fully connected layer of the classifier is used to map the output of the Embedding layer to different categories or labels. The fully connected layer is usually composed of multiple neurons, each of which is connected to all neurons in the previous layer. By adjusting the parameters of the fully connected layer, classification of different categories can be achieved.

[0144] Among them, the feature extraction module (Transformer) is the deep learning architecture of the answer model, which consists of multiple Transformer layers. Each Transformer layer contains components such as a multi-head attention mechanism and a feedforward neural network, which are used to extract features and learn representations of the input sequence to achieve the question-answering task. The first Transformer layer is used to encode the input text and represent it as a series of feature vectors, and the last Transformer layer is used to decode the encoded feature vectors to generate the final output.

[0145] The response module is iteratively trained according to a preset number of iterations (for example, 2000 times), and the key layer parameters are updated once according to the error information for each iteration. At the beginning of the response model training, the initial learning rate of the response model can be set to 0.005, that is, at the beginning of the response model training, the update amplitude of the key layer parameters is large. As the iterative training proceeds, the learning rate will gradually decrease, which can help the response model converge faster in the early stage of training and adjust the parameters more finely in the later stage. Among them, the attenuation of the learning rate is staged, and after a specific number of iterations, the learning rate will be adjusted according to certain rules or proportions. For example, after every 500 iterations, the learning rate will be reduced by half. Through an appropriate learning rate attenuation strategy, the efficiency and stability of training can be improved to avoid overfitting of the model or slow convergence.

[0146] By extracting keyword parameters, adjusting key layer parameters according to error information, and freezing non-key layer parameters, the efficiency of injecting dialogue knowledge is improved.

[0147] Step S3034, generating target dialogue content through the response model.

[0148] The dialogue data set is used to correct the dialogue content output by the response model. When the user asks a question, the response model can detect whether the question hits the dialogue data set. If it hits the dialogue data set, the response model can generate the corresponding target dialogue content based on the dialogue knowledge in the dialogue data set.

[0149] Step S304: collect real response data according to a preset period, and use the real response data to update the dialogue data set.

[0150] The preset period is a preset data collection interval, such as 1 day, 1 week, 1 month, etc., which is not specifically limited here. The real response data is the conversation data actually generated in the response business scenario. The real response data is generated by the user interacting with the response system in the actual response business scenario.

[0151] The real response data generated by the response business scenario is collected online according to the preset period, and the collected real response data is added to the existing conversation data set, and the conversation content in the conversation data set is updated to make the conversation content in the conversation data set richer.

[0152] Step S305: Use the updated dialogue data set to update the knowledge of the response model.

[0153] The response model is trained on the updated dialogue dataset. During the training process, the new dialogue content is integrated into the response model, so that the new question data in the dialogue dataset is used as the input sample, and the new answer data corresponding to the new question data is used as the output sample. The prediction error is minimized by adjusting the key layer parameters of the response model. Of course, the dialogue content can also be integrated into the response model by adding relevant knowledge examples or using knowledge graphs.

[0154] Deploy the trained response model to the actual response business scenario and continuously collect new conversation data to continuously update the knowledge of the response model. Specifically, Fig.10 As shown, the above steps are repeated continuously according to the preset cycle to continuously update the dialogue dataset, so that the dialogue dataset can be closer to the actual response situation, and the dialogue dataset can be more real, rich and representative, thereby improving the response performance and accuracy of the response model trained based on the dialogue dataset. At the same time, timely updating of the dialogue dataset helps the response model adapt to the ever-changing language use and user needs.

[0155] The method for generating dialogue content provided in this embodiment extracts cognitive data from the response description information to determine cognitive attribute information based on the cognitive data, so that the role of the response object can be created based on the cognitive attribute information to achieve role shaping of the response object. According to the question data in the dialogue data set, the reply prediction task is constructed, and the predicted reply data corresponding to the reply prediction task is determined, so that the reply model is adjusted according to the error information between the predicted reply data and the target reply data, thereby realizing the injection of the dialogue data set into the reply model, so that the dialogue content output by the reply model can be consistent with the reply business scenario, and the generation accuracy of the dialogue content and the intelligence of the human-computer dialogue are improved. By collecting the real question and answer data corresponding to the reply business and expanding the dialogue data set corresponding to the reply business scenario, new knowledge is injected into the reply model, so that the reply model can adapt to the constantly updated business scenarios.

[0156] As a specific application embodiment of the disclosed embodiment, an open source large language model is used as a response model, and experiments are conducted in combination with medical and health consultation scenarios. The response object corresponding to the response model is given the role of a medical knowledge expert, and an attempt is made to correct the self-cognition of the response object. Specifically, in the experiment, the role of a medical knowledge expert is shaped, and the role is supplemented from five dimensions, including basic cognition, basic capabilities, self-positioning, role goals, and core capabilities. A question-and-answer dialogue is constructed, and data enhancement is used to complete the construction of a self-cognition dialogue data set. Among them, the dialogue data set contains a total of 3055 training data, and an additional 100 self-cognition data are constructed for testing and verification. The answer model is optimized for question and answer using knowledge injection, and the loss function loss during the training process is shown as follows: Fig.11As shown, the convergence trend is obvious, with local oscillation. The indicators of the optimized response model on the validation set are shown in Table 1. The correction results are shown in Table 2.

[0157] Table 1 Verification indicators

[0158] Total cognitive problems Correct the correct amount Number of correction failures Correction success rate 100 100 0 100%

[0159] Table 2 Correction results

[0160]

[0161]

[0162] It can be seen from the experimental results that after using the technical solution disclosed in this disclosure to correct the cognitive response model, the success rate of question and answer correction for common cognitive questions and their derivatives is as high as 100%. The response model can already answer users' questions around its own role positioning and responsibilities, including some cognitive derivative questions involving biological associations. Even if the corresponding samples are not put in when constructing the dialogue data set, the response model can still infer the results that are consistent with its own role positioning. Therefore, the use of the method disclosed in this disclosure can efficiently correct the role cognition of robots in human-computer dialogue systems, give robots a core and soul that conforms to business scenarios, and enable robots to empower businesses more effectively.

[0163] In the present embodiment, a device for generating conversation content is also provided, and the device is used to implement the above-mentioned embodiment and preferred implementation mode, and the descriptions that have been made are not repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented with software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0164] This embodiment provides a device for generating dialogue content, such as Fig.12 As shown, including:

[0165] The acquisition module 501 is used to acquire cognitive attribute information of a response object, where the response object is a virtual object in the dialogue.

[0166] The data set construction module 502 is used to construct a dialogue data set based on cognitive attribute information.

[0167] The content generation module 503 is used to inject the dialogue data set into the pre-trained response model and generate the target dialogue content through the response model.

[0168] In some optional implementations, the data set construction module 502 includes:

[0169] The first construction unit is used to extract key response information from the cognitive attribute information and construct a first data set using the key response information.

[0170] The second construction unit is used to obtain knowledge data associated with cognitive attribute information and construct a second data set using the knowledge data.

[0171] The data fusion unit is used to determine the dialogue data set based on the fusion result of the first data set and the second data set.

[0172] In some optional implementations, the data fusion unit includes:

[0173] The supplementing subunit is used to supplement the first data set with the second data set to obtain a fused data set.

[0174] The data enhancement subunit is used to perform data enhancement on the fused data set, and determine the data enhanced data set as the conversation data set.

[0175] In some optional implementations, the data enhancement subunit includes:

[0176] The first acquisition subunit is used to acquire each single-round dialogue and preset knowledge question and answer data in the fusion data set.

[0177] The knowledge integration subunit is used to integrate preset knowledge question and answer data into a single round of dialogue to obtain a first knowledge data set.

[0178] The data scattering subunit is used to scatter each round of dialogue in the first knowledge data set to obtain a second knowledge data set.

[0179] The first assembling subunit is used to assemble each round of dialogue in the second knowledge data set according to a first preset sampling interval to obtain a third knowledge data set.

[0180] The first filling subunit is used to fill the third knowledge data set into the fusion data set.

[0181] In some optional implementations, the data enhancement subunit further includes:

[0182] The language conversion subunit is used to perform language conversion on each round of dialogue in the first knowledge data set to obtain a fourth knowledge data set.

[0183] A second filling subunit is used to fill the fourth knowledge data set into the fusion data set;

[0184] In some optional implementations, the data enhancement subunit further includes:

[0185] The second assembling subunit is used to assemble each round of dialogue in the fourth knowledge data set according to the second preset sampling interval to obtain a fifth knowledge data set.

[0186] The third filling subunit is used to fill the fifth knowledge data set into the fusion data set.

[0187] In some optional implementations, the data enhancement subunit further includes:

[0188] The data set fusion subunit is used to fuse the first knowledge data set and the fourth knowledge data set to obtain a sixth knowledge data set.

[0189] The third assembling subunit is used to assemble each round of dialogue in the sixth knowledge data set according to a third preset sampling interval to obtain a seventh knowledge data set.

[0190] The fourth filling subunit is used to fill the seventh knowledge data set into the fusion data set.

[0191] In some optional implementations, the acquisition module 501 includes:

[0192] The description information acquisition unit is used to acquire the response description information corresponding to the response object.

[0193] The cognitive data extraction unit is used to extract cognitive data from the response description information and determine cognitive attribute information of the response object based on the cognitive data.

[0194] In some optional implementations, the description information acquisition unit includes:

[0195] The response scene acquisition subunit is used to obtain the response scene corresponding to the response object.

[0196] The description information construction subunit is used to construct response description information corresponding to the response object based on the response target corresponding to the response scenario.

[0197] In some optional implementations, the content generation module 503 includes:

[0198] The prediction task construction unit is used to construct a response prediction task based on question data in a dialogue data set, where the dialogue data set includes question data and its corresponding target response data.

[0199] The predicted reply unit is used to obtain the predicted reply data output by the reply prediction task for the question data, and determine the error information between the predicted reply data and the target reply data.

[0200] The adjustment unit is used to adjust the response model using the error information.

[0201] In some optional implementations, the adjustment unit includes:

[0202] The parameter extraction subunit is used to extract key layer parameters corresponding to the reply prediction task from the response model.

[0203] The parameter adjustment subunit is used to adjust the key layer parameters based on the error information and freeze the non-key layer parameters.

[0204] In some optional embodiments, the above device further includes:

[0205] The data collection module is used to collect real response data according to a preset period and use the real response data to update the dialogue data set.

[0206] The updating module is used to update the knowledge of the response model using the updated dialogue dataset.

[0207] The device for generating the conversation content in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and a memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0208] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0209] The device for generating the dialogue content provided in this embodiment obtains the cognitive attribute information of the response object and constructs the dialogue data set of the response object according to the cognitive attribute information, so as to facilitate the role shaping for the response object. Then, the dialogue data set is injected into the response model, so that the response model can learn the dialogue knowledge in the dialogue data set, so that the response object can generate dialogue around the dialogue data set as the cognitive cornerstone, realize the cognitive correction of the response object, ensure that the response object can ask and answer questions according to the corresponding business background, improve the intelligence of the human-computer dialogue, and ensure the human-computer intelligent dialogue effect.

[0210] The present disclosure also provides a computer device having the above Fig.12 A device for generating the dialogue content shown.

[0211] See also Fig.13 , Fig.13 is a schematic diagram of a computer device provided by an optional embodiment of the present disclosure, such as Fig.13As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.13 A processor 10 is taken as an example.

[0212] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0213] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0214] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of a computer device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0215] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0216] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig.13 The example of connecting through bus is taken in the following.

[0217] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0218] The computer device also includes a communication interface, which is used for the computer device to communicate with other devices or a communication network.

[0219] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0220] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0221] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for generating dialogue content, characterized in that: include: Acquiring cognitive attribute information of a response object, where the response object is a virtual object of the conversation; constructing a dialogue dataset based on the cognitive attribute information; The conversation data set is injected into a pre-trained response model, and the target conversation content is generated by the response model.

2. The method according to claim 1, characterized in that The constructing a dialogue data set based on the cognitive attribute information includes: Extracting key response information from the cognitive attribute information, and constructing a first data set using the key response information; Acquire knowledge data associated with the cognitive attribute information, and construct a second data set using the knowledge data; The conversation data set is determined based on a fusion result of the first data set and the second data set.

3. The method according to claim 2, characterized in that Determining the conversation dataset based on a fusion result of the first dataset and the second dataset includes: Supplementing the first data set with the second data set to obtain a fused data set; Data enhancement is performed on the fused data set, and the data enhanced data set is determined as the conversation data set.

4. The method according to claim 3, characterized in that The performing data enhancement on the fused data set includes: Acquire each single-round dialogue and preset knowledge question and answer data in the fusion data set; Integrating the preset knowledge question and answer data into the single-round dialogue to obtain a first knowledge data set; Breaking up each round of dialogue in the first knowledge data set to obtain a second knowledge data set; Assembling each round of dialogue in the second knowledge data set according to a first preset sampling interval to obtain a third knowledge data set; The third knowledge dataset is filled into the fused dataset.

5. The method according to claim 4, characterized in that The performing data enhancement on the fused data set further includes: Performing language conversion on each round of dialogue in the first knowledge data set to obtain a fourth knowledge data set; Filling the fourth knowledge data set into the fused data set; and / or, Assembling each round of dialogue in the fourth knowledge data set according to a second preset sampling interval to obtain a fifth knowledge data set; The fifth knowledge dataset is filled into the fused dataset.

6. The method according to claim 5, characterized in that The performing data enhancement on the fused data set further includes: Merging the first knowledge data set and the fourth knowledge data set to obtain a sixth knowledge data set; Assembling each round of dialogue in the sixth knowledge data set according to a third preset sampling interval to obtain a seventh knowledge data set; The seventh knowledge dataset is filled into the fused dataset.

7. The method according to claim 1, characterized in that The step of obtaining cognitive attribute information of the response object includes: Obtaining response description information corresponding to the response object; The cognitive data is extracted from the response description information, and the cognitive attribute information of the response object is determined according to the cognitive data.

8. The method according to claim 7, characterized in that The obtaining the response description information corresponding to the response object includes: Obtaining a response scenario corresponding to the response object; Based on the response target corresponding to the response scenario, response description information corresponding to the response object is constructed.

9. The method according to claim 1, characterized in that: The injecting the dialogue data set into the pre-trained response model includes: constructing a response prediction task based on question data in the dialogue dataset, wherein the dialogue dataset includes question data and its corresponding target response data; Acquire predicted answer data output by the answer prediction task for the question data, and determine error information between the predicted answer data and the target answer data; The response model is adjusted using the error information.

10. The method according to claim 9, characterized in that Using the error information to adjust the response model includes: extracting key layer parameters corresponding to the reply prediction task from the response model; The key layer parameters are adjusted based on the error information, and the non-key layer parameters are frozen.

11. The method according to claim 1, characterized in that: Also includes: Collecting real response data according to a preset period, and updating the conversation data set using the real response data; The updated dialogue data set is used to perform knowledge update on the response model.

12. A device for generating dialogue content, characterized in that: The device comprises: An acquisition module, used to acquire cognitive attribute information of a response object, where the response object is a virtual object of the conversation; A data set construction module, used to construct a dialogue data set based on the cognitive attribute information; The content generation module is used to inject the dialogue data set into the pre-trained response model and generate the target dialogue content through the response model.

13. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for generating dialogue content according to any one of claims 1 to 11 by executing the computer instructions.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for generating dialogue content according to any one of claims 1 to 11.

15. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method for generating dialogue content according to any one of claims 1 to 11.