Method for generating large model of human setup and method for generating human setup

Through multi-task learning and multi-step circular training, the problem of homogeneity of big model personality design is solved, personalization and consistency of multi-personal descriptions are achieved, and user experience and brand image are improved.

CN120407713APending Publication Date: 2025-08-01CHINA ELECTRONICS CYBERSPACE RESEARCH INSTITUTE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410123914.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-29
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

The existing large-scale model adopts a single-task method in character processing, resulting in homogeneity among different character designs, affecting the personalization and consistency of the model.

Method used

The human design model is trained using multi-task learning and multi-step looping. The general module and multiple task branch modules are shared through the converter, and the Q&A data of different target and non-target human designs are processed separately to ensure that each human design is independently trained and output.

Benefits of technology

The generated target character description is more in line with the characteristics of their respective styles, and the non-target character description is versatile, which improves the personalization and anthropomorphic performance of the model, and enhances the user experience and brand image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407713A_ABST
    Figure CN120407713A_ABST
Patent Text Reader

Abstract

The invention provides a human setup big model generation method and a human setup generation method.The human setup big model generation method comprises the steps that a first training set comprising a plurality of target dialogue data sets and non-target dialogue data sets is obtained, and each dialogue data set comprises a plurality of question and answer pairs composed of question prompts and corresponding answers; the first training set is used for training a preset man-set-large model in a multi-step circulation mode, the trained man-set-large model is obtained, and the man-set-large model comprises a converter sharing universal module and a plurality of task branch modules connected with the converter sharing universal module; the converter sharing general module is used for inputting question and answer pair data corresponding to a plurality of different target persons and a plurality of different non-target persons to the task branch modules, and the task branch modules are used for outputting answers corresponding to question prompts described by the different target persons. And corresponding answers are prompted according to the questions described by a plurality of different non-target persons and the universal persons.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing technology, and in particular, to a method for generating a personal profile large model and a method for generating a personal profile. Background Art

[0002] In the era of self-media, "personal profile" is a very common term. Excellent bloggers often rely on successful personal profile building. The same is true for large models. As products that "interact" with people, they should not present a cold atmosphere, but release emotions, radiate warmth, and have their own speaking styles.

[0003] The importance of a personal profile for a large model is mainly reflected in the following aspects:

[0004] 1) Improving user experience: The personal profile makes the large model have more humanized features, making it easier for users to interact with the large model. This humanized interaction method can improve the user experience and increase the user's trust and dependence on the large model;

[0005] 2) Improving model performance: The construction of a personal profile requires in-depth understanding and analysis of user needs and usage habits, which helps the large model better understand and meet user needs, and improve the model's performance;

[0006] 3) Enhancing brand image: The personal profile is an important part of the brand image. A personal profile that conforms to the brand image can enhance the brand's popularity and reputation, and increase user loyalty to the brand;

[0007] 4) Promoting dissemination and promotion: The personal profile can attract users' attention and interest through elements such as stories, emotions, and values, thereby promoting the dissemination and promotion of the large model;

[0008] 5) Enhancing competitiveness: In the field of artificial intelligence, the personal profile has become one of the important signs to distinguish different large models. An excellent personal profile can enhance the competitiveness of the large model and make it more attractive in the market;

[0009] In summary, the importance of the personal profile for the large model is self-evident. A successful personal profile can improve the performance, user experience, brand image, dissemination and promotion effect, and market competitiveness of the large model. Therefore, when designing and developing a large model, the factor of the personal profile should be fully considered to make the personal profile one of the key factors for the success of the large model.

[0010] Currently, large models represented by gpt for generating personal profiles all adopt a single-task method in personal profile processing, which will cause mutual influence between different personal profiles, resulting in the problem of "homogenization" between different personal profiles. Summary of the Invention

[0011] In view of this, embodiments of the present invention provide a method for generating a persona large model and a method for generating a persona to eliminate or improve one or more defects existing in the prior art.

