Dialogue reply method and device, dialogue model training method and device, and storage medium
By constructing a training set of virtual role samples and corresponding dialogue corpus pairs, using dialogue marking/inserting network, the limitations of virtual role models in open dialogue are solved, and natural and accurate information is replied in the dialogue style of the target role. , ensuring breadth and consistency of applications.
Patent Information
- Application Number
- CN202110802896.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-15
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-07-15
AI Technical Summary
In the existing human-computer dialogue system, the virtual character model has dialogue limitations during open dialogue, and cannot effectively deal with application scenarios other than the source work. The general dialogue corpus will cause the reply to lose the consistency and immersion between the character and the character background. .
By constructing a sample training set of virtual character samples and corresponding dialogue corpus pairs, using pre-trained dialogue models and dialogue markers/insert networks, a dialogue style information representing the target role is generated, and a response is made to user input, ensuring the naturalness of the reply and accuracy.
It realizes more natural and accurate information in the conversation style of the target character in any scenario, avoids dialogue limitations, maintains the consistency of character characteristics, and improves the application breadth and user experience of the dialogue model.
Smart Images

Figure CN113378583B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of human-computer dialogue, and in particular to a dialogue reply method and device, a dialogue model training method and device, and a storage medium. Background Art
[0002] With the development of Internet technology, information and communication technology, and artificial intelligence technology, the natural convenience of conversational systems has made it a new generation of interaction paradigm. Human-computer conversation technology has been applied by the industry to various types of products and services. In the application of human-computer conversation systems, as the intelligence of AI gradually improves, people are also beginning to put forward more advanced requirements for human-computer conversation systems, for example, requiring conversational robots to interact with users more naturally like real people, or requiring conversational robots to have personality / character like real people. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a dialogue reply method and device, a dialogue model training method and device, and a storage medium to solve the problems existing in the related art.
[0004] According to a first aspect of an embodiment of the present disclosure, a conversation reply method is provided, the method comprising:
[0005] Obtain the first dialogue information input by the user;
[0006] Inputting the first dialogue information and target role information into a pre-trained dialogue model to obtain target response information output by the dialogue model in response to the first dialogue information;
[0007] The target response information is information representing the dialogue style of the target character.
[0008] In some embodiments, the conversation model includes a conversation tagging network;
[0009] The step of inputting the first dialogue information and the target role information into a pre-trained dialogue model to obtain target response information output by the dialogue model in response to the first dialogue information includes:
[0010] Inputting the first dialogue information and the target role information into a pre-trained dialogue tag network to obtain first response information output by the dialogue tag network and containing label information;
[0011] The tag information is used to represent the marking information of each unit character in the first response information, and the tag information includes at least one of a deletion tag, a retention tag, and a text insertion position tag.
[0012] In some embodiments, the conversation model includes a conversation insertion network;
[0013] The step of inputting the first dialogue information and the target role information into a pre-trained dialogue model to obtain the target response information output by the dialogue model in response to the first dialogue information further includes:
[0014] The first response information is input into the dialogue insertion network, and the target response information output by the dialogue insertion network is obtained by adjusting the first response information according to the label information.
[0015] In some embodiments, the dialogue model is trained in the following manner:
[0016] Constructing a sample training set according to a virtual character sample and a dialogue corpus pair corresponding to the virtual character sample, wherein the dialogue corpus pair includes a first corpus pair associated with a virtual character corresponding to the virtual character sample selected from a target platform and a second corpus pair of the virtual character in a source work;
[0017] The dialogue model is trained according to the training sample set until the dialogue model has the ability to generate information representing the dialogue style of the virtual character sample.
[0018] In some embodiments, the step of filtering the first corpus pair associated with the virtual character from the target platform includes:
[0019] mining candidate corpus pairs associated with the virtual character from the target platform, the candidate corpus pairs comprising candidate dialogue information and candidate reply information;
[0020] When the similarity between the candidate reply information and the second reply information included in the second corpus pair is greater than a first preset threshold, the candidate corpus pair where the candidate reply information is located is determined as the first corpus pair.
[0021] In some embodiments, the step of filtering the first corpus pair associated with the virtual character from the target platform includes:
[0022] mining candidate corpus pairs associated with the virtual character from the target platform, the candidate corpus pairs comprising candidate dialogue information and candidate reply information;
[0023] Inputting the candidate reply information into a dialogue identification model to obtain an identification value indicating whether the candidate reply information is the source reply information included in the source work;
[0024] The candidate corpus pair containing the candidate reply information whose identification value is greater than a second preset threshold is determined as the first corpus pair.
[0025] According to a second aspect of an embodiment of the present disclosure, a method for training a dialogue model is provided, the method comprising:
[0026] Constructing a sample training set according to a virtual character sample and a dialogue corpus pair corresponding to the virtual character sample, wherein the dialogue corpus pair includes a first corpus pair associated with a virtual character corresponding to the virtual character sample selected from a target platform and a second corpus pair of the virtual character in a source work;
[0027] The dialogue model is trained according to the training sample set until the dialogue model has the ability to generate information representing the dialogue style of the virtual character sample.
[0028] According to a third aspect of an embodiment of the present disclosure, there is provided a dialogue replying device, including:
[0029] An acquisition module, configured to acquire first dialogue information input by a user;
[0030] an input module configured to input the first dialogue information and target role information into a pre-trained dialogue model, and obtain target response information output by the dialogue model to reply to the first dialogue information;
[0031] The target response information is information representing the dialogue style of the target character.
[0032] In some embodiments, the dialogue model includes a dialogue tagging network; the input module includes:
[0033] A first input submodule is configured to input the first dialogue information and the target role information into a pre-trained dialogue tag network to obtain first response information output by the dialogue tag network and containing label information;
[0034] The tag information is used to represent the marking information of each unit character in the first response information, and the tag information includes at least one of a deletion tag, a retention tag, and a text insertion position tag.
[0035] In some embodiments, the conversation model includes a conversation insertion network;
[0036] The input module further includes:
[0037] The second input submodule is configured to input the first response information into the dialogue insertion network to obtain the target response information output by the dialogue insertion network after adjusting the first response information according to the label information.
[0038] In some embodiments, the apparatus further includes a training module configured to obtain the dialogue model through training in the following manner:
[0039] A sample training set is constructed according to virtual character samples and dialogue corpus pairs corresponding to the virtual character samples, wherein the dialogue corpus pairs include a first corpus pair associated with the virtual character corresponding to the virtual character sample selected from a target platform and a second corpus pair of the virtual character in a source work; the dialogue model is trained according to the training sample set until the dialogue model has the ability to generate information characterizing the dialogue style of the virtual character sample.
[0040] In some embodiments, the training module includes:
[0041] A first mining submodule is configured to mine candidate corpus pairs associated with the virtual character from the target platform, wherein the candidate corpus pairs include candidate dialogue information and candidate reply information;
[0042] The first determination submodule is configured to determine the candidate corpus pair where the candidate reply information is located as the first corpus pair when the similarity between the candidate reply information and the second reply information included in the second corpus pair is greater than a first preset threshold.
[0043] In some embodiments, the training module includes:
[0044] A second mining submodule is configured to mine candidate corpus pairs associated with the virtual character from the target platform, the candidate corpus pairs including candidate dialogue information and candidate reply information;
[0045] A third input submodule is configured to input the candidate reply information into a dialogue identification model to obtain an identification value representing whether the candidate reply information is the source reply information included in the source work;
[0046] The second determining submodule is configured to determine the candidate corpus pair containing the candidate reply information whose identification value is greater than a second preset threshold as the first corpus pair.
[0047] According to a fourth aspect of an embodiment of the present disclosure, a device for training a dialogue model is provided, the device comprising:
[0048] A first execution module is configured to construct a sample training set according to a virtual character sample and a dialogue corpus pair corresponding to the virtual character sample, wherein the dialogue corpus pair includes a first corpus pair associated with the virtual character corresponding to the virtual character sample selected from a target platform and a second corpus pair of the virtual character in a source work;
[0049] The second execution module is configured to train the dialogue model according to the training sample set until the dialogue model has the ability to generate information representing the dialogue style of the virtual character sample.
[0050] According to a fifth aspect of an embodiment of the present disclosure, there is provided a dialogue replying device, including:
[0051] processor;
[0052] a memory for storing processor-executable instructions;
[0053] Wherein, the processor is configured to:
[0054] Obtain the first dialogue information input by the user;
[0055] Inputting the first dialogue information and target role information into a pre-trained dialogue model to obtain target response information output by the dialogue model in response to the first dialogue information;
[0056] The target response information is information representing the dialogue style of the target character.
[0057] According to a sixth aspect of an embodiment of the present disclosure, there is provided a training device for a dialogue model, comprising:
[0058] processor;
[0059] a memory for storing processor-executable instructions;
[0060] Wherein, the processor is configured to:
[0061] Constructing a sample training set according to a virtual character sample and a dialogue corpus pair corresponding to the virtual character sample, wherein the dialogue corpus pair includes a first corpus pair associated with a virtual character corresponding to the virtual character sample selected from a target platform and a second corpus pair of the virtual character in a source work;
[0062] The dialogue model is trained according to the training sample set until the dialogue model has the ability to generate information representing the dialogue style of the virtual character sample.
[0063] According to a seventh aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the dialogue reply method provided in the first aspect of the present disclosure or the steps of the dialogue model training method provided in the second aspect of the present disclosure are implemented.
[0064] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0065] By obtaining the first dialogue information input by the user, and inputting the first dialogue information and the target character information into the pre-trained dialogue model, the target response information output by the dialogue model to reply to the first dialogue information is obtained. The target response information is information that characterizes the dialogue style of the target character. By adopting the method disclosed in the present invention, for any first dialogue information input by the user, a more natural and accurate target response information can be replied in the dialogue style (dialogue characteristics) of the target character.
[0066] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0068] Figure 1 The figure is a flow chart of a conversation reply method according to an exemplary embodiment of the present disclosure.
[0069] Figure 2 The present invention is a flowchart of a dialogue model training according to an exemplary embodiment of the present invention.
[0070] Figure 3 A framework of a dialogue model is shown according to an exemplary embodiment of the present disclosure.
[0071] Figure 4 It is a flow chart of a method for training a dialogue model according to an exemplary embodiment of the present disclosure.
[0072] Figure 5 The figure is a block diagram of a conversation replying device according to an exemplary embodiment of the present disclosure.
[0073] Figure 6 It is a block diagram of a training device for a dialogue model according to an exemplary embodiment of the present disclosure.
[0074] Figure 7 It is a block diagram of a device (general structure of a mobile terminal) according to an exemplary embodiment of the present disclosure.
[0075] Figure 8 FIG. 1 is a block diagram of another device according to an exemplary embodiment of the present disclosure. (General structure of a server). DETAILED DESCRIPTION
[0076] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0077] In the related technologies, there are technical solutions for intelligent dialogues of virtual characters, such as Microsoft Xiaoice's Avatar Framework. Based on reading and studying the original novels, Microsoft's Avatar Framework rebuilt the architecture and knowledge system of the virtual world in 100 novels, expanded and supplemented it, and thus established a knowledge graph containing a large number of characters, entities and various knowledge related. Based on the established knowledge graph, Microsoft Xiaoice Avatar Framework brings the protagonist IPs of 100 novels into the real world, and brings dialogues, voices, skills based on their unique personalities to the virtual characters, as well as the ability to create works such as literature, music, and painting, as well as the corresponding knowledge system. However, any protagonist IP obtained in this way still has limitations when it comes to free dialogue with users.
[0078] Before describing the technical solution of the present invention in detail, the following is a brief introduction to the Microsoft XiaoIce Avatar Framework in the related art.
[0079] The Avatar Framework mainly consists of four components. The first is the Profile tool, which is used to define the personality of AI beings in terms of IQ and EQ. The second is the computing tool, which is used to adjust the core dialogue engine, computer speech, computer vision and other capabilities for AI beings. The third is the knowledge tool (i.e., knowledge graph), which is used to give AI beings the three views, knowledge, skills, etc., so that AI beings are closer to human characteristics. The fourth is the 3D image driver, which is used to drive a 3D model to make a virtual AI being appear in front of people.
[0080] During the training process of Avatar Framework, 100 novel texts were used. However, the character-related dialogue corpus in novels is very limited, and the character-related dialogue corpus in novels may not be directly used as the training corpus of Avatar Framework. Therefore, the virtual character model trained in this way always has dialogue limitations when conducting open human-computer dialogue, that is, the virtual character model cannot cope with other application scenarios besides the architecture and knowledge system of the virtual world in the novel.
[0081] The limitations of character dialogue corpus mean that it is necessary to compensate by manually writing corpus or collecting general dialogue corpus. However, the former means unintelligence and high labor costs, while the latter means that the virtual character model loses consistency and immersion in the personality and character background. The reason is that general dialogue corpus will make the responses generated by the model general.
[0082] In view of this, the embodiments of the present disclosure provide a dialogue reply method and device, a dialogue model training method and device, and a storage medium to solve the above problems.
[0083] The technical solution of the present disclosure is described in detail below with reference to embodiments.
[0084] Figure 1 is a flow chart of a conversation reply method according to an exemplary embodiment. Figure 1 As shown, the conversation reply method can be applied to electronic devices, such as mobile terminals or servers. Mobile terminals include mobile phones, notebooks, tablet computers, desktop computers, POS machines, etc. Servers include local servers and cloud servers. The conversation reply method can specifically include the following steps.
[0085] In step S11, first dialogue information input by the user is obtained.
[0086] The first dialogue information input by the user can be voice information or text information. It is easy to understand that the voice information and the text information can be converted.
[0087] The first dialogue information may be a dialogue information in the form of a question or a dialogue information in a non-question form.
[0088] In step S12, the first dialogue information and target role information are input into a pre-trained dialogue model to obtain target response information output by the dialogue model in response to the first dialogue information.
[0089] The target response information is information representing the dialogue style of the target character.
[0090] It should be noted that the first dialogue information and the target role information are input into the pre-trained dialogue model to obtain the target response information output by the dialogue model to reply to the first dialogue information, including: when the dialogue model is trained by a sample training set corresponding to a virtual role, the first dialogue information is directly input into the dialogue model to obtain the target response information of the target role for replying to the first dialogue information; or, when the dialogue model is trained by multiple sample training sets corresponding to multiple virtual roles, the first dialogue information and the target role information are input into the dialogue model to obtain the target response information for replying to the first dialogue information. That is, the target role information can be the information input by the user to select the target role for dialogue, or it can be the target role information pre-set in the dialogue model. This disclosure does not impose specific restrictions on this.
[0091] The dialogue model in the above dialogue reply method is trained in the following way:
[0092] A sample training set is constructed according to virtual character samples and dialogue corpus pairs corresponding to the virtual character samples, wherein the dialogue corpus pairs include a first corpus pair associated with the virtual character corresponding to the virtual character sample selected from a target platform and a second corpus pair of the virtual character in a source work; the dialogue model is trained according to the training sample set until the dialogue model has the ability to generate information characterizing the dialogue style of the virtual character sample.
[0093] In some possible implementations, the user group corresponding to the virtual character sample may be determined first, and the dialogue interaction information when the user group plays the virtual character corresponding to the virtual character sample may be obtained. The platform where the user group is located is the target platform, and the target platform may be one or more platforms. The dialogue interaction information may represent the first corpus pair associated with the virtual character. A sample training set corresponding to the virtual character sample is generated based on the first corpus pair and the source dialogue interaction information of the virtual character in the source work, wherein the source dialogue interaction information is the second corpus pair of the virtual character in the source work; the dialogue model is obtained by training based on the virtual character sample and the corresponding sample training set.
[0094] In the present disclosure, a virtual character may be a character in a novel, a character in a game, a virtual host (vtuber), or other virtual person. In one possible case, a virtual character may also be considered as a virtual person used to imitate a real person, and the present disclosure does not make any specific restrictions on this.
[0095] An implementation method for an electronic device to determine a user group corresponding to a virtual character sample, the electronic device searches for keywords of the virtual character sample based on a virtual character knowledge graph and / or a database, and determines the source work type and source work name corresponding to the virtual character sample according to the search results, the source work type including novels, games, virtual anchors, etc. The user group corresponding to the virtual character sample is determined according to the source work type and source work name of the virtual character sample, and the user group may be a certain novel reader, a certain game player, a certain anchor follower / subscriber, etc.
[0096] An implementation method of an electronic device determining a target platform where a user group is located, the electronic device determines the platform where the user group is located based on a preset correspondence between the user group type and the platform, and determines the target platform where the source work is published from these platforms based on the name of the source work corresponding to the virtual character sample. Examples of preset correspondences between user group types and platforms: when the user group type is novel readers, the platform is a novel reading platform, a novel forum, a novel discussion community, etc.; for another example, when the user group type is game players, the platform is a community corresponding to the game, the official website or official message area of the game, a tribe, etc. For another example, when the user group type is followers of a virtual anchor, the platform can be a live broadcast platform where the virtual anchor is located.
[0097] A specific implementation method for determining the user group corresponding to a virtual character sample. After determining a target platform, the user group that interacts with the source work of the virtual character sample (e.g., user clicks, views, downloads, comments, forwards, and subscribes to the source work) can be screened from the user database of the target platform with the legal authorization of the target platform.
[0098] Furthermore, the electronic device obtains the historical conversation data of these user groups from the background database of the target platform. Based on the source reply information of a small number of existing virtual character samples, candidate reply information similar to the source reply information is screened out from the historical conversation data, and the candidate conversation information associated with the candidate reply information and the candidate reply information are used as candidate corpus pairs associated with the virtual character mined from the target platform. A first corpus pair that meets the requirements can be further screened out from the candidate corpus pairs.
[0099] For example, when the virtual character sample is a character in a novel, the reader of the novel can be determined as the user group corresponding to the virtual character sample. When the virtual character sample is a character in a game work, the player of the game work can be determined as the user group corresponding to the virtual character sample. When the virtual character sample is a vtuber, the followers / viewers / consumers of the vtuber can be determined as the user group corresponding to the virtual character sample. Taking the game manufacturer Mihoyo as an example, its self-developed Mihosha app has gathered a large number of Mihoyo game player groups, so the users of the Mihosha app can be determined as Mihoyo's user group. Accordingly, the Mihosha app where the user group is located is the target platform. In addition, on social or video platforms such as Weibo, BiliBili, and Douyin, Mihoyo also has public accounts or official channels with millions of fans, and the followers or subscribers of these public accounts or official channels can also be used as Mihoyo's user groups. Accordingly, social or video platforms such as Weibo, BiliBili, and Douyin are target platforms.
[0100] After determining the user group corresponding to the virtual character sample, the dialogue interaction information when the user group plays the virtual character corresponding to the virtual character sample can be obtained. The corresponding sample training set is generated based on the obtained dialogue interaction information and the source dialogue interaction information of the virtual character in the source work. The dialogue model can be trained based on the virtual character sample and the sample training set.
[0101] By adopting the above method of the present disclosure, by obtaining the first dialogue information input by the user, and inputting the first dialogue information and the target character information into the pre-trained dialogue model, the target response information output by the dialogue model to reply to the first dialogue information is obtained. The target response information is information that characterizes the dialogue style of the target character. By adopting this method of the present disclosure, for any first dialogue information input by the user, a more natural and accurate target response information can be replied in the dialogue style (personality characteristics) of the target character.
[0102] Furthermore, since the sample training set of the dialogue model can be generated based on the dialogue interaction information of the user group when playing the virtual character corresponding to the virtual character sample and the source dialogue interaction information of the virtual character sample in the source work, the dialogue model obtained based on the sample training set is more effective than the model trained only based on the source dialogue interaction information in the source work. The use of this method disclosed in the present invention can avoid the limitations of human-computer dialogue. For any first dialogue information input by the user, more natural and accurate target response information can be replied with the personality characteristics of the target character.
[0103] In some embodiments, obtaining the dialogue interaction information when the user group plays the virtual character corresponding to the virtual character sample includes:
[0104] The electronic device pushes the solicitation activity information to the account or terminal device (or mailbox) associated with the user group; and obtains the dialogue interaction information fed back by the user group in response to the solicitation activity information. In some possible implementations, the solicitation activity information may be role-playing activity information, and the solicitation activity information is used to obtain candidate corpus pairs from the user group.
[0105] Because users such as the voice actors, readers, players, and fans of virtual characters love the virtual characters, they may actively imitate the characteristics of the virtual characters (or quote / repeat a sentence of the virtual characters) on their homepages to make relevant and appropriate dynamic posts or comments. Therefore, in some embodiments, the acquisition of the dialogue interaction information when the user group plays the virtual characters corresponding to the virtual character samples also includes:
[0106] The conversation interaction information related to the virtual character is identified and obtained from the content published by the account associated with the user group. In some possible implementations, the content published by the account associated with the user group may be microblogs, blogs, WeChat updates, etc. published by the social media account associated with the user group.
[0107] The step of pushing the solicitation activity information to the terminal devices of the user group includes: pushing preset dialogue information related to the solicitation activity information to the terminal devices of the user group, wherein the preset dialogue information is used to guide the user group to reply to the preset dialogue information by imitating the dialogue characteristics of the virtual character. Accordingly, the step of obtaining the dialogue interaction information of the user group in response to the solicitation activity information includes: obtaining the response information of the user group in response to the preset dialogue information in response to the solicitation activity information, wherein the dialogue interaction information includes the preset dialogue information and the response information, wherein the response information is the response information of the user imitating the virtual character.
[0108] Specifically, the electronic device can push preset dialogue information for collecting activity information to the user group to guide the user group to reply to the preset dialogue information based on imitating the personality style of the virtual character sample. By obtaining the response information used by the user group to reply to the preset dialogue information, dialogue interaction information including the preset dialogue information and the response information can be obtained.
[0109] In some embodiments, pushing the solicitation activity information to the terminal of the user group includes: pushing the solicitation activity information to the user group, and instructing the user group to participate in the solicitation activity by publishing information with a preset identifier; accordingly, obtaining the conversation interaction information of the user group in response to the solicitation activity includes: obtaining the conversation interaction information carrying the identifier of the solicitation activity published by the user group in the background database of the target platform, the conversation interaction information includes preset conversation information and response information published by users, wherein the response information is response information of users imitating the virtual character.
[0110] For example, without actively pushing the preset dialogue information of the solicitation activity to the terminal of the user group, only the solicitation activity information can be pushed to the user group, and the user group can be instructed to participate in the role-playing activity by carrying the preset identifier. In this way, the dialogue interaction information carrying the identifier of the solicitation activity published by the user group can be obtained by identifying the topic identifier of the role-playing activity. The style of the preset dialogue information published by the user in the dialogue interaction information can be the style of any role (including the virtual role sample), but the response information published by the user in the dialogue interaction information should be the response information of the virtual role corresponding to the virtual role sample imitated by the user. In some possible implementations, the preset identifier can be a predetermined symbol, such as a # sign, etc., and the preset identifier can be used to represent the topic related to the preset virtual role.
[0111] In some embodiments, the step of filtering the first corpus pair associated with the virtual character from the target platform includes:
[0112] Mining candidate corpus pairs associated with the virtual character from the target platform, the candidate corpus pairs including candidate dialogue information and candidate reply information; when the similarity between the candidate reply information and the second reply information included in the second corpus pair is greater than a first preset threshold, determining the candidate corpus pair in which the candidate reply information is located as the first corpus pair.
[0113] In a possible implementation, the second corpus pair includes second dialogue information and second reply information. The candidate corpus pair includes candidate dialogue information and candidate reply information. After mining the candidate corpus pair associated with the virtual character from the target platform, if the similarity between the candidate reply information and the second reply information is greater than a first preset threshold, the candidate corpus pair in which the candidate reply information is located can be determined as the first corpus pair.
[0114] Since the candidate response information in the candidate corpus is collected from the user group, the candidate response information may include information that does not meet the character setting requirements (or dialogue style) of the virtual character sample. Therefore, it is necessary to filter out the first response information that meets the character setting requirements of the virtual character sample from the candidate response information to improve the accuracy of dialogue model training.
[0115] For example, Figure 2 As shown, the steps of dialogue model training may include:
[0116] In step S21, candidate corpus pairs associated with the virtual character are mined from the target platform, the candidate corpus pairs including candidate dialogue information and candidate reply information;
[0117] In step S22, when the similarity between the candidate reply information and the second reply information included in the second corpus pair is greater than a first preset threshold, the candidate corpus pair in which the candidate reply information is located is determined as the first corpus pair;
[0118] In step S23, a second corpus pair of the virtual character in the source work is obtained;
[0119] In step S24, a sample training set is constructed according to the virtual character sample and the dialogue corpus pair corresponding to the virtual character sample, wherein the dialogue corpus pair includes a first corpus pair associated with the virtual character corresponding to the virtual character sample selected from the target platform and a second corpus pair of the virtual character in the source work;
[0120] In step S25, the dialogue model is trained according to the training sample set until the dialogue model has the ability to generate information representing the dialogue style of the virtual character sample.
[0121] The present disclosure does not limit the sequence of the above steps S21 and S23.
[0122] In another possible implementation, the step of selecting the first corpus pair associated with the virtual character from the target platform includes:
[0123] Mining candidate corpus pairs associated with the virtual character from the target platform, the candidate corpus pairs including candidate dialogue information and candidate reply information; inputting the candidate reply information into a dialogue identification model to obtain an identification value representing whether the candidate reply information is the source reply information included in the source work; and determining the candidate corpus pair containing the candidate reply information having the identification value greater than a second preset threshold as the first corpus pair.
[0124] In a possible implementation, first candidate reply information whose similarity with the source reply information of the virtual character sample is greater than a first preset threshold can be determined from the candidate reply information. Then, the first candidate reply information is input into a dialogue identification model (a correlation dialogue model) to obtain an identification value representing whether the first candidate reply information is the source reply information included in the source work, and the candidate corpus pair where the first candidate reply information with an identification value greater than a second preset threshold is located is determined as the first corpus pair.
[0125] It is worth mentioning that the dialogue identification model is trained by positive sample corpus and negative sample corpus of virtual character samples.
[0126] In some embodiments, the dialogue model includes a dialogue tagging network; inputting the first dialogue information and the target role information into a pre-trained dialogue model to obtain target response information output by the dialogue model in response to the first dialogue information includes:
[0127] Inputting the first dialogue information and the target role information into a pre-trained dialogue tag network to obtain first response information output by the dialogue tag network and containing label information;
[0128] The tag information is used to represent the marking information of each unit character in the first response information, and the tag information includes at least one of a deletion tag, a retention tag, and a text insertion position tag.
[0129] In some embodiments, the conversation model includes a conversation insertion network;
[0130] The step of inputting the first dialogue information and the target role information into a pre-trained dialogue model to obtain the target response information output by the dialogue model in response to the first dialogue information further includes:
[0131] The first response information is input into the dialogue insertion network, and the target response information output by the dialogue insertion network is obtained by adjusting the first response information according to the label information.
[0132] In one possible implementation, see Figure 3 In the present disclosure, the dialogue model includes an encoder, a role template matcher, and a decoder; the inputting the first dialogue information and the target role information into the dialogue model includes:
[0133] The first dialogue information is input into the encoder to obtain a first dialogue feature vector; the first dialogue feature vector and the number of the target character are input into the role template matcher to obtain a second response information template of the target character; the second response information template is input into the decoder to obtain the second response information.
[0134] The decoder includes a dialogue tagging network and a dialogue insertion network, and the decoder is used to perform the following operations:
[0135] The second response information template is input into the dialogue insertion network to label each unit text in the second response information template to obtain the labeled second response information template, wherein the label includes at least one of a deletion label, a retention label, and a text insertion position label; the labeled second response information template is input into the dialogue insertion network to perform corresponding operations on the labeled second response information template according to each labeled label to obtain the target response information.
[0136] For example, the first dialogue information X={x1, ..., xN} is input into the encoder to obtain the first dialogue feature vector H={h1, ..., hN}. This process can be represented as H = Encoder(X). The first dialogue feature vector H={h1, ..., hN} and the target character number, such as number A, are input into the role template matcher. The role template matcher matches (essentially, matches and scores H and each dialogue model through a text matching model) a second response information template from the M original dialogue templates (lines) related to the character A based on the constraint of the first dialogue feature vector H={h1, ..., hN}. This process can be represented as T = argmax t∈[1,M] (RoleMatch(H, t) )H. The second response information template is input into the dialogue tagging network in the decoder. The dialogue tagging network labels each unit text (such as unit character, unit word, sentence, etc.) in the second response information template. The label can be a deletion label, a retention label, or a text insertion position label. The labeled second response information template is input into the dialogue insertion network in the decoder. The dialogue insertion network performs corresponding operations on the labeled second response information template according to the labeled labels to obtain the second response information. This process can be represented as Y = Decoder(H, T).
[0137] It is worth noting that, when the annotated second response information template includes a text insertion position label, the new content inserted at the text insertion position is predicted by the dialogue insertion network.
[0138] In summary, a dialogue model with superior effects lies in that the output of the dialogue model can make the user think of the target role selected by the user for the dialogue at the first time. That is, the output of the dialogue model is highly consistent with the tone of the lines or the personality style of the target role. In the related art, the traditional seq2seq dialogue model is used to generate response information one word at a time from scratch in an autoregressive generation manner until a complete response sentence is obtained. This method is very time-consuming. However, the above-mentioned dialogue model disclosed in the present invention is adopted. Since the dialogue model disclosed in the present invention is a non-autoregressive model, that is, the dialogue model disclosed in the present invention selects a template from multiple response templates to delete, retain, and insert new words to obtain the target response information, so the dialogue model disclosed in the present invention can improve the efficiency of dialogue replies. The response speed of the dialogue model disclosed in the present invention is much faster than the seq2seq dialogue model based on the related art.
[0139] Based on the same inventive concept, the disclosed embodiment also provides a method for training a dialogue model, such as Figure 4 As shown, the method comprises the following steps:
[0140] In step S31, a sample training set is constructed according to a virtual character sample and a dialogue corpus pair corresponding to the virtual character sample, wherein the dialogue corpus pair includes a first corpus pair associated with a virtual character corresponding to the virtual character sample selected from a target platform and a second corpus pair of the virtual character in a source work;
[0141] In step S32, the dialogue model is trained according to the training sample set until the dialogue model has the ability to generate information representing the dialogue style of the virtual character sample.
[0142] By adopting this training method, a dialogue model can be trained to respond to any first dialogue information input by the user with more natural and accurate target response information in the dialogue style (personality characteristics) of the target character.
[0143] Based on the same inventive concept, the disclosed embodiment also provides a dialogue replying device, such as Figure 5 As shown, the dialogue replying device 300 includes an acquisition module 310 and an input module 320 .
[0144] An acquisition module 310 is configured to acquire first dialogue information input by a user;
[0145] The input module 320 is configured to input the first dialogue information and the target character information into a pre-trained dialogue model to obtain the target response information output by the dialogue model in reply to the first dialogue information; wherein the target response information is information characterizing the dialogue style of the target character.
[0146] The dialogue reply device 300 of the present disclosure is used to obtain the first dialogue information input by the user, and input the first dialogue information and the target character information into the pre-trained dialogue model to obtain the target response information output by the dialogue model to reply to the first dialogue information. The target response information is information that characterizes the dialogue style of the target character. By using this method of the present disclosure, any first dialogue information input by the user can be replied with more natural and accurate target response information in the dialogue style (personality characteristics) of the target character.
[0147] In some embodiments, the dialogue model includes a dialogue tagging network; the input module 320 includes:
[0148] A first input submodule is configured to input the first dialogue information and the target role information into a pre-trained dialogue tag network to obtain first response information output by the dialogue tag network and containing label information;
[0149] The tag information is used to represent the marking information of each unit character in the first response information, and the tag information includes at least one of a deletion tag, a retention tag, and a text insertion position tag.
[0150] In some embodiments, the conversation model includes a conversation insertion network;
[0151] The input module 320 further includes:
[0152] The second input submodule is configured to input the first response information into the dialogue insertion network to obtain the target response information output by the dialogue insertion network after adjusting the first response information according to the label information.
[0153] In some embodiments, the apparatus further includes a training module 330 configured to obtain the dialogue model through training in the following manner:
[0154] A sample training set is constructed according to virtual character samples and dialogue corpus pairs corresponding to the virtual character samples, wherein the dialogue corpus pairs include a first corpus pair associated with the virtual character corresponding to the virtual character sample selected from a target platform and a second corpus pair of the virtual character in a source work; the dialogue model is trained according to the training sample set until the dialogue model has the ability to generate information characterizing the dialogue style of the virtual character sample.
[0155] In some embodiments, the training module 330 includes:
[0156] A first mining submodule is configured to mine candidate corpus pairs associated with the virtual character from the target platform, wherein the candidate corpus pairs include candidate dialogue information and candidate reply information;
[0157] The first determination submodule is configured to determine the candidate corpus pair where the candidate reply information is located as the first corpus pair if the similarity between the candidate reply information and the second reply information included in the second corpus pair is greater than a first preset threshold.
[0158] In some embodiments, the training module 330 includes:
[0159] A second mining submodule is configured to mine candidate corpus pairs associated with the virtual character from the target platform, the candidate corpus pairs including candidate dialogue information and candidate reply information;
[0160] A third input submodule is configured to input the candidate reply information into a dialogue identification model to obtain an identification value representing whether the candidate reply information is the source reply information included in the source work;
[0161] The second determining submodule is configured to determine the candidate corpus pair containing the candidate reply information whose identification value is greater than a second preset threshold as the first corpus pair.
[0162] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0163] Based on the same inventive concept, the disclosed embodiment also provides a training device for a dialogue model, such as Figure 6 As shown, the device 400 includes:
[0164] A first execution module 410 is configured to construct a sample training set according to a virtual character sample and a dialogue corpus pair corresponding to the virtual character sample, wherein the dialogue corpus pair includes a first corpus pair associated with the virtual character corresponding to the virtual character sample selected from a target platform and a second corpus pair of the virtual character in a source work;
[0165] The second execution module 420 is configured to train the dialogue model according to the training sample set until the dialogue model has the ability to generate information representing the dialogue style of the virtual character sample.
[0166] By using this training device, a dialogue model can be trained to respond to any first dialogue information input by the user with more natural and accurate target response information in the dialogue style (personality characteristics) of the target character.
[0167] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the steps of the dialogue reply method or the dialogue model training method provided by the present disclosure.
[0168] Figure 7 8 is a block diagram of an apparatus 800 for dialogue reply or for training a dialogue model according to an exemplary embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0169] Reference Figure 7 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0170] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned dialogue reply method or dialogue model training method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0171] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0172] The power component 806 provides power to the various components of the device 800. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0173] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0174] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0175] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0176] The sensor assembly 814 includes one or more sensors for providing various aspects of the status assessment of the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0177] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0178] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the above-mentioned dialogue response method or dialogue model training method.
[0179] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to complete the above-mentioned dialogue reply method or dialogue model training method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0180] In another exemplary embodiment, a computer program product is also provided, which includes a computer program that can be executed by a programmable device, and the computer program has a code portion for executing the above-mentioned dialogue response method or dialogue model training method when executed by the programmable device.
[0181] Figure 8 1 is a block diagram of a device 1900 for another type of conversation reply according to an exemplary embodiment. For example, the device 1900 may be provided as a server. Figure 8 , the apparatus 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above-mentioned conversation reply method.
[0182] The device 1900 may also include a power supply component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input / output (I / O) interface 1958. The device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server 2000. TM , MacOS X TM , Unix TM , Linux TM , FreeBSD TM or similar.
[0183] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0184] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A conversation reply method, It is characterized in that The method comprises: Obtain the first dialogue information input by the user; Inputting the first dialogue information and target role information into a pre-trained dialogue model to obtain target response information output by the dialogue model in response to the first dialogue information; Wherein, the target response information is information representing the dialogue style of the target character; The dialogue model includes an encoder, a role template matcher, and a decoder, wherein the decoder includes a dialogue tagging network; The step of inputting the first dialogue information and the target role information into a pre-trained dialogue model to obtain target response information output by the dialogue model in reply to the first dialogue information includes: inputting the first dialogue information into the encoder to obtain a first dialogue feature vector; inputting the first dialogue feature vector and the target role information into the role template matcher to obtain a second response information template of the target role; inputting the second response information template into the dialogue tagging network to obtain first response information including label information output by the dialogue tagging network; wherein the label information is used to represent the annotation information of each unit character in the first response information, and the label information includes at least one of a deletion label, a retention label, and a text insertion position label.
2. The method according to claim 1, It is characterized in that The decoder also includes a dialogue insertion network; The step of inputting the first dialogue information and the target role information into a pre-trained dialogue model to obtain the target response information output by the dialogue model in reply to the first dialogue information further includes: The first response information is input into the dialogue insertion network, and the target response information output by the dialogue insertion network is obtained by adjusting the first response information according to the label information.
3. The method according to claim 1, It is characterized in that The dialogue model is trained in the following way: Constructing a sample training set according to a virtual character sample and a dialogue corpus pair corresponding to the virtual character sample, wherein the dialogue corpus pair includes a first corpus pair associated with a virtual character corresponding to the virtual character sample selected from a target platform and a second corpus pair of the virtual character in a source work; The dialogue model is trained according to the sample training set until the dialogue model has the ability to generate information representing the dialogue style of the virtual character sample.
4. The method according to claim 3, It is characterized in that The step of screening the first corpus pair associated with the virtual character from the target platform includes: mining candidate corpus pairs associated with the virtual character from the target platform, the candidate corpus pairs comprising candidate dialogue information and candidate reply information; When the similarity between the candidate reply information and the second reply information included in the second corpus pair is greater than a first preset threshold, the candidate corpus pair where the candidate reply information is located is determined as the first corpus pair.
5. The method according to claim 3, It is characterized in that The step of screening the first corpus pair associated with the virtual character from the target platform includes: mining candidate corpus pairs associated with the virtual character from the target platform, the candidate corpus pairs comprising candidate dialogue information and candidate reply information; Inputting the candidate reply information into a dialogue identification model to obtain an identification value indicating whether the candidate reply information is the source reply information included in the source work; The candidate corpus pair containing the candidate reply information whose identification value is greater than a second preset threshold is determined as the first corpus pair.
6. A method for training a dialogue model. It is characterized in that The method comprises: Constructing a sample training set according to a virtual character sample and a dialogue corpus pair corresponding to the virtual character sample, wherein the dialogue corpus pair includes a first corpus pair associated with a virtual character corresponding to the virtual character sample selected from a target platform and a second corpus pair of the virtual character in a source work; Training the dialogue model according to the sample training set until the dialogue model has the ability to generate information representing the dialogue style of the virtual character sample; The dialogue model includes an encoder, a role template matcher, and a decoder, and the decoder includes a dialogue tagging network; The trained dialogue model is used to: input the first dialogue information into the encoder to obtain a first dialogue feature vector; input the first dialogue feature vector and the target role information into the role template matcher to obtain a second response information template of the target role; input the second response information template into the dialogue tag network to obtain the first response information containing label information output by the dialogue tag network; wherein the label information is used to represent the annotation information of each unit character in the first response information, and the label information includes at least one of a deletion label, a retention label, and a text insertion position label.
7. A conversation reply device, It is characterized in that include: An acquisition module, configured to acquire first dialogue information input by a user; an input module configured to input the first dialogue information and target role information into a pre-trained dialogue model, and obtain target response information output by the dialogue model to reply to the first dialogue information; Wherein, the target response information is information representing the dialogue style of the target character; The dialogue model includes an encoder, a role template matcher, and a decoder, wherein the decoder includes a dialogue tagging network; The input module is configured to input the first dialogue information into the encoder to obtain a first dialogue feature vector; input the first dialogue feature vector and the target role information into the role template matcher to obtain a second response information template of the target role; input the second response information template into the dialogue tag network to obtain first response information containing label information output by the dialogue tag network; wherein the label information is used to represent the annotation information of each unit character in the first response information, and the label information includes at least one of a deletion label, a retention label, and a text insertion position label.
8. A training device for a dialogue model, It is characterized in that The device comprises: A first execution module is configured to construct a sample training set according to a virtual character sample and a dialogue corpus pair corresponding to the virtual character sample, wherein the dialogue corpus pair includes a first corpus pair associated with the virtual character corresponding to the virtual character sample selected from a target platform and a second corpus pair of the virtual character in a source work; a second execution module, configured to train the dialogue model according to the sample training set until the dialogue model has the ability to generate information representing the dialogue style of the virtual character sample; The dialogue model includes an encoder, a role template matcher, and a decoder, and the decoder includes a dialogue tagging network; The trained dialogue model is used to: input the first dialogue information into the encoder to obtain a first dialogue feature vector; input the first dialogue feature vector and the target role information into the role template matcher to obtain a second response information template of the target role; input the second response information template into the dialogue tag network to obtain the first response information containing label information output by the dialogue tag network; wherein the label information is used to represent the annotation information of each unit character in the first response information, and the label information includes at least one of a deletion label, a retention label, and a text insertion position label.
9. A conversation replying device, It is characterized in that include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: Obtain the first dialogue information input by the user; Inputting the first dialogue information and target role information into a pre-trained dialogue model to obtain target response information output by the dialogue model in response to the first dialogue information; Wherein, the target response information is information representing the dialogue style of the target character; The dialogue model includes an encoder, a role template matcher, and a decoder, wherein the decoder includes a dialogue tagging network; the first dialogue information and the target role information are input into the pre-trained dialogue model to obtain the target response information output by the dialogue model in reply to the first dialogue information, including: Input the first dialogue information into the encoder to obtain a first dialogue feature vector; input the first dialogue feature vector and the target character information into the role template matcher to obtain a second response information template of the target character; input the second response information template into the dialogue tag network to obtain first response information containing label information output by the dialogue tag network; wherein the label information is used to represent the annotation information of each unit character in the first response information, and the label information includes at least one of a deletion label, a retention label, and a text insertion position label.
10. A training device for a dialogue model, It is characterized in that include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: Constructing a sample training set according to a virtual character sample and a dialogue corpus pair corresponding to the virtual character sample, wherein the dialogue corpus pair includes a first corpus pair associated with a virtual character corresponding to the virtual character sample selected from a target platform and a second corpus pair of the virtual character in a source work; Training the dialogue model according to the sample training set until the dialogue model has the ability to generate information representing the dialogue style of the virtual character sample; The dialogue model includes an encoder, a role template matcher, and a decoder, and the decoder includes a dialogue tagging network; The trained dialogue model is used to: input the first dialogue information into the encoder to obtain a first dialogue feature vector; input the first dialogue feature vector and the target role information into the role template matcher to obtain a second response information template of the target role; input the second response information template into the dialogue tag network to obtain the first response information containing label information output by the dialogue tag network; wherein the label information is used to represent the annotation information of each unit character in the first response information, and the label information includes at least one of a deletion label, a retention label, and a text insertion position label.
11. A computer readable storage medium having computer program instructions stored thereon, It is characterized in that When the program instructions are executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