[0012] One aspect of the present invention provides a method for generating a persona large model, the method comprising:

[0013] Obtaining a first training set, the first training set including a plurality of target dialogue data sets for respectively describing a plurality of different target personas and a non-target dialogue data set for describing a plurality of different non-target personas, wherein each target dialogue data set and non-target dialogue data set includes a plurality of question-and-answer pairs composed of question prompts and corresponding answers;

[0014] Using the first training set to train a preset persona large model in a multi-step loop manner to obtain a trained persona large model, the persona large model including a transformer shared general module and a plurality of task branch modules connected to the transformer shared general module, the transformer shared general module being configured to respectively input the question-and-answer pair data corresponding to the plurality of different target personas and the plurality of different non-target personas to the plurality of task branch modules, and the plurality of task branch modules being configured to respectively output the answers corresponding to the question prompts of the persona descriptions of the plurality of different target personas and the answers corresponding to the question prompts of the general persona descriptions of the plurality of different non-target personas.

[0015] In some embodiments of the present invention, the transformer shared general module includes an embedding layer, a position encoding layer, a dropout layer, a plurality of generative pre-trained transformer (GPT) blocks, and a layer normalization layer connected in sequence;

[0016] Each task branch module includes a fully connected layer and a softmax layer connected to the fully connected layer, and a plurality of fully connected layers are connected to the layer normalization layer, wherein the embedding layer serves as the input of the persona large model, and a plurality of softmax layers respectively serve as the plurality of outputs of the persona large model.

[0017] In some embodiments of the present invention, using the first training set to train a preset persona large model in a multi-step loop manner includes:

[0018] In each training round, respectively inputting the corresponding batch of question-and-answer pair data in each target dialogue data set and the non-target dialogue data set into the preset persona large model for iterative training, wherein the question-and-answer pair data input in each batch of the non-target dialogue data set is the question-and-answer pair data corresponding to one of the plurality of different non-target personas.

[0019] In some embodiments of the present invention, the data volumes of the Q&A pairs in the respective target dialogue data sets of the multiple different target personas and in the non-target dialogue data set are in a balanced state, and the data volumes of the Q&A pairs corresponding to the respective different non-target personas in the non-target dialogue data set are in a balanced state.

[0020] In some embodiments of the present invention, obtaining a first training set includes:

[0021] Using a pre-trained generative chat model to obtain, in a dialogue manner, multiple Q&A pairs corresponding to each of the multiple different target personas and the multiple different non-target personas, thereby obtaining the multiple target dialogue data sets and the non-target dialogue data set; and / or,

[0022] Using an optical character recognition technology to recognize and extract the subtitles of a large number of film and television resources, and forming multiple Q&A pairs corresponding to each of the multiple different target personas and the multiple different non-target personas from multiple segments of conversations of the respective characters, thereby obtaining the multiple target dialogue data sets and the non-target dialogue data set; and / or,

[0023] Using a web crawler technology to crawl the dialogue data related to the persona descriptions of the multiple different target personas and the multiple different non-target personas from a large number of network resource platforms, and forming multiple Q&A pairs corresponding to each of the multiple different target personas and the multiple different non-target personas from the dialogue data, thereby obtaining the multiple target dialogue data sets and the non-target dialogue data set.

[0024] In some embodiments of the present invention, the method further includes:

[0025] Obtaining a validation set, where the validation set includes multiple target dialogue data sets used to respectively describe the multiple different target personas, each target dialogue data set includes multiple Q&A pairs composed of question prompts and corresponding answers, and the target personas in the validation set are the same as those in the first training set;

[0026] Inputting the question prompts of the persona descriptions of the target personas in the validation set into the trained persona large model, so that the trained persona large model outputs corresponding answers;

[0027] Validating the output answers. If the answers are inaccurate for the persona descriptions corresponding to the corresponding question prompts, correcting the answers, and forming a second training set from the Q&A pairs composed of the corrected answers and the corresponding question prompts;

[0028] The trained personality model is further trained using the second training set in a multi-step cycle, and the steps of obtaining the validation set and further training are repeated until a personality model is obtained that can accurately output the answers corresponding to the question prompts describing the personality of each of the multiple different target personalities.

[0029] In some embodiments of the present invention, the second training set is used to further train the trained character model in a multi-step cycle, including:

[0030] In each training round, the corresponding batch of question-answer pair data in each target dialogue dataset is input into the trained persona model for iterative training.

[0031] In some embodiments of the present invention, obtaining a validation set includes:

[0032] Using a pre-trained chat model to generate a chat model, a plurality of question-answer pairs corresponding to each of the plurality of different target personas are obtained in a conversational manner, thereby obtaining the plurality of target conversation data sets; and / or,

[0033] Using text recognition technology to identify and extract subtitles from a large number of film and television resources, and forming multiple dialogues of characters corresponding to multiple different target personas extracted therefrom into multiple question-answer pairs corresponding to the multiple different target personas, thereby obtaining the multiple target dialogue data sets; and / or,

[0034] Crawler technology is used to crawl a large number of network resource platforms with conversation data related to the personality descriptions of the multiple different target personalities, and the conversation data is formed into multiple question-answer pairs corresponding to each of the multiple different target personalities, thereby obtaining the multiple target conversation data sets.

[0035] Another aspect of the present invention provides a method for generating a character, the method comprising:

[0036] Obtaining question prompts corresponding to a plurality of different target personas and a plurality of different non-target personas, wherein the question prompts are used to describe the corresponding personas;

[0037] The question prompts corresponding to each different target persona or different non-target persona are input into the trained persona model obtained using the aforementioned persona model generation method, so that the trained persona model generates answers for describing the corresponding persona.

[0038] On the other hand, the present invention provides an electronic device, which includes: a computer device, the computer device includes a processor and a memory, computer instructions are stored in the memory, and the processor is configured to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device implements the steps of the foregoing method.

[0039] On the other hand, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the steps of the foregoing method.

[0040] On the other hand, the present invention provides a computer program product, including computer instructions. When the computer instructions are executed by a processor, they implement the steps of the foregoing method.

[0041] The method for generating a persona large model and the method for generating a persona of the present invention. The method for generating a persona large model continuously iteratively trains the persona large model of the multi-task architecture through multi-task learning and multi-step loops, so that the learning of the persona large model for the persona description data corresponding to multiple different personas is independent of each other and does not interfere with each other. As a result, the finally trained persona large model can generate multiple different personas, and the corpus of the persona description of the generated target persona is more in line with the style characteristics of the corresponding target persona, with both personalization, and is more advantageous in terms of character consistency, anthropomorphism, and attractiveness. At the same time, it can also generate a corpus of general persona descriptions for non-target personas.

[0042] The additional advantages, objectives, and features of the present invention will be partially described below, and will become partially apparent to those of ordinary skill in the art after studying the following text, or can be learned from the practice of the present invention. The objectives and other advantages of the present invention can be achieved and obtained through the structures specifically pointed out in the specification and the drawings.

[0043] Those skilled in the art will understand that the objectives and advantages that can be achieved by the present invention are not limited to the above specifically described, and the above and other objectives that the present invention can achieve will be more clearly understood according to the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The drawings described herein are used to provide a further understanding of the present invention, form a part of this application, and do not limit the present invention.

[0045] Figure 1 It is a schematic flowchart of an implementation manner of the method for generating a persona large model of the present invention;

[0046] Figure 2 It is a schematic diagram of the network architecture of the persona large model of the present invention;

[0047] Figure 3 Schematic flowchart of another implementation manner of the method for generating a character model of the present invention;

[0048] Figure 4 Schematic flowchart of an implementation manner of the method for generating a character of the present invention. Specific implementation manner

[0049] To make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in conjunction with the implementation manners and the accompanying drawings. Herein, the illustrative implementation manners of the present invention and their descriptions are used to explain the present invention, but do not limit the present invention.

[0050] Herein, it should also be noted that in order to avoid obscuring the present invention due to unnecessary details, only the structures and / or processing steps closely related to the solution of the present invention are shown in the drawings, while other details less related to the present invention are omitted.

[0051] It should be emphasized that the term "including / comprising" when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

[0052] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

[0053] In order to avoid the problem of "homogenization" between different characters caused by processing and learning the character description data of multiple different characters in a single-task learning manner during the training process of the current generation model for generating multiple different characters, an embodiment of the present invention proposes a method for generating a character large model and a method for generating a character based on multi-task learning. The single-task learning manner is to output the relevant data of the character descriptions of all different characters through the same fully connected layer and softmax layer, which will cause interference and influence between different characters. Therefore, it is necessary to use the multi-task learning manner to separate different characters for separate training.

[0054] Figure 1 Schematic flowchart of a method for generating a character large model according to an embodiment of the present invention. As Figure 1 shown, the method for generating a character large model includes the following steps:

[0055] Step S110, obtaining a first training set, where the first training set includes a plurality of target dialogue data sets for respectively describing a plurality of different target characters and a non-target dialogue data set for describing a plurality of different non-target characters. Among them, each target dialogue data set and non-target dialogue data set includes a plurality of question-answer pairs composed of question prompts and corresponding answers.

[0056] Specifically, multiple target personas could be common and frequently used characters such as doctors, schoolteachers, and lawyers. Therefore, there are abundant character descriptions of these characters in various life and work scenarios, making it easy to obtain a large amount of character description data corresponding to these target personas. Multiple non-target personas could be rare and infrequently used characters such as hypnotists and morticians. Therefore, there are relatively few character descriptions of these characters in various life and work scenarios, resulting in limited character description data available for these non-target personas. Character description data can include descriptions of the character's personality traits, appearance, experience, and background.

[0057] Specifically, the step of obtaining the first training set in step S110 includes the following:

[0058] Step S111, using the pre-trained chat model ChatGPT to obtain multiple question-answer pairs corresponding to the multiple different target personas and the multiple different non-target personas in a conversational manner, thereby obtaining the multiple target conversation data sets and the non-target conversation data sets; and / or,

[0059] Step S112, using optical character recognition (OCR) technology to identify and extract subtitles from a large number of film and television resources, and converting the extracted multiple dialogues of characters corresponding to the multiple different target characters and the multiple different non-target characters into multiple question-answer pairs corresponding to the multiple different target characters and the multiple different non-target characters, thereby obtaining the multiple target dialogue data sets and the non-target dialogue data sets; and / or,

[0060] Step S113, using crawler technology to crawl conversation data related to the personality descriptions of the multiple different target personas and the multiple different non-target personas from a large number of network resource platforms, and forming the conversation data into multiple question-answer pairs corresponding to the multiple different target personas and the multiple different non-target personas, thereby obtaining the multiple target conversation data sets and the non-target conversation data sets.

[0061] Specifically, in the method of obtaining the first training set by using web crawler technology, for the target persona of doctors, by using web crawler technology to crawl the conversation data related to doctors on online medical consultation platforms, the online medical consultation platforms of affiliated hospitals, hospital websites, medical-related forums and other online resource platforms, the answers of the personas described as doctors in the conversation data can be used as the answers in the Q&A pairs, and the sentence before the answer of the persona can be used as the question prompt, so as to form Q&A pairs for the persona description of the doctor role. For the target persona of lawyers, the conversation data of the corresponding personas described as lawyers can be crawled from online legal consultation platforms, law firm websites, forums and other online resource platforms. For the target persona of school teachers, the conversation data of the corresponding personas described as teachers can be crawled from various public platforms and school forums of the school. For other target personas and non-target personas, the conversation data that can form Q&A pairs for the corresponding personas can be crawled from the corresponding online resource platforms.

[0062] Through any combination of the above several methods of obtaining the first training set, a large number of rich conversation data for the persona descriptions of different target personas and different non-target personas for training the persona large model can be obtained. The conversation data for training the model can make the persona description data generated by the finally trained persona large model more in line with the styles of their respective personas.

[0063] To ensure the balance of each different persona, in the first training set, the data volumes of the Q&A pairs in the target conversation data sets of the multiple different target personas and the non-target conversation data set are in a balanced state, and the data volumes of the Q&A pairs corresponding to each different non-target persona in the non-target conversation data set are in a balanced state. For example, the data volume ratio of the persona description data (Q&A pairs) in the target conversation data sets of the multiple different target personas and the non-target conversation data set can be 1:1:…:1, and the data volume ratio of the persona description data (Q&A pairs) corresponding to each different non-target persona can also be 1:1:…:1.

[0064] Step S120, using the first training set to train a preset persona large model in a multi-step loop manner to obtain a trained persona large model. The persona large model includes a shared transformer general module and a plurality of task branch modules connected to the shared transformer general module. The shared transformer general module is used to input the Q&A pair data corresponding to the multiple different target personas and the multiple different non-target personas to the plurality of task branch modules respectively. The plurality of task branch modules are used to output the answers corresponding to the question prompts of the persona descriptions of the multiple different target personas respectively, and the answers corresponding to the question prompts of the general persona descriptions of the multiple different non-target personas.

[0065] Specifically, such as Figure 2As shown, the converter sharing common module includes an embedding layer, a positional encoding layer, a Dropout layer, multiple Generative Pretrained Transformer (GPT) blocks, and a layer normalization layer, which are connected in sequence; each task branch module includes a fully connected layer and a softmax layer connected to the fully connected layer, and multiple fully connected layers are connected to the layer normalization layer. Among them, the embedding layer serves as the input of the persona large model, and multiple softmax layers serve as multiple outputs of the persona large model respectively. In the network structure of this persona large model, multiple task branch modules are in a parallel relationship and are connected to the same converter sharing common module. By inputting the data of multiple different target personas and non-target persona data in the first training set into the corresponding task branch modules through the converter sharing common module respectively, different personas can utilize the common knowledge of the converter sharing common module (transformer module), thus avoiding the waste of computing resources caused by the generation of multiple personas and greatly improving the computing efficiency. At the same time, the fully connected layer and softmax layer in each independent task branch module can be used for the prediction output of multiple personas, making different personas independent of each other and not interfering with each other, so as to be more in line with the styles of their respective personas.

[0066] Among them, the step of training the preset persona large model in a multi-step loop manner using the first training set in step S120 specifically includes the following steps:

[0067] Step S121: In each training round, input the corresponding batch of question-and-answer pair data in each target dialogue dataset and the non-target dialogue dataset into the preset persona large model for iterative training. Among them, the question-and-answer pair data input in each batch of the non-target dialogue dataset is the question-and-answer pair data corresponding to one of the multiple different non-target personas.

[0068] That is to say, during the loop training process of multiple training rounds, all the Q&A pair data in the non-target dialogue dataset that contains the corresponding persona descriptions of multiple non-target personas are input into the same task branch module in batches through the shared general module of the persona large model's transformer. One batch corresponds to all the Q&A pair data of one non-target persona. All batches can correspond to all the Q&A pair data of each different non-target persona, or can also correspond to all the Q&A pair data of some different non-target personas. The Q&A pair data in each target dialogue dataset that contains the corresponding persona descriptions of their respective target personas are input into the corresponding task branch modules in batches during multiple iteration processes through the shared general module of the persona large model's transformer. Suppose the multiple non-target personas include the first non-target persona, the second non-target persona, …… the Nth non-target persona, and the multiple target personas include the first target persona, the second target persona, …… the Nth target persona. Then the multiple task branch modules include the first task branch module, the second task branch module, …… the Nth task branch module, and the (N + 1)th task branch module. Then, in the first training round, the data of the first batch batch1 of the first target persona are input in the first iteration iter1 for training the first task branch module. The data of the first batch batch1 of the second target persona are input in the second iteration iter2 for training the second task branch module. …… The data of the first batch batch1 of the Nth target persona are input in the Nth iteration iterN for training the Nth task branch module. The data of all the first non-target persona are input in the (N + 1)th iteration iterN+1 for training the (N + 1)th task branch module. Similarly, in the second training round, the data of the second batch batch2 of all the target personas and the data of all the second non-target persona are input in multiple steps in the above process in a loop, and so on, until the specified number of training rounds, that is, the training round number threshold epoch, is reached. The data of all batches of all the target personas and the data of all or some of the non-target personas are input into the preset persona large model, so as to complete the independent and non-interfering training of each task branch module. Finally, the softmax layer of each task branch module in the persona large model outputs data corresponding to different personas. That is, during the model training process, different personas correspond to different fully connected layers and softmax layers (task branch modules), making the finally generated different personas independent of each other, non-interfering and non-influencing each other, making the different target personas have more distinct persona style characteristics of their own. At the same time, for non-target personas, the common and general persona style characteristics shared by multiple different non-target personas can be generated.

[0069] Figure 3 It is a schematic flowchart of a method for generating a persona large model according to another embodiment of the present invention. As Figure 3As shown, in order to verify the results of the personas generated by the above-trained persona large model, so as to continuously iterate and optimize the model, and make the persona corpus generated by the continuously iteratively optimized persona large model more conform to the style characteristics of the corresponding personas, the method for generating the persona large model may further include the following steps:

[0070] Step S130, obtain a validation set, where the validation set includes multiple target dialogue data sets for respectively describing the multiple different target personas. Each target dialogue data set includes multiple question-and-answer pairs composed of question prompts and corresponding answers. The target personas in the validation set are the same as those in the first training set.

[0071] Specifically, the specific way to obtain the validation set is the same as that to obtain the first training set.

[0072] Step S140, input the question prompts of the persona descriptions of the target personas in the validation set into the trained persona large model, so that the trained persona large model outputs corresponding answers.

[0073] Step S150, verify the output answers. If the answers are inaccurate for the persona descriptions corresponding to the question prompts, correct the answers, and form a second training set with the corrected answers and the question prompts corresponding to them.

[0074] Specifically, the correction in step S150 is performed by manual verification, and the answers with inaccurate persona descriptions are modified to be more in line with the accurate descriptions corresponding to the question prompts.

[0075] Step S160, use the second training set to further train the trained persona large model in a multi-step loop manner, and repeat the steps from obtaining the validation set to further training until a persona large model is obtained that can accurately output the answers corresponding to the question prompts of the persona descriptions of the multiple different target personas.

[0076] Specifically, through the multi-step loop training process in step S160, the accurate answers output by the finally obtained trained persona large model mean that the answers can further conform to the question prompts for the persona descriptions corresponding to the question prompts, and can more accurately describe the answers desired by the question prompts. By further training the persona large model, the accuracy of the model in generating corresponding persona descriptions can be further improved. Before further training the persona large model, the persona large model can output the answers corresponding to the question prompts in the general persona descriptions that can accurately describe multiple different non-target personas by performing multi-step loop training using the non-target dialogue data sets included in the first training set for describing multiple different non-target personas.

[0077] Specifically, the step of further training the trained persona large model in a multi-step loop using the second training set in step S160 includes the following steps:

[0078] Step S161, in each training round, input the question-and-answer pair data of each corresponding batch of the target dialogue datasets into the trained persona large model for iterative training respectively.

[0079] In another embodiment of the present invention, the training set can also be obtained first according to the specific steps of obtaining the first training set as described above, and then a part of the data in the training set is used as the first training set, and another part of the data is used as the validation set. When validating again, a new validation set is still obtained according to the same steps as obtaining the first training set.

[0080] Figure 4 It is a flowchart of a persona generation method according to an embodiment of the present invention. As Figure 4 shown, the persona generation method includes the following steps:

[0081] Step S410, obtain the question prompts corresponding to multiple different target personas and multiple different non-target personas respectively, where the question prompts are used to describe the corresponding personas;

[0082] Step S420, input the question prompts corresponding to each different target persona or different non-target persona into the trained persona large model obtained by using the aforementioned persona large model generation method, so that the trained persona large model generates answers for describing the corresponding personas.

[0083] The method for generating a persona large model and the method for generating a persona according to an embodiment of the present invention. The method for generating a persona large model continuously iteratively trains the persona large model of a multi-task architecture through multi-task learning and multi-step loops, so that the learning of the persona large model for persona description data corresponding to multiple different personas is independent of each other and there is no interference between them. As a result, the finally trained persona large model can generate multiple different personas, and the corpus of the persona description of the generated target persona is more in line with the style characteristics of the corresponding target persona, with both personalization, and is more advantageous in terms of character consistency, anthropomorphism, and attractiveness. At the same time, it can also generate a corpus of general persona descriptions for non-target personas. Specifically, for character consistency, the personas generated by this method can exhibit stable attributes and behaviors during interaction, which can ensure the consistency of the attributes and behaviors of the conversational AI character in the dialogue, and is of great significance for winning user satisfaction and trust. For character anthropomorphism, the personas generated by this method behave naturally in the interaction with users, similar to the natural interaction between people. Human-like conversational AI characters are indispensable for improving user acceptance and promoting more natural and attractive conversations. For character attractiveness, the personas generated by this method can arouse user interest and promote user participation in the dialogue, making the conversation interesting during the chat process and making people want to continue chatting, improving the user experience. The above advantages fully reflect the high performance of the persona large model generated by the method for generating a persona large model according to an embodiment of the present invention.

[0084] Correspondingly, an electronic device according to an embodiment of the present invention includes a computer device. The computer device includes a processor and a memory. Computer instructions are stored in the memory, and the processor is configured to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device implements the steps of the foregoing method.

[0085] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the foregoing method. The computer-readable storage medium may be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the art.

[0086] An embodiment of the present invention further provides a computer program product, including computer instructions. When the computer instructions are executed by a processor, they implement the steps of the foregoing method.

[0087] Those of ordinary skill in the art should understand that the various exemplary components, systems, and methods described in connection with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Specifically, whether to implement in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, and so on. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium or transmitted through a data signal carried in a carrier wave on a transmission medium or a communication link.

[0088] It should be clear that the present invention is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present invention is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order between steps after understanding the spirit of the present invention.

[0089] In the present invention, the features described and / or illustrated for one embodiment can be used in the same or a similar manner in one or more other embodiments, and / or combined with the features of other embodiments or replace the features of other embodiments.

[0090] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, various changes and modifications can be made to the embodiments of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for generating a character model, characterized in that, The method includes: Obtain a first training set, where the first training set includes multiple target dialogue data sets for respectively describing multiple different target personas and a non-target dialogue data set for describing multiple different non-target personas. Among them, each target dialogue data set and non-target dialogue data set includes multiple question-and-answer pairs composed of question prompts and corresponding answers; Use the first training set to train a preset persona large model in a multi-step loop manner to obtain a trained persona large model. The persona large model includes a transformer shared general module and multiple task branch modules connected to the transformer shared general module. The transformer shared general module is used to respectively input the question-and-answer pair data corresponding to the multiple different target personas and the multiple different non-target personas into the multiple task branch modules. The multiple task branch modules are used to respectively output the answers corresponding to the question prompts of the persona descriptions of the multiple different target personas, and the answers corresponding to the question prompts of the general persona descriptions of the multiple different non-target personas.

2. The method according to claim 1, wherein The transformer shared general module includes an embedding layer, a position encoding layer, a dropout layer, multiple generative pre-trained transformer (GPT) blocks, and a layer normalization layer connected in sequence; Each task branch module includes a fully connected layer and a softmax layer connected to the fully connected layer. The multiple fully connected layers are connected to the layer normalization layer. Among them, the embedding layer serves as the input of the persona large model, and the multiple softmax layers respectively serve as the multiple outputs of the persona large model.

3. The method according to claim 1, wherein Using the first training set to train a preset persona large model in a multi-step loop manner includes: In each training round, input the corresponding batch of question-and-answer pair data in each target dialogue data set and the non-target dialogue data set into the preset persona large model for iterative training. Among them, the question-and-answer pair data input in each batch of the non-target dialogue data set is the question-and-answer pair data corresponding to one of the multiple different non-target personas.

4. The method according to claim 1, characterized in that The data volumes of the question-and-answer pairs in the respective target dialogue data sets of the multiple different target personas and the non-target dialogue data set are in an equilibrium state, and the data volumes of the question-and-answer pairs corresponding to the different non-target personas in the non-target dialogue data set are in an equilibrium state.

5. The method according to claim 1, characterized in that Obtaining the first training set includes: Using a pre-trained generative chat model to obtain multiple question-and-answer pairs corresponding to the multiple different target personas and the multiple different non-target personas respectively in a dialogue manner, so as to obtain the multiple target dialogue data sets and the non-target dialogue data set; and / or, Using an optical character recognition technology to recognize and extract the subtitles of the video resources, and forming multiple question-and-answer pairs corresponding to the multiple different target personas and the multiple different non-target personas respectively from the multiple conversations of the characters corresponding to the multiple different target personas and the multiple different non-target personas extracted therefrom, so as to obtain the multiple target dialogue data sets and the non-target dialogue data set; and / or, Using web crawler technology to crawl the dialogue data related to the persona descriptions of the multiple different target personas and the multiple different non-target personas in the network resource platform, and forming the dialogue data into multiple question-and-answer pairs corresponding to the multiple different target personas and the multiple different non-target personas respectively, so as to obtain the multiple target dialogue datasets and the non-target dialogue datasets.

6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: Obtaining a validation set, the validation set includes multiple target dialogue datasets used to respectively describe the multiple different target personas, each target dialogue dataset includes multiple question-and-answer pairs composed of question prompts and corresponding answers, and the target personas in the validation set are the same as those in the first training set; Inputting the question prompts of the persona descriptions of the target personas in the validation set into the trained persona large model, so that the trained persona large model outputs corresponding answers; Verifying the output answers, if the answers are inaccurate for the persona descriptions corresponding to the question prompts, then correcting the answers, and forming the question-and-answer pairs composed of the corrected answers and the corresponding question prompts into a second training set; Using the second training set to further train the trained persona large model in a multi-step loop manner, and by repeating the steps of obtaining the validation set to further training until a persona large model capable of accurately outputting the answers corresponding to the question prompts of the persona descriptions of the multiple different target personas is obtained.

7. A character setting generation method, characterized in that, The method includes: Obtaining question prompts corresponding to multiple different target personas and multiple different non-target personas respectively, the question prompts are used to describe the corresponding personas; Inputting the question prompts corresponding to each different target persona or different non-target persona into the trained persona large model obtained by using the method described in any one of claims 1 to 6, so that the trained persona large model generates answers for describing the corresponding personas.

8. An electronic device, comprising a processor and a memory, characterized in that, The memory stores computer instructions, and the processor is configured to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device implements the steps of the method described in any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method described in any one of claims 1 to 7.

10. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, it implements the steps of the method described in any one of claims 1 to 7.