Anthropomorphic dialogue data enhancement method and related device

By extracting anthropomorphic features and generating data enhancement methods for high -quality dialogue samples, the problem of insufficient data and poor quality in the anthropomorphic dialogue system, enhanced automated data of anthropomorphic dialogue, improved the training effect of the model and the model of the model performance.

CN119336876AInactive Publication Date: 2025-01-21BEIJING LIXIN INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202411897788.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-01-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Anthropomorphic dialogue systems face the problems of insufficient data volume and poor quality, which makes it difficult for the model to learn real interpersonal dialogue patterns and personalized characteristics, and the existing technology lacks effective data cleaning and denoising methods.

Method used

Provide an anthropomorphic dialogue data enhancement method. By obtaining the first training data of multiple rounds of anthropomorphic dialogue from the training data set, based on the anthropomorphic analysis model to extract the anthropomorphic characteristics, generate second and third dialogue samples, and conduct quality assessment. Update to the training data set.

Benefits of technology

It realizes automated data enhancement processing of anthropomorphic dialogue, improves the data enhancement efficiency of model training data, enriches the diversity of anthropomorphic dialogue while ensuring the quality of training data, and improves model training effect and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336876A_ABST
    Figure CN119336876A_ABST
Patent Text Reader

Abstract

The invention relates to the field of data processing, in particular to an anthropomorphic dialogue data enhancement method and a related device. The method comprises the following steps: acquiring first training data of multiple rounds of anthropomorphic dialogues from a training data set; analyzing and extracting the first training data based on the anthropomorphic analysis model to obtain anthropomorphic features corresponding to the first training data and a first dialogue sample; generating a second dialogue sample based on the anthropomorphic feature; the character dialogue styles of the second dialogue sample and the first dialogue sample are consistent; dialogue content in the first dialogue sample is regenerated based on the anthropomorphic features, and a third dialogue sample is obtained; and performing quality evaluation on the second dialogue sample and the third dialogue sample, and updating the dialogue sample passing the quality evaluation into the training data set as second training data. According to the method, automatic data enhancement processing can be performed on the anthropomorphic dialogue, the data enhancement efficiency of the model training data is improved, the diversity of the anthropomorphic dialogue is enriched under the condition of ensuring the quality of the training data, and the model training effect and the model performance are further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a method for enhancing data of anthropomorphic dialogue and related devices. Background Art

[0002] With the rapid development of artificial intelligence technology, dialogue systems based on large language models have penetrated into people's daily lives and work. In particular, significant progress has been made in the research and application of task-based dialogue systems. However, the research and implementation of anthropomorphic dialogue systems face many challenges. Anthropomorphic dialogue systems are designed to simulate conversations between different characters and maintain a high degree of consistency with the simulated characters' personality, speaking style, background, etc. in different dialogue scenarios and topics. This kind of system not only requires the dialogue system to have an in-depth understanding of characters, relationships, and knowledge, but also requires the use of technical means such as supervised learning to obtain high-quality and highly realistic dialogue capabilities.

[0003] In the related technologies, although supervised learning is an important technical means for anthropomorphic dialogue systems to obtain high-quality and highly realistic dialogue capabilities, there are still many difficulties and problems that need to be solved in the actual training process. For example, insufficient data volume and poor quality are one of the main challenges facing anthropomorphic dialogue systems. The existing supervised learning (SFT) stage requires a serious shortage of high-quality multi-round dialogue annotation data. Most existing data sets are aimed at general large-scale model tasks rather than specialized anthropomorphic dialogues. This makes it difficult for the model to learn real interpersonal dialogue patterns and personalized features. The workload of manual annotation is large, and it is difficult to quickly expand the data scale, which seriously restricts the training effect of the model.

[0004] Therefore, it is urgent to propose a new technical solution to solve at least one of the above technical problems. Summary of the invention

[0005] In response to the technical problems existing in the prior art, the present application provides a data enhancement method and related devices for anthropomorphic dialogues, so as to realize automatic data enhancement processing of anthropomorphic dialogues, improve the data enhancement efficiency of model training data, enrich the diversity of anthropomorphic dialogues while ensuring the quality of training data, and help to further improve the model training effect and model performance.

[0006] In a first aspect, an embodiment of the present application provides a method for data enhancement of anthropomorphic dialogue, the method comprising: Acquire first training data of multiple rounds of anthropomorphic dialogue from a training data set; the first training data at least includes: text data and / or sound data; Analyze and extract the first training data based on the anthropomorphic analysis model to obtain anthropomorphic features and a first dialogue sample corresponding to the first training data; the first dialogue sample is a training data segment containing the anthropomorphic features in the first training data; generating a second dialogue sample based on the anthropomorphic feature; wherein the second dialogue sample has a consistent dialogue style with the character in the first dialogue sample; Regenerate the dialogue content in the first dialogue sample based on the anthropomorphic features to obtain a third dialogue sample; the third dialogue sample has a consistent dialogue style with the character in the first dialogue sample; The second dialogue sample and the third dialogue sample are quality evaluated, and the dialogue samples that pass the quality evaluation are updated into the training data set as second training data.

[0007] In a second aspect, an embodiment of the present application provides a data enhancement device for anthropomorphic dialogue, the device comprising at least the following units: An acquisition unit is configured to acquire first training data of multiple rounds of anthropomorphic dialogues from a training data set; the first training data at least includes: text data and / or sound data; an extraction unit configured to analyze and extract the first training data based on an anthropomorphic analysis model to obtain an anthropomorphic feature and a first dialogue sample corresponding to the first training data; the first dialogue sample is a training data segment containing the anthropomorphic feature in the first training data; A first generating unit is configured to generate a second dialogue sample based on the anthropomorphic feature; the second dialogue sample has a consistent character dialogue style with the first dialogue sample; A second generating unit is configured to regenerate the dialogue content in the first dialogue sample based on the anthropomorphic feature to obtain a third dialogue sample; the third dialogue sample has a consistent dialogue style with the character in the first dialogue sample; An evaluation unit is configured to perform quality evaluation on the second dialogue sample and the third dialogue sample, and update the dialogue samples that pass the quality evaluation into the training data set as second training data.

[0008] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising: at least one processor, memory, and input-output unit; The memory is used to store a computer program, and the processor is used to call the computer program stored in the memory to execute the data enhancement method for human-like dialogue of the first aspect.

[0009] In a fourth aspect, a computer-readable storage medium is provided, which includes instructions, and when the instructions are executed on a computer, the computer executes the data enhancement method for human-like dialogue of the first aspect.

[0010] The beneficial effect of the present application is that a method for data enhancement of anthropomorphic dialogue and a related device are provided. In the technical solution, first, the first training data of multiple rounds of anthropomorphic dialogue is obtained from the training data set. Wherein, the first training data at least includes: text data and / or sound data. Then, the first training data is analyzed and extracted based on the anthropomorphic analysis model to obtain the anthropomorphic features and the first dialogue sample corresponding to the first training data. Wherein, the first dialogue sample is a training data segment containing the anthropomorphic features in the first training data. Then, a second dialogue sample is generated based on the anthropomorphic features. The character dialogue style of the second dialogue sample is consistent with that of the first dialogue sample. Then, the dialogue content in the first dialogue sample is regenerated based on the anthropomorphic features to obtain a third dialogue sample; the character dialogue style of the third dialogue sample is consistent with that of the first dialogue sample. Finally, the second dialogue sample and the third dialogue sample are quality evaluated, and the dialogue sample that passes the quality evaluation is updated as the second training data to the training data set. The technical solution of this application realizes automatic data enhancement processing of anthropomorphic dialogues, improves the data enhancement efficiency of model training data, enriches the diversity of anthropomorphic dialogues while ensuring the quality of training data, and helps to further improve model training effects and model performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 It is a flowchart of a data enhancement method for anthropomorphic dialogue according to an embodiment of the present application; Figure 2 is a structural schematic diagram of a data enhancement device for anthropomorphic dialogue according to an embodiment of the present application; Figure 3 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application; Figure 4 It is a structural schematic diagram of a medium device according to an embodiment of the present application. DETAILED DESCRIPTION

[0012] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0013] With the rapid development of artificial intelligence technology, dialogue systems based on large language models have penetrated into people's daily lives and work. In particular, significant progress has been made in the research and application of task-based dialogue systems. However, the research and implementation of anthropomorphic dialogue systems face many challenges. Anthropomorphic dialogue systems are designed to simulate conversations between different characters and maintain a high degree of consistency with the simulated characters' personality, speaking style, background, etc. in different dialogue scenarios and topics. This kind of system not only requires the dialogue system to have an in-depth understanding of characters, relationships, and knowledge, but also requires the use of technical means such as supervised learning to obtain high-quality and highly realistic dialogue capabilities.

[0014] At present, although supervised learning is an important technical means for anthropomorphic dialogue systems to obtain high-quality and highly realistic dialogue capabilities, there are still many difficulties and problems that need to be solved in the actual training process.

[0015] First, insufficient data and poor data quality are one of the main challenges facing anthropomorphic dialogue systems. The existing supervised learning (SFT) stage requires a serious shortage of high-quality multi-round dialogue annotation data. Most existing datasets target general large-scale model tasks rather than specialized anthropomorphic dialogues. This makes it difficult for the model to learn real interpersonal dialogue patterns and personalized features. The workload of manual annotation is large, and it is difficult to quickly expand the data scale, which seriously restricts the training effect of the model.

[0016] Secondly, data noise and bias are another important problem faced by anthropomorphic dialogue systems. Manually labeled data inevitably contains noise, errors, and biases. These problems will have a negative impact on the learning of the model, resulting in the model being unable to accurately capture real dialogue patterns and character characteristics. Existing technologies lack effective data cleaning and denoising methods, making it difficult to ensure the quality and reliability of training data.

[0017] In addition, limited iterative optimization is also a problem that the anthropomorphic dialogue system needs to solve. In the reinforcement learning and training reward model stage, existing technologies rely heavily on manually labeled data for iteration and optimization. However, the scale of labeled data is difficult to increase significantly, which limits the model's ability to continuously improve. The lack of an effective automated feedback mechanism makes it difficult for the model to quickly adjust and optimize based on performance in actual applications.

[0018] Finally, data distribution bias is also a problem that anthropomorphic dialogue systems need to overcome. The performance of supervised learning models is easily affected by the distribution of training data. Existing technologies lack effective data augmentation methods, making it difficult to simulate diverse dialogue scenarios and character features. This results in the trained models not being stable and natural enough when faced with complex and changing actual dialogue environments.

[0019] In summary, although the anthropomorphic dialogue system is of great significance in simulating the personality, speaking style and background knowledge of different characters, the problems it faces in the training process, such as insufficient data, data noise and bias, limited iterative optimization and data distribution bias, still need further research and solution. Therefore, it is urgent to propose a new technical solution to solve at least one of the above technical problems.

[0020] In order to solve at least one technical problem in the related art, the embodiment of the present application provides a data enhancement method and a related device for anthropomorphic dialogue. In the technical solution, first, the first training data of multiple rounds of anthropomorphic dialogue is obtained from the training data set. Wherein, the first training data at least includes: text data and / or sound data. Then, the first training data is analyzed and extracted based on the anthropomorphic analysis model to obtain the anthropomorphic features and the first dialogue sample corresponding to the first training data. Wherein, the first dialogue sample is a training data segment containing the anthropomorphic features in the first training data. Then, a second dialogue sample is generated based on the anthropomorphic features. The character dialogue style of the second dialogue sample is consistent with that of the first dialogue sample. Then, the dialogue content in the first dialogue sample is regenerated based on the anthropomorphic features to obtain a third dialogue sample; the character dialogue style of the third dialogue sample is consistent with that of the first dialogue sample. Finally, the second dialogue sample and the third dialogue sample are quality evaluated, and the dialogue sample that passes the quality evaluation is updated as the second training data to the training data set.

[0021] The embodiments of the present application provide a systematic method to enhance the training data of anthropomorphic dialogues, thereby improving the performance and diversity of the anthropomorphic dialogue system. First, the first training data of multiple rounds of anthropomorphic dialogues is obtained from the training data set. By obtaining multiple rounds of dialogues from the training data set, it is possible to ensure that the generated dialogue samples cover different dialogue scenarios, emotional expressions, and topic ranges, thereby improving the diversity of the data. Obtaining the first training data including text data and sound data can provide the model with richer input information, which helps to better understand the character traits and speaking style of the characters. Multiple rounds of dialogues can better reflect the scenes of real dialogues, making the generated dialogues closer to the interaction mode in actual applications.

[0022] Secondly, the first training data is analyzed and extracted based on the anthropomorphic analysis model. The anthropomorphic analysis model can accurately extract anthropomorphic features in the first training data, such as personality traits, speaking style, background knowledge, and emotional state, and provide precise guidance for the subsequent generation of dialogues. The anthropomorphic features in the first training data are associated with the dialogue content to form a first dialogue sample (i.e., a training data segment containing anthropomorphic features), which helps the model better understand and learn these features. By extracting multiple anthropomorphic features, various aspects of the character can be described more comprehensively, thereby generating more realistic and natural dialogues.

[0023] Then, a second dialogue sample is generated based on the anthropomorphic features. The generated second dialogue sample is consistent with the character dialogue style of the first dialogue sample, ensuring that the generated dialogue is consistent with the character's personality and speaking habits. By adjusting the model temperature parameters, diverse dialogue content can be generated to increase the naturalness and richness of the dialogue. For example, for a reasoning character like Conan, the generated dialogue sample can demonstrate his reasoning ability, ensuring that the generated content is logically reasonable and in-depth.

[0024] Next, the conversation content in the first conversation sample is regenerated based on the anthropomorphic features to obtain a third conversation sample. Regenerating the conversation content in the first conversation sample can further enrich the training data set and increase the diversity and complexity of the conversation. When regenerating the conversation content, the conversation style of the characters in the first conversation sample is kept consistent to ensure that the generated conversation meets the anthropomorphic requirements in style. Through the context encoding and memory mechanism, the generated conversation is ensured to remain coherent and logically smooth in multiple rounds of interaction.

[0025] Finally, the second dialogue sample and the third dialogue sample are quality evaluated, and the dialogue samples that pass the quality evaluation are updated as the second training data to the training data set. For example, using automatic evaluation indicators such as BLEU, ROUGE, METEOR, DISTINCT, etc., the quality of the generated dialogue samples can be quickly and objectively evaluated to ensure that high-quality dialogue samples are screened out. Compared with manual evaluation, the embodiment of the present application can also more comprehensively check the performance of the generated dialogue samples in terms of consistency, coherence, emotional expression, etc., find problems and optimize them. Through quality evaluation, dialogue samples that do not meet the anthropomorphic requirements can be screened out to avoid the negative impact of low-quality data on model training, thereby improving the quality of the overall data set. Adding dialogue samples that pass the quality evaluation to the training data set can significantly increase the scale of the training data and improve the training effect of the model. By adding a variety of high-quality dialogue samples, the processing ability of the model in different dialogue scenarios can be enhanced, making it more flexible and adaptable. Retraining the dialogue model with the expanded data set can gradually optimize the generation ability of the model, making it perform better in anthropomorphic dialogues.

[0026] In summary, the embodiments of the present application can systematically enhance the training data of anthropomorphic dialogues, ensuring that the generated dialogues reach a high level in terms of style, content, coherence, and diversity, thereby improving the overall performance of the anthropomorphic dialogue system. The embodiments of the present application implement automated data enhancement processing for anthropomorphic dialogues, improve the data enhancement efficiency of model training data, enrich the diversity of anthropomorphic dialogues while ensuring the quality of training data, and help further improve the model training effect and model performance.

[0027] The technical solution of the present application and the data enhancement scheme for anthropomorphic dialogue provided in the embodiments of the present application can also be executed by an electronic device, which can be a server, a server cluster, or a cloud server. The electronic device can also be a terminal device such as a mobile phone, a computer, a tablet computer, a wearable device, or a dedicated device (such as a dedicated terminal device with a data enhancement method system for anthropomorphic dialogue). These electronic devices can also be equipped with the chips introduced in the above embodiments. Alternatively, these electronic devices can also be installed with a service program for executing the data enhancement scheme for anthropomorphic dialogue.

[0028] Figure 1 A flowchart of a data enhancement method for anthropomorphic dialogue provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method comprises the following steps: 101, obtaining first training data of multiple rounds of anthropomorphic dialogue from a training data set; 102, analyzing and extracting the first training data based on an anthropomorphic analysis model to obtain anthropomorphic features and a first dialogue sample corresponding to the first training data; 103, generating a second dialogue sample based on the anthropomorphic feature; 104, regenerating the dialogue content in the first dialogue sample based on the anthropomorphic feature to obtain a third dialogue sample; 105 , perform quality assessment on the second dialogue sample and the third dialogue sample, and update the dialogue samples that pass the quality assessment into the training data set as second training data.

[0029] In an embodiment of the present application, the training data set may include text and / or audio data of multiple rounds of dialogue, as well as annotation information, for training the dialogue generation model. The multiple rounds of anthropomorphic dialogue may be a dialogue sample including multiple rounds of interaction, each round of dialogue depends on the context of the previous round, and is coherent and logical.

[0030] It is understandable that the training dataset is a collection of data used to train the dialogue generation model. In an anthropomorphic dialogue system, the training dataset usually contains multiple rounds of dialogue samples, which can be in text or sound form. The main function of the training dataset is to provide a large amount of diverse real dialogue data so that the generation model can learn the dialogue style, personality traits and background knowledge of different characters.

[0031] For example, text data includes multiple rounds of dialogue texts between characters, such as the dialogue between Conan and Maori Kogoro, Conan and Haibara Ai, etc. Sound data includes recorded audio of character dialogues, with voice features and emotional expressions. Annotation data contains annotation information of the dialogue content, such as character identity, emotional state, and dialogue type (reasoning, daily, etc.).

[0032] It can be understood that multi-round anthropomorphic dialogue refers to a dialogue sample that contains multiple rounds of interactions during a dialogue process. Each round of dialogue is a back-and-forth communication between two (or more) parties in the dialogue. Multi-round dialogue can more comprehensively reflect the contextual information and coherence of the dialogue, making the generated dialogue more natural and real. Multi-round anthropomorphic dialogue contains multiple rounds of communication, and each round consists of one or more sentences. The content of the next round of dialogue depends on the content of the previous round of dialogue, and has a certain degree of coherence and logic. Multi-round anthropomorphic dialogue may contain a variety of emotional expressions, such as asking, answering, speculating, reasoning, etc. The performance of the characters in each round of anthropomorphic dialogue is consistent with its set characteristics, such as Conan's calmness and reasoning ability, and Haibara Ai's intelligence and introversion.

[0033] In the embodiment of the present application, the first training data includes at least: text data and / or sound data. The first training data refers to the initial data of multiple rounds of anthropomorphic dialogues obtained from the training data set, which are used in subsequent analysis and generation steps. These data provide a basis for subsequent anthropomorphic feature extraction, dialogue generation and quality assessment. Through systematic processing and analysis, high-quality anthropomorphic dialogue samples can be generated to further improve the performance and application effect of the dialogue system.

[0034] Text data is the content of a conversation recorded in text form, such as a series of text snippets of a conversation. An example could be, User: Conan, who do you think is the murderer of this case? Conan: Based on the footprints and perfume left at the scene, I have an inference. The murderer is likely to be a woman about 170cm tall, she should be left-handed, and she often goes to high-end places.

[0035] Sound data, which is the content of a conversation recorded in audio format, usually includes recordings of characters’ voice conversations. For example, a recording of a conversation between a user and Conan, where the user asks about the case and Conan makes inferences and answers.

[0036] As an optional embodiment, in 101, first training data of multiple rounds of anthropomorphic dialogues are obtained from a training data set. Specifically, the obtained multiple rounds of dialogue samples cover a variety of dialogue scenarios and character interactions, increasing the diversity of the data. Multiple rounds of dialogues contain rich contextual information, which helps the model learn the coherence and logic of the dialogue. This ensures that the obtained data can represent the interaction mode of real dialogues and improves the generalization ability of the model.

[0037] In practical applications, existing dialogue datasets can use public or multi-round dialogue datasets, such as movie scripts, novel dialogues, social media dialogues, etc. Self-built datasets collect dialogue data in specific scenarios through crawlers or manual work, such as reasoning dialogues in detective stories.

[0038] From the perspective of text data processing, word segmentation and word vectorization is to segment text data and convert it into word vectors for model processing. You can also use context encoding technology (such as BERT, Transformer) to encode text data and extract the context information of the conversation. Annotate text data, such as character identity, emotional state, conversation type, etc.

[0039] From the perspective of sound data processing, speech recognition technology is used to convert audio data into text data to facilitate subsequent text analysis. Speech features such as pitch, speaking speed, pauses, etc. are extracted from sound data to enhance the model's generation capabilities. Emotional analysis of sound data and extraction of emotional tags help the model learn emotional expression.

[0040] In 102, the first training data is analyzed and extracted based on an anthropomorphic analysis model to obtain anthropomorphic features and a first dialogue sample corresponding to the first training data.

[0041] In the embodiment of the present application, the first dialogue sample is a training data segment containing the anthropomorphic features in the first training data. These samples can effectively help the model learn and understand the dialogue style and personality characteristics of a specific person, so that these characteristics can be more accurately simulated when generating dialogues, thereby improving the naturalness and realism of the dialogue. After being processed by the anthropomorphic analysis model, these samples can more accurately reflect the dialogue style, personality characteristics and background knowledge of a specific person.

[0042] Anthropomorphic features refer to a series of attributes that can describe and reflect a specific character's personality, conversation style, emotional state, and background knowledge. These features are manifested in conversations as certain specific language patterns, word usage habits, emotional expressions, and logical reasoning. For example, for Conan in Detective Conan, anthropomorphic features may include: Calmness: Stay calm and reason clearly during tense cases.

[0043] Reasoning ability: Ability to make logical inferences and analyze from subtle clues.

[0044] Smart: Reacts quickly and provides reasonable hypotheses.

[0045] Specific terms: Explain using professional terms and scientific knowledge.

[0046] Emotional expression: Express different emotions in different situations, such as excitement, surprise, anger, etc.

[0047] The first training data segment is a conversation section that contains specific anthropomorphic features extracted from the first training data. These segments are usually one or more rounds of multiple rounds of conversations, and can independently show the anthropomorphic features of a specific character. For example, from the text data example above, the following first conversation sample can be extracted. Suppose a segment containing Conan's anthropomorphic features is extracted from the conversation data of "Detective Conan": User: Conan, who do you think is the murderer in this case? Conan: Based on the footprints and perfume left at the scene, I have a theory. The murderer is likely to be a woman about 170cm tall, she should be left-handed, and she often goes to high-end places.

[0048] In this clip, Conan's anthropomorphic features include: Reasoning ability: Infer from the footprints and perfume left at the scene.

[0049] Calm: Appear very calmly and logically when answering questions.

[0050] Specific terms: Use professional terms such as "footprints", "perfume", "left-handed", etc.

[0051] In an embodiment of the present application, a part of a multi-round anthropomorphic dialogue is one or several rounds in the dialogue, which can independently display the anthropomorphic features of a specific character. Each first dialogue sample contains extracted anthropomorphic features, which may be personality, style, emotion, background knowledge, and the like. Although the first dialogue sample is a fragment of the training data, it contains certain contextual information so that the model can understand the context of the conversation. Thus, it helps the model to better learn and understand the anthropomorphic features of a specific character, so that it can more accurately simulate these features when generating dialogues. Splitting long dialogue data into multiple fragments containing anthropomorphic features helps the model to learn each feature more focusedly. Ensure that the extracted dialogue fragments are of high quality and can be effectively used for subsequent dialogue generation and quality assessment.

[0052] As an optional embodiment, in 102, analyzing and extracting the first training data based on the anthropomorphic analysis model to obtain anthropomorphic features and a first dialogue sample corresponding to the first training data can be implemented as follows: The first training data is cleaned and formatted to obtain preprocessed first training data; the preprocessed first training data is input into the anthropomorphic analysis model to extract an anthropomorphic feature set consisting of multiple key features; and the first dialogue sample is extracted from the preprocessed first training data based on the anthropomorphic feature set.

[0053] First, the first training data needs to be preprocessed. The purpose of this step is to remove irrelevant information in the data to ensure the accuracy and consistency of the data. Specifically, irrelevant punctuation, special characters, and blank lines in the conversation will be deleted to reduce the impact of noise on subsequent analysis. At the same time, the data will be converted into a unified text format, such as JSON or CSV, for subsequent processing and analysis. During the conversion process, it will be ensured that each conversation has clear role labels to distinguish the speeches of different roles.

[0054] Next, the preprocessed first training data is input into the anthropomorphic analysis model. This model can be a pre-trained deep learning model, such as a Transformer-based model. The task of the model is to extract anthropomorphic features in the dialogue, which can reflect the character's reasoning ability, calmness, specific word habits, and emotional expression. Through the automatic extraction of the model, a set of anthropomorphic features containing multiple key features can be obtained.

[0055] Finally, based on the extracted set of anthropomorphic features, the dialogue segments that best reflect these features need to be selected as the first dialogue sample. The purpose of this step is to ensure that the selected dialogue samples can independently and fully demonstrate the anthropomorphic features of a specific character. Specifically, through feature matching, dialogue segments that simultaneously contain key features such as "reasoning ability", "calmness" and "specific words" are selected.

[0056] Through the above three steps, high-quality first dialogue samples can be effectively obtained from the first training data. These samples can not only reflect the key characteristics of the character, but also provide strong support for the subsequent dialogue generation model, further improving the performance and anthropomorphic effect of the model.

[0057] Further optionally, it is assumed that the anthropomorphic analysis model includes at least the following structures: a text feature extraction layer, a pattern recognition layer, a speech analysis layer, and a feature integration layer. Based on this, the inputting of the pre-processed first training data into the anthropomorphic analysis model to extract an anthropomorphic feature set consisting of multiple key features can be implemented as follows: 201, analyzing the preprocessed text data in the first training data through a text feature extraction layer to identify character features and first dialogue mode features in the text data; 202, analyzing the contextual relationship in the preprocessed first training data through the pattern recognition layer to obtain a second dialogue pattern feature derived from the contextual relationship; 203, performing feature analysis on the sound data in the preprocessed first training data through the speech analysis layer to obtain speech emotion features in the sound data; 204 , through a feature integration layer, the character features, the first dialogue mode features, the second dialogue mode features, and the voice emotion features are integrated to construct the anthropomorphic feature set.

[0058] In an embodiment of the present application, character characteristics include at least one of the following: personal information, personality characteristics, emotional state, voice characteristics, and knowledge background; dialogue mode characteristics include at least one of the following: greeting method, farewell method, inquiry method, answering method, emotional expression characteristics, request command method, and topic change method.

[0059] The construction of the anthropomorphic analysis model aims to deeply understand the character features and dialogue patterns in the dialogue data, so as to extract key features that can reflect the character's personality. The text feature extraction layer is mainly responsible for analyzing the preprocessed text data and identifying the character features and dialogue pattern features in the text. Through natural language processing (NLP) technologies such as word embedding, named entity recognition (NER), sentiment analysis, etc., the model can capture the vocabulary, grammar, and semantic information in the text. For example, through word embedding technology, the model can convert vocabulary into high-dimensional vectors to capture the semantic relationship between vocabulary. Through named entity recognition, the model can identify personal information in the text (such as name, age, occupation), and through sentiment analysis, the model can identify the emotional state in the text. The effect of this layer is that it can extract rich text features, including the character's personal information, personality characteristics, emotional state, and greeting and inquiry methods in the conversation.

[0060] The pattern recognition layer mainly analyzes the contextual relationship in the dialogue data and identifies the dialogue pattern features in the context. By analyzing the contextual relationship of the dialogue, the model can identify the topic switching, emotional changes, commands and requests in the dialogue. For example, if the user asks a question in the current dialogue and the character answers in a specific sentence pattern, the model can identify this question-answer dialogue pattern. The effect of this layer is that it can capture the contextual relationship in the dialogue, thereby extracting the second dialogue pattern features, such as the topic switching method, emotional expression characteristics, etc.

[0061] The speech analysis layer mainly performs feature analysis on the pre-processed sound data to identify the speech emotion features in the sound data. Through speech processing technologies such as spectral analysis, prosody analysis, and emotion recognition, the model can capture features such as pitch, volume, and speech speed in the speech, thereby identifying the speaker's speech emotion (such as happiness, sadness, anger, etc.). The effect of this layer is that it can extract emotional features in the speech, thereby enriching the anthropomorphic feature set.

[0062] The feature integration layer mainly integrates the features extracted by the text feature extraction layer, pattern recognition layer, and speech analysis layer to construct a complete anthropomorphic feature set. Through multimodal feature fusion technology, the model can integrate text features, pattern features, and speech features to form a comprehensive feature set. For example, if the model recognizes the emotional state in the text as "nervous", and the emotion in the speech is recognized as "trembling" through speech analysis, the feature integration layer can fuse these two features to form a more comprehensive description of the emotional state. The effect of this layer is that it can construct a multi-dimensional anthropomorphic feature set, thereby fully reflecting the character's personality traits and dialogue patterns.

[0063] Through the collaborative work of the above layers, the personification analysis model can extract rich features from multiple dimensions, thereby constructing a comprehensive personification feature set. The model can extract multiple features such as personal information, personality traits, emotional state, voice features, and knowledge background of the character, thereby comprehensively portraying the character's personality. By analyzing contextual relationships and voice features, the model can identify multiple dialogue mode features, such as greeting methods, farewell methods, questioning methods, answering methods, emotional expression features, request command methods, topic switching methods, etc., thereby reflecting the character's dialogue style. Through the feature integration layer, the model can fuse features at different levels to form a comprehensive feature set, thereby providing a multi-dimensional character description. By extracting and integrating these features, the model can generate more personified dialogue content, allowing the dialogue generation model to better simulate the character's language style and personality characteristics.

[0064] In summary, the multi-level structure and multimodal feature integration technology of the personification analysis model can effectively improve the personification effect of the dialogue generation model, making the generated dialogue content more natural, realistic, and more in line with the character's personality characteristics.

[0065] In 103, a second dialogue sample is generated based on the anthropomorphic feature. In the embodiment of the present application, the second dialogue sample has the same character dialogue style as the first dialogue sample.

[0066] As an optional embodiment, in 103, the anthropomorphic features are used as embedding vectors of an anthropomorphic dialogue generation model, and multiple rounds of anthropomorphic dialogues are generated by the anthropomorphic dialogue generation model as the second dialogue samples.

[0067] In the process of generating the second dialogue sample, the model aims to generate dialogue content consistent with the character dialogue style of the first dialogue sample based on the anthropomorphic features. Specifically, the model generates multiple rounds of anthropomorphic dialogues by inputting the anthropomorphic features as embedding vectors into the anthropomorphic dialogue generation model. First, the extracted anthropomorphic features are converted into embedding vectors as input to the anthropomorphic dialogue generation model. The anthropomorphic feature set contains a variety of features that can reflect the character's personality and dialogue style, such as reasoning ability, calmness, specific words, emotional expression, etc. These features can be converted into high-dimensional vectors through vectorization techniques (such as word embedding and feature embedding). The embedding vector can capture the semantic information of the features, allowing the model to consider the influence of these features when generating dialogues. In this way, by converting the anthropomorphic features into embedding vectors, the model can incorporate these features when generating dialogues, thereby generating dialogue content with a specific character dialogue style.

[0068] In an embodiment of the present application, the anthropomorphic dialogue generation model generates multiple rounds of anthropomorphic dialogues based on the embedding vector as the second dialogue sample. For example, the anthropomorphic dialogue generation model adopts a sequence-to-sequence (Seq2Seq) or Transformer-based structure. When the model generates a dialogue, it uses the embedding vector as a conditional input so that the generated dialogue content can reflect the features contained in the embedding vector. For example, if the embedding vector contains the feature of "reasoning ability", the model will be more inclined to generate sentences with reasoning nature when generating dialogues. The anthropomorphic dialogue generation model can generate multiple rounds of dialogues based on the features in the embedding vector, and these dialogues are consistent with the first dialogue sample in style and content. By inputting the anthropomorphic features as embedding vectors into the anthropomorphic dialogue generation model, the model can generate a second dialogue sample that is consistent with the character dialogue style of the first dialogue sample.

[0069] Since the anthropomorphic features include features that reflect the character's conversational style, the model can maintain a consistent conversational style with the first conversation sample when generating conversations. For example, if the character in the first conversation sample shows strong reasoning ability, the second conversation sample will also show similar reasoning characteristics in the conversation. By generating multiple rounds of conversations, the model can generate a series of diverse conversation content that is consistent in style but varies in details and topics, thereby enriching the diversity of the conversation. By incorporating anthropomorphic features, the model can generate more anthropomorphic conversation content, allowing the conversation generation model to better simulate the character's language style and personality characteristics. During the generation of multiple rounds of conversations, the model takes into account contextual information so that the generated conversations are consistent in logic and emotion, avoiding inconsistencies.

[0070] In summary, by inputting anthropomorphic features as embedding vectors into the anthropomorphic dialogue generation model, the model can generate a second dialogue sample that is consistent with the character dialogue style of the first dialogue sample. This generation method can not only maintain the consistency of the dialogue style, but also enhance the diversity and anthropomorphic effect of the dialogue, thereby improving the overall performance of the dialogue generation model.

[0071] Further optionally, in the above steps, using the anthropomorphic features as the embedding vectors of the anthropomorphic dialogue generation model, and generating multiple rounds of anthropomorphic dialogues through the anthropomorphic dialogue generation model as the second dialogue samples can be implemented as follows: The anthropomorphic features are converted into corresponding embedding vectors; a large language model used in the current environment is selected as the anthropomorphic dialogue generation model, and conditional generation parameters of the anthropomorphic dialogue generation model are set; prompt words matching the anthropomorphic features are used to adjust the dialogue style of the anthropomorphic dialogue generation model; the embedding vectors are input into the anthropomorphic dialogue generation model to generate multiple rounds of anthropomorphic dialogues with the same character dialogue style as the first dialogue sample as the second dialogue sample.

[0072] In the process of generating the second dialogue sample, the model aims to generate dialogue content consistent with the character dialogue style of the first dialogue sample based on the anthropomorphic features. Specifically, the model converts the anthropomorphic features into embedding vectors and combines them with a large language model for conditional generation to generate multiple rounds of anthropomorphic dialogues.

[0073] First, the extracted anthropomorphic features are converted into high-dimensional embedding vectors for input into the anthropomorphic dialogue generation model. The anthropomorphic feature set contains a variety of features that can reflect the character's personality and dialogue style, such as reasoning ability, calmness, specific words, emotional expression, etc. These features can be converted into high-dimensional vectors through vectorization techniques (such as word embedding and feature embedding). The embedding vector can capture the semantic information of the feature, allowing the model to consider the impact of these features when generating dialogues. By converting the anthropomorphic features into embedding vectors, the model can incorporate these features when generating dialogues, thereby generating dialogue content with a specific character's dialogue style.

[0074] Furthermore, the large language model used in the current environment is selected as the anthropomorphic dialogue generation model, and the conditional generation parameters of the model are set to ensure that the style of the generated dialogue is consistent with the first dialogue sample. Large language models (such as GPT-3, GPT-4, etc.) have strong generation capabilities and can generate high-quality and diverse text content. By setting conditional generation parameters such as temperature, maximum generation length, repetition penalty, etc., the style and diversity of the generated dialogue can be controlled. For example, a lower temperature value will make the generated dialogue more conservative and consistent, while a higher temperature value will make the generated dialogue more creative and diverse. By selecting a suitable large language model and setting conditional generation parameters, the model is able to generate dialogue content consistent with the style of the first dialogue sample while maintaining the diversity and naturalness of the dialogue.

[0075] Next, the conversation style of the anthropomorphic dialogue generation model is adjusted using prompts that match the anthropomorphic features to ensure that the generated conversation content is consistent with the first conversation sample. Prompts are the key to guiding the model to generate specific content. By selecting prompts that match the anthropomorphic features, the model can better understand the character's personality and conversation style. For example, if the anthropomorphic features include the feature of "reasoning ability", you can select prompts related to reasoning (such as "reasoning process", "logical analysis", etc.) to guide the model to generate conversations with reasoning nature. By using prompts that match the anthropomorphic features, the model can generate conversation content that is more in line with the character's personality and conversation style, thereby improving the anthropomorphic effect of conversation generation.

[0076] Finally, the embedding vector converted from the anthropomorphic features is input into the anthropomorphic dialogue generation model to generate multiple rounds of anthropomorphic dialogues with the same character dialogue style as the first dialogue sample as the second dialogue sample. By inputting the embedding vector into the anthropomorphic dialogue generation model, the model is able to take into account the influence of these features when generating dialogues. In the process of generating multiple rounds of dialogues, the model generates continuous and consistent dialogue content based on contextual information and features in the embedding vector. For example, if the character in the first dialogue sample shows strong reasoning ability, the second dialogue sample will also show similar reasoning characteristics in the dialogue. By inputting the embedding vector into the anthropomorphic dialogue generation model, the model is able to generate multiple rounds of dialogues consistent with the style of the first dialogue sample. These dialogues are consistent in content and style, and are diverse and natural.

[0077] By converting anthropomorphic features into embedding vectors and combining them with a large language model for conditional generation, the model is able to generate a second dialogue sample that is consistent with the character's dialogue style in the first dialogue sample. Since the anthropomorphic features contain features that can reflect the character's dialogue style, the model can maintain a dialogue style consistent with the first dialogue sample when generating dialogues. For example, if the character in the first dialogue sample shows strong reasoning ability, the second dialogue sample will also show similar reasoning characteristics in the dialogue. By generating multiple rounds of dialogue, the model is able to generate a series of diverse dialogue content that is consistent in style but varies in details and themes, thereby enriching the diversity of the dialogue. By incorporating anthropomorphic features and using matching prompt words, the model is able to generate more anthropomorphic dialogue content, allowing the dialogue generation model to better simulate the character's language style and personality characteristics. During the generation of multiple rounds of dialogue, the model takes into account contextual information so that the generated dialogue is consistent in logic and emotion, avoiding inconsistencies.

[0078] In summary, by converting anthropomorphic features into embedding vectors and combining them with a large language model for conditional generation, the model can generate a second dialogue sample that is consistent with the character dialogue style of the first dialogue sample. This generation method can not only maintain the uniformity of the dialogue style, but also enhance the diversity and anthropomorphic effect of the dialogue, thereby improving the overall performance of the dialogue generation model.

[0079] Further optionally, before using the anthropomorphic features as the embedding vectors of the anthropomorphic dialogue generation model and generating multiple rounds of anthropomorphic dialogues through the anthropomorphic dialogue generation model as the second dialogue sample, a model temperature parameter for controlling the degree of dialogue diversity and randomness can be determined based on data expansion requirements; and the numerical value of the model temperature parameter can be adjusted to adjust the degree of overlap between the dialogue content of the multiple rounds of anthropomorphic dialogues generated by the anthropomorphic dialogue generation model and the dialogue content in the first dialogue sample.

[0080] In an embodiment of the present application, the higher the value of the model temperature parameter, the higher the diversity and randomness of the conversation content of the multiple rounds of anthropomorphic conversations, and the lower the overlap between the conversation content of the multiple rounds of anthropomorphic conversations and the conversation content of the first conversation sample.

[0081] Before generating the second dialogue sample, the model can adjust the model temperature parameter according to the data expansion requirements to control the diversity and randomness of the generated multi-round anthropomorphic dialogue. Specifically, by adjusting the model temperature parameter, the model can find a suitable overlap between the generated dialogue content and the first dialogue sample. According to the data expansion requirements, determine the model temperature parameter used to control the diversity and randomness of the dialogue. The model temperature parameter (temperature) is an important parameter for controlling the diversity and randomness of the output of the generation model. The higher the temperature parameter, the higher the diversity and randomness of the model generation results; the lower the temperature parameter, the more conservative and consistent the generation results. By adjusting the temperature parameter, the style and content of the generated dialogue can be flexibly controlled. By determining the appropriate model temperature parameter, the model can take into account both diversity and consistency when generating dialogues, thereby meeting different data expansion requirements.

[0082] According to the data expansion requirements, adjust the numerical value of the model temperature parameter to adjust the overlap between the conversation content of the generated multi-round anthropomorphic dialogue and the first dialogue sample. By adjusting the model temperature parameter, the decision-making process of the generative model can be affected. For example, if the temperature parameter is high, the generative model will be more random when selecting the next word or sentence, thereby generating more diverse conversation content; if the temperature parameter is low, the generative model will be more conservative and tend to generate content similar to the first dialogue sample. By adjusting the model temperature parameter, the model can generate multi-round dialogue content with different overlaps. The higher the temperature parameter, the more diverse and random the generated dialogue content is, and the lower the overlap with the first dialogue sample; the lower the temperature parameter, the more conservative and consistent the generated dialogue content is, and the higher the overlap with the first dialogue sample.

[0083] Thus, by adjusting the model temperature parameter, the model can control the diversity and randomness of the conversation content when generating multiple rounds of anthropomorphic dialogues, thereby adjusting the overlap with the first dialogue sample. When the model temperature parameter is high, the generated dialogue content has higher diversity and randomness. The model will pay more attention to novelty and creativity when generating dialogues, thereby generating more dialogue content with different styles and themes. When the model temperature parameter is low, the generated dialogue content is more conservative and consistent. When generating dialogues, the model will pay more attention to the similarity with the first dialogue sample, thereby generating dialogue content consistent with the style of the first dialogue sample. By adjusting the model temperature parameter, the model can flexibly respond to different data expansion needs. For example, when a large number of diverse dialogue samples need to be generated, a higher temperature parameter can be set; when the dialogue style needs to be consistent, a lower temperature parameter can be set. By controlling the temperature parameter, the model can take into account both diversity and consistency when generating dialogues, thereby generating more anthropomorphic dialogue content. This flexibility allows the generated dialogue content to be both in line with the personality characteristics of the character and to be reflected in diversity.

[0084] In summary, by adjusting the model temperature parameters, the model can effectively control the diversity and randomness of the generated multi-round anthropomorphic dialogues, thereby adjusting the overlap with the first dialogue sample. This adjustment method can not only meet different data expansion needs, but also enhance the anthropomorphic effect of the dialogue generation model, making the generated dialogue content more natural, real, and more in line with the character's personality characteristics.

[0085] Exemplarily, in the above steps, adjusting the numerical value of the model temperature parameter to adjust the overlap between the dialogue content of multiple rounds of anthropomorphic dialogues generated by the anthropomorphic dialogue generation model and the dialogue content in the first dialogue sample can be implemented as follows: A plurality of parameter value intervals of the model temperature parameter are set; wherein the numerical range of the plurality of parameter value intervals is associated with character characteristics; and any one of the plurality of parameter value intervals is randomly selected to set the model temperature parameter of the anthropomorphic dialogue generation model within the current interval, so as to obtain the second dialogue sample having multiple gradient dialogue diversities and randomness.

[0086] When generating the second dialogue sample, the model can adjust the model temperature parameter by setting multiple parameter value intervals, thereby controlling the overlap between the dialogue content of the generated multi-round anthropomorphic dialogue and the first dialogue sample. Specifically, by randomly selecting any value in multiple parameter value intervals, the model can generate dialogue content with multiple gradient dialogue diversity and randomness in different intervals.

[0087] According to the data expansion requirements and character characteristics, multiple parameter value intervals are set to adjust the model temperature parameter. The model temperature parameter (temperature) is an important parameter for controlling the diversity and randomness of the generated model output. By setting multiple parameter value intervals, the temperature parameter can be flexibly adjusted in different intervals to generate conversation content with different diversity and randomness. The division of parameter value intervals can be adjusted according to character characteristics and data expansion requirements to ensure that the generated conversation content not only meets the character's personality characteristics, but also meets the diversity and randomness requirements. By setting multiple parameter value intervals, the model can generate conversation content with different gradients of conversation diversity and randomness in different intervals, thereby meeting diverse data expansion requirements.

[0088] Randomly select any value from multiple parameter value intervals to set the model temperature parameter of the anthropomorphic dialogue generation model in the current interval. By randomly selecting a value in the parameter value interval, randomness can be introduced so that the temperature parameter is different each time a dialogue is generated. This method can ensure that the generated dialogue content has a significant gradient change in diversity and randomness. For example, from the low temperature interval to the high temperature interval, the generated dialogue content gradually changes from conservative and consistent to diverse and innovative. By randomly selecting a value in the parameter value interval, the model can generate dialogue content with multiple gradient dialogue diversity and randomness, thereby increasing the diversity and richness of dialogue samples.

[0089] According to the randomly selected temperature parameters, multiple rounds of anthropomorphic dialogues with multiple gradient dialogue diversity and randomness are generated as the second dialogue sample. Under different temperature parameters, the anthropomorphic dialogue generation model will generate dialogue content with different diversity and randomness. For example, the dialogue content generated under low temperature parameters is more conservative and consistent, and has a higher overlap with the first dialogue sample; the dialogue content generated under high temperature parameters is more diverse and innovative, and has a lower overlap with the first dialogue sample. By randomly selecting temperature parameters within multiple parameter value intervals, dialogue content with multiple gradient dialogue diversity and randomness can be generated. By generating dialogue content with multiple gradient dialogue diversity and randomness, the model can meet different data expansion needs while ensuring that the generated dialogue content is diverse and rich in style and content.

[0090] Thus, by setting multiple parameter value intervals and randomly selecting parameter values, the model can generate second dialogue samples with multiple gradient dialogue diversity and randomness in different intervals. By randomly selecting temperature parameters in multiple parameter value intervals, the generated dialogue content has obvious gradient changes in diversity and randomness. From the low temperature interval to the high temperature interval, the generated dialogue content gradually changes from conservative and consistent to diverse and innovative, thereby increasing the diversity and richness of the dialogue samples. By setting parameter value intervals associated with character features, the generated dialogue content can maintain the consistency of character features in diversity and randomness. For example, if the character in the first dialogue sample shows strong reasoning ability, the generated dialogue content will show similar reasoning characteristics at different gradients. By randomly selecting values ​​in the parameter value interval, the model can flexibly respond to different data expansion requirements. For example, when a large number of diverse dialogue samples need to be generated, parameter values ​​can be selected from the high temperature interval; when the dialogue style needs to be consistent, parameter values ​​can be selected from the low temperature interval. By generating dialogue content with multiple gradient dialogue diversity and randomness, the model can generate more anthropomorphic dialogue samples. This flexibility ensures that the generated dialogue content is consistent with the character's personality traits while also being diverse, thereby enhancing the anthropomorphic effect of the dialogue generation model.

[0091] In summary, by setting multiple parameter value intervals and randomly selecting parameter values, the model can generate second dialogue samples with multiple gradient dialogue diversity and randomness in different intervals. This adjustment method can not only meet different data expansion needs, but also enhance the anthropomorphic effect of the dialogue generation model, making the generated dialogue content more natural, real, and more in line with the character's personality characteristics.

[0092] In 104, the dialogue content in the first dialogue sample is regenerated based on the anthropomorphic features to obtain a third dialogue sample. In the embodiment of the present application, the third dialogue sample has the same character dialogue style as the first dialogue sample.

[0093] Similar to the above, in 104, regenerating the conversation content in the first conversation sample based on the anthropomorphic feature to obtain a third conversation sample can be implemented as follows: The anthropomorphic features are converted into corresponding embedding vectors; the context information of the first dialogue sample is encoded into a context vector; the large language model used in the current environment is selected as the anthropomorphic dialogue generation model, and the conditional generation parameters of the anthropomorphic dialogue generation model are set; the prompt words matching the anthropomorphic features are used to adjust the dialogue style of the anthropomorphic dialogue generation model; the embedding vector and the context vector are input into the anthropomorphic dialogue generation model to generate multiple rounds of anthropomorphic dialogues with the same character dialogue style as the first dialogue sample as the third dialogue sample.

[0094] In the process of generating the third dialogue sample, the input of the anthropomorphic dialogue generation model is not only the anthropomorphic feature embedding vector, but also the context vector based on the first dialogue sample. This different implementation method brings some significant effects. The addition of context information encodes the context information of the first dialogue sample into a context vector and inputs it into the anthropomorphic dialogue generation model. The context vector can capture the context information of the dialogue, including the history of the dialogue, context, role relationship, etc. This information is crucial for generating coherent and logically consistent dialogue content. By inputting the context vector into the anthropomorphic dialogue generation model together with the anthropomorphic feature embedding vector, the model can better understand the background and situation of the current dialogue, thereby generating more contextual dialogue content. The addition of the context vector makes the generated dialogue content more consistent in logic and emotion, avoids inconsistencies, and enhances the coherence and naturalness of the dialogue.

[0095] Similar to the previous example, the large language model used in the current environment is selected as the anthropomorphic dialogue generation model, and the conditional generation parameters of the model are set to ensure that the generated dialogue style is consistent with the first dialogue sample.

[0096] Similar to the previous example, the conversation style of the anthropomorphic dialogue generation model is adjusted using prompt words that match the anthropomorphic features to ensure that the generated dialogue content is consistent with the character dialogue style of the first dialogue sample.

[0097] By inputting the context vector into the anthropomorphic dialogue generation model together with the anthropomorphic feature embedding vector, the generated dialogue content is more consistent in logic and emotion due to the addition of the context vector. The model can understand and take into account the history and current context of the dialogue, thereby avoiding the generation of inconsistent content. If character A asks character B a question in the first dialogue sample, the generated third dialogue sample can naturally continue this line of dialogue, and character B can give a contextual answer instead of suddenly jumping to another topic. The addition of the context vector enhances the coherence of the dialogue. The generated dialogue content can better connect with the context of the first dialogue sample, making the entire conversation more natural and smooth. In the first dialogue sample, if character A and character B are discussing a book, the third dialogue sample can naturally continue this discussion instead of suddenly changing the topic. The context vector not only captures the logic and content of the dialogue, but also reflects the emotion and tone in the dialogue. The generated dialogue content can maintain the same emotion and tone as the first dialogue sample, making the dialogue more real and vivid. If character A shows anger in the first dialogue sample, character A in the generated third dialogue sample can naturally continue this angry emotion and tone in the dialogue. The addition of context vectors enables the generated dialogue content to better reflect the relationship and interaction between the characters. The model can understand and simulate the interaction between characters, thereby generating dialogue content that is more in line with the relationship between the characters. If character A and character B show a friendly and cooperative relationship in the first dialogue sample, the third dialogue sample can naturally continue this relationship and generate mutually supportive and cooperative dialogue content.

[0098] In summary, by inputting the context vector together with the anthropomorphic feature embedding vector into the anthropomorphic dialogue generation model, the generated third dialogue sample shows higher coherence and consistency in logic, emotion, intonation, role relationship, etc. This implementation not only enhances the anthropomorphic effect of the dialogue generation model, but also makes the generated dialogue content more natural, real, and more in line with the character's personality characteristics and dialogue background.

[0099] In 105, the second dialogue sample and the third dialogue sample are quality evaluated, and the dialogue samples that pass the quality evaluation are updated into the training data set as second training data.

[0100] As an optional embodiment, in 105, performing quality assessment on the second dialogue sample and the third dialogue sample, and updating the dialogue samples that pass the quality assessment into the training data set as second training data, can be implemented as the following steps: 301, randomly selecting target dialogue sample segments for quality assessment from the second dialogue sample and the third dialogue sample; wherein the ratio between the selected dialogue sample segments and the corresponding dialogue samples meets a pre-configured sampling ratio; 302, setting quality assessment conditions for the second dialogue sample and the third dialogue sample; the quality assessment conditions are adaptively configured from at least one dimension of grammar detection, spelling detection, consistency detection, context coherence, sentiment analysis, dialogue style, topic relevance, and character individualization degree; 303, screening the second dialogue sample and the third dialogue sample based on the quality evaluation condition to obtain quality evaluation values ​​corresponding to the second dialogue sample and the third dialogue sample respectively; 304 , taking the conversation samples whose quality evaluation values ​​reach the set evaluation threshold as the second training data, and updating the second training data into the training data set.

[0101] It is understandable that the target dialogue sample segments for quality assessment are randomly selected from the second dialogue sample and the third dialogue sample. By randomly selecting dialogue sample segments, it is ensured that the samples for quality assessment are representative and bias is avoided. The selection ratio meets the pre-configured sampling ratio to control the sample size for assessment. Quality assessment conditions for the second dialogue sample and the third dialogue sample are set. The quality assessment conditions include adaptive configuration from multiple dimensions such as grammar detection, spelling detection, consistency detection, context coherence, sentiment analysis, dialogue style, topic relevance, and degree of character individualization. These dimensions can comprehensively evaluate the quality of the dialogue samples. The second dialogue sample and the third dialogue sample are screened based on the set quality assessment conditions to obtain their respective corresponding quality assessment values. The dialogue samples are screened by multi-dimensional assessment conditions to calculate the quality assessment value of each dialogue sample. The assessment value reflects the performance of the dialogue sample in each quality dimension. The dialogue samples whose quality assessment values ​​reach the set assessment threshold are used as the second training data and updated to the training data set. By setting the assessment threshold, high-quality dialogue samples are screened as the second training data. These samples will be updated to the training data set for further training of the model.

[0102] Thus, through quality assessment and screening, the quality of dialogue samples in the training dataset is significantly improved. Only dialogue samples that meet certain quality standards will be used for training, thereby improving the training effect of the model. The original dataset may contain dialogue samples with grammatical errors or incoherent contexts. After quality assessment, these low-quality samples are eliminated, and the remaining samples are of higher quality. High-quality training datasets can significantly improve the performance of the model. During the training process, the model can better learn the features of high-quality dialogue samples, thereby generating more natural, coherent, and logical dialogues. In the dimension of sentiment analysis, high-quality dialogue samples can help the model better understand and generate diverse emotional expressions. Randomly selecting target dialogue sample fragments ensures that the samples for quality assessment are representative, avoids the lack of certain types of dialogue samples in the dataset, and maintains the diversity of the data. If only certain types of dialogue samples are selected for quality assessment, the quality of other types of dialogue samples may not be effectively assessed. This can be avoided by random selection. Multi-dimensional quality assessment conditions ensure a comprehensive assessment of dialogue samples. Each dimension can independently assess the quality of dialogue samples, and the comprehensive multi-dimensional assessment results can more comprehensively reflect the overall quality of dialogue samples. In a set of dialogue samples, some samples may perform well in grammar but poorly in contextual coherence. Through multi-dimensional evaluation, the quality of these samples can be comprehensively assessed.

[0103] Specifically, automatic evaluation indicators use automatic evaluation indicators of text generation quality such as BLEU, ROUGE, METEOR, and indicators specifically used for dialogue evaluation, such as DISTINCT, F1 score, etc. These automatic evaluation indicators can quantify the generation quality of dialogue samples, including text accuracy, recall, and diversity. Through these indicators, the quality of dialogue samples can be objectively evaluated. Automatic evaluation indicators can quickly and accurately evaluate the quality of a large number of dialogue samples, providing a scientific basis for screening high-quality dialogue samples.

[0104] Grammar and spelling check: Use the grammar checker to ensure that the conversation sample has no grammatical errors, and use the spelling checker to ensure that the words are correct. Grammatical and spelling errors affect the naturalness and readability of the conversation. By checking these errors, the text quality of the conversation sample can be improved. After eliminating grammatical and spelling errors, the conversation sample is more natural and fluent, which improves the user's reading experience.

[0105] Consistency check ensures that the dialogue sample meets expectations in terms of character traits, dialogue style, and topic consistency. Consistency is an important feature of high-quality dialogue. By checking the consistency of character traits, dialogue style, and topic, it can ensure that the dialogue sample is consistent in all dimensions. The consistency check ensures the coherence of the dialogue sample in terms of character traits, dialogue style, and topic, and improves the authenticity and credibility of the dialogue.

[0106] Contextual coherence, evaluate the contextual coherence of the dialogue sample in multiple rounds of interaction, and ensure that the dialogue logic is smooth and there are no abrupt turns. Contextual coherence is a key element in multiple rounds of dialogue. By evaluating the coherence of the dialogue sample in multiple rounds of interaction, we can ensure that the dialogue logic is smooth. Contextual coherence checking improves the logic and naturalness of the dialogue sample in multiple rounds of interaction and avoids abrupt turning points.

[0107] Sentiment analysis: Use sentiment analysis tools to evaluate whether the emotional expression in the dialogue sample is appropriate and whether it is consistent with the character characteristics and dialogue context. Emotional expression plays an important role in dialogue. Through sentiment analysis, we can ensure that the emotional expression in the dialogue sample is consistent with the character characteristics and dialogue context. Sentiment analysis makes the emotional expression in the dialogue sample more natural and appropriate, and improves the emotional authenticity of the dialogue.

[0108] Personalized features: For conversations with specific character features, the evaluation criteria are adjusted to emphasize the consistency and naturalness of these features. Different characters have different features, and the evaluation criteria need to be adjusted according to these features. By emphasizing the consistency and naturalness of character features, the authenticity of the conversation samples can be improved. The evaluation of personalized features makes the conversation samples more consistent with the image and characteristics of specific characters, improving the credibility and naturalness of the conversation.

[0109] Conversation style: According to the style of the conversation (such as formal, informal, humorous, etc.), the evaluation criteria are adjusted to ensure that the generated conversation conforms to the characteristics of the style. Different styles of conversations require different evaluation criteria. By adjusting the evaluation criteria, the consistency of the conversation style can be ensured. The evaluation of the conversation style makes the generated conversation samples more unified and natural in style, conforming to the characteristics of a specific style.

[0110] Topic relevance, for conversations involving specific topics, adjust the evaluation criteria to focus on the relevance and depth of the topic. Specific topics require in-depth and relevant conversation content. By adjusting the evaluation criteria, we can ensure the relevance and depth of the conversation samples on the topic. The evaluation of topic relevance makes the conversation samples more relevant and in-depth in content, improving the quality and relevance of the conversation.

[0111] By setting and adjusting the evaluation screening methods or conditions, the quality of the dialogue samples can be comprehensively improved. Automatic evaluation indicators, grammar and spelling checks, consistency checks, contextual coherence, and sentiment analysis ensure the quality of the dialogue samples in all aspects. The evaluation criteria are adjusted to suit different types of characters or dialogue modes, making the generated dialogue samples more realistic, natural, coherent, and relevant. These technical means not only improve the quality of dialogue generation, but also enhance the user's reading experience and the authenticity of the dialogue.

[0112] In summary, by randomly selecting target dialogue sample segments, setting multi-dimensional quality assessment conditions, implementing quality assessment, and screening high-quality samples and updating them to the training dataset, this technology can significantly improve the quality of training data and thus improve the performance of the model. High-quality and diverse training datasets are the key to improving the model's ability to generate natural, coherent, and logical dialogues.

[0113] Further optionally, after 301, the key dialogue scenes of each of the second dialogue sample and the third dialogue sample can also be determined; wherein the key dialogue scenes include at least: dialogue turning points, key information fragments containing preset semantic types; identifying whether the unselected dialogue samples contain key dialogue scenes; if the unselected dialogue samples contain key dialogue scenes, extracting the dialogue sample fragments corresponding to the key dialogue scenes, and updating them to the target dialogue sample fragments.

[0114] Exemplarily, the key dialogue scenes of the second dialogue sample and the third dialogue sample are determined. The key dialogue scenes generally include dialogue turning points, key information fragments containing preset semantic types, etc. These scenes are often the most important parts of the dialogue and can reflect the core content and emotional changes of the dialogue.

[0115] Identify whether the unselected dialogue samples contain key dialogue scenes. By analyzing the unselected dialogue samples, identify whether they contain key dialogue scenes. If they do, extract the corresponding key dialogue scene fragments. If the unselected dialogue samples contain key dialogue scenes, extract the dialogue sample fragments corresponding to the key dialogue scenes and update them to the target dialogue sample fragments. By updating the key dialogue scene fragments to the target dialogue sample, it can ensure that the content of the target dialogue sample is richer and more complete, covering important information and emotional changes in the dialogue.

[0116] In this way, by extracting and updating key conversation scenes, the target conversation sample is richer in content, covering important information and emotional changes in the conversation. If the key conversation scene in the second conversation sample contains an emotional turning point, the updated target conversation sample can more comprehensively show this emotional change. The update of key conversation scenes makes the target conversation sample more logically and emotionally coherent, improving the naturalness and authenticity of the conversation. In a conversation about breaking up, extracting and updating key conversation scenes containing emotional turning points can make the entire conversation more coherent and authentic. By identifying and extracting key conversation scenes from unselected conversation samples, the information integrity of the target conversation sample is enhanced to avoid missing important information. If the unselected conversation sample contains an important conversation turning point, extracting and updating this segment can ensure that the content of the target conversation sample is more complete.

[0117] Optionally, after step 301, it is also possible to detect whether the target conversation sample has multiple conversation lengths; detect whether the target conversation sample contains multiple types of emotional expressions; and detect whether the target conversation sample has multiple topic ranges. If any dimension of the conversation length, emotional expression type, and topic range of the target conversation sample is a single type, then re-extract conversation sample segments of other types and update them into the target conversation sample segment.

[0118] Exemplarily, it is detected whether there are multiple dialogue lengths of the target dialogue sample. By analyzing the dialogue length of the target dialogue sample, it is determined whether there are dialogue segments of different lengths. If the dialogue length is single, other types of dialogue sample segments are re-extracted. It is also possible to detect whether there are multiple types of emotional expressions contained in the target dialogue sample. By analyzing the emotional expressions in the target dialogue sample, it is determined whether multiple emotional types are covered. If the emotional expression type is single, other types of dialogue sample segments are re-extracted. It is also possible to detect whether there are multiple topic ranges of the target dialogue sample. By analyzing the topic content of the target dialogue sample, it is determined whether multiple topic ranges are covered. If the topic range is single, other types of dialogue sample segments are re-extracted.

[0119] If the target conversation sample is of a single type in any of the dimensions of conversation length, emotional expression type, or topic range, then other types of conversation sample segments are re-extracted and updated to the target conversation sample segments. By adding different types of conversation sample segments, the target conversation sample can be more diverse in all dimensions, improving the richness and naturalness of the conversation.

[0120] In this way, by detecting and updating different types of dialogue sample segments, the target dialogue samples show higher diversity in dialogue length, emotional expression type, and topic range. If the target dialogue sample only contains long dialogue segments, some short dialogue segments can be added through updating to make the dialogue more diverse. Diversified dialogue sample segments make the target dialogue sample more natural and real, avoiding the monotony of the dialogue content. If the target dialogue sample only contains negative emotional expressions, some positive emotional expressions can be added through updating to make the dialogue more natural and balanced.

[0121] In this way, the diverse conversation sample segments cover a wider range of topics and emotional expression types, making the target conversation sample information more comprehensive and rich. If the target conversation sample only has one topic, conversation segments of other topics can be added through updating to make the conversation content more comprehensive.

[0122] Through the principles and technical effects of the above two examples, we can see that the extraction and updating of key dialogue scenes and the detection and updating of dialogue length, emotional expression type and topic range can significantly improve the quality and richness of target dialogue samples. These technical means not only enhance the coherence and naturalness of dialogue, but also improve the diversity and information integrity of dialogue, making the generated target dialogue samples more consistent with the characteristics of actual dialogue, thereby improving the practical application effect of the anthropomorphic dialogue generation model.

[0123] For example, the training data set obtained by the above steps is applied to the training process of large model A and large model B. The two different large models A and B are used to make full use of their respective advantages to achieve more efficient and higher quality task processing. This dual-model strategy can not only improve the performance of the dialogue system, but also enhance its adaptability in a changing environment.

[0124] Model A is a basic model specifically designed for dialogue rewriting and generation tasks. It has strong language understanding and generation capabilities, can accurately process and understand natural language input, and generate smooth and reasonable dialogue output. The basic role of Model A is to provide a solid basic framework to ensure that the dialogue system can handle basic language tasks such as syntactic analysis and semantic understanding.

[0125] Model B is the product of iterative optimization based on Model A. It includes more advanced algorithms, larger data sets, and more complex model structures. The core role of Model B is to further improve the quality of dialogue generation and increase the diversity and creativity of dialogue. In addition, Model B may also have some improvements in performance, such as faster response speed or higher resource utilization efficiency, so as to provide a better user experience in practical applications. In terms of model parameters and model structure, Model A and Model B have significant differences and commonalities. First, in terms of the number and size of parameters, Model B, as an iterated model, has more parameters. These additional parameters can capture more complex language features and patterns, thereby improving the expressiveness of the model. However, more parameters also mean higher computational costs, which puts higher demands on computing resources. In terms of model structure, Model B adopts a more advanced architecture, such as deeper neural network layers and more attention mechanisms. These improvements can improve the model's understanding and generation capabilities, enabling it to handle complex language tasks more accurately. At the same time, the structural design of Model B is also more complex, which not only enhances its performance, but also increases the flexibility and adaptability of the model. In terms of training data, Model B uses larger or higher-quality data sets for training. These datasets can provide more corpora and help the model learn a wider range of language patterns and expressions. By using high-quality datasets, Model B can generate more natural and informative conversations, thereby improving the overall conversation quality.

[0126] In terms of optimization goals, Model B is significantly different from Model A. Model B focuses more on the naturalness, informativeness, and creativity of generated dialogues. This means that Model B not only requires the generation of fluent dialogues, but also requires these dialogues to be rich, interesting, and creative. This shift in optimization goals makes Model B perform well in generating more interactive dialogues.

[0127] In terms of performance indicators, Model B has improved in aspects such as response time and resource consumption. Faster response speed can not only improve user experience, but also make the model more reliable in real-time conversation environments. At the same time, higher resource utilization efficiency means that Model B can achieve higher performance with limited computing resources, which is particularly important in actual deployment.

[0128] By adopting two large models A and B, we can fully utilize the advantages of each to achieve more efficient and higher-quality task processing. Model A, as the basic model, provides solid language understanding and generation capabilities; while model B further improves the quality and diversity of dialogue generation through iterative optimization, while also improving performance. This dual-model strategy can not only improve the overall performance of the dialogue system, but also enhance its adaptability in changing environments, thereby providing users with a more natural and richer dialogue experience.

[0129] In the technical solution of the present application, first, the first training data of multiple rounds of anthropomorphic dialogues are obtained from the training data set. Wherein, the first training data at least includes: text data and / or sound data. Then, the first training data is analyzed and extracted based on the anthropomorphic analysis model to obtain the anthropomorphic features and the first dialogue sample corresponding to the first training data. Wherein, the first dialogue sample is a training data segment containing the anthropomorphic features in the first training data. Then, a second dialogue sample is generated based on the anthropomorphic features. The character dialogue style of the second dialogue sample is consistent with that of the first dialogue sample. Then, the dialogue content in the first dialogue sample is regenerated based on the anthropomorphic features to obtain a third dialogue sample; the character dialogue style of the third dialogue sample is consistent with that of the first dialogue sample. Finally, the second dialogue sample and the third dialogue sample are quality evaluated, and the dialogue sample that passes the quality evaluation is updated as the second training data to the training data set. The technical solution of the present application realizes automatic data enhancement processing of anthropomorphic dialogues, improves the data enhancement efficiency of model training data, enriches the diversity of anthropomorphic dialogues while ensuring the quality of training data, and helps to further improve the model training effect and model performance.

[0130] In another embodiment of the present application, a data enhancement device for anthropomorphic dialogue is also provided. Figure 2 The device comprises the following units: An acquisition unit is configured to acquire first training data of multiple rounds of anthropomorphic dialogues from a training data set; the first training data at least includes: text data and / or sound data; an extraction unit configured to analyze and extract the first training data based on an anthropomorphic analysis model to obtain an anthropomorphic feature and a first dialogue sample corresponding to the first training data; the first dialogue sample is a training data segment containing the anthropomorphic feature in the first training data; A first generating unit is configured to generate a second dialogue sample based on the anthropomorphic feature; the second dialogue sample has a consistent character dialogue style with the first dialogue sample; A second generating unit is configured to regenerate the dialogue content in the first dialogue sample based on the anthropomorphic feature to obtain a third dialogue sample; the third dialogue sample has a consistent dialogue style with the character in the first dialogue sample; An evaluation unit is configured to perform quality evaluation on the second dialogue sample and the third dialogue sample, and update the dialogue samples that pass the quality evaluation into the training data set as second training data.

[0131] Further optionally, the extraction unit analyzes and extracts the first training data based on the anthropomorphic analysis model to obtain anthropomorphic features and a first dialogue sample corresponding to the first training data, and is configured as follows: Performing data cleaning and formatting processing on the first training data to obtain preprocessed first training data; Inputting the preprocessed first training data into the anthropomorphic analysis model to extract an anthropomorphic feature set consisting of a plurality of key features; The first dialogue sample is extracted from the preprocessed first training data according to the anthropomorphic feature set.

[0132] Further optionally, the anthropomorphic analysis model at least includes the following structures: a text feature extraction layer, a pattern recognition layer, a speech analysis layer, and a feature integration layer; an extraction unit inputs the preprocessed first training data into the anthropomorphic analysis model to extract an anthropomorphic feature set consisting of multiple key features, which is configured as follows: Analyzing the preprocessed text data in the first training data through a text feature extraction layer to identify character features and first dialogue mode features in the text data; Analyzing the contextual relationship in the preprocessed first training data through the pattern recognition layer to obtain a second dialogue pattern feature derived from the contextual relationship; Performing feature analysis on the sound data in the preprocessed first training data through the speech analysis layer to obtain speech emotion features in the sound data; By integrating the character features, the first dialogue mode features, the second dialogue mode features, and the voice emotion features through the feature integration layer, the anthropomorphic feature set is constructed; Among them, character characteristics include at least one of the following: personal information, personality characteristics, emotional state, voice characteristics, and knowledge background; dialogue mode characteristics include at least one of the following: greeting method, farewell method, inquiry method, answering method, emotional expression characteristics, request and command method, and topic change method.

[0133] Further optionally, the first generation unit generates a second dialogue sample based on the anthropomorphic feature, and is configured to: use the anthropomorphic feature as an embedding vector of an anthropomorphic dialogue generation model, and generate multiple rounds of anthropomorphic dialogues through the anthropomorphic dialogue generation model as the second dialogue sample.

[0134] Further optionally, the second generation unit uses the anthropomorphic feature as an embedding vector of an anthropomorphic dialogue generation model, generates multiple rounds of anthropomorphic dialogues through the anthropomorphic dialogue generation model as the second dialogue samples, and is configured as follows: Convert the anthropomorphic features into corresponding embedding vectors; Selecting a large language model used in the current environment as the anthropomorphic dialogue generation model, and setting conditional generation parameters of the anthropomorphic dialogue generation model; Using prompt words matching the anthropomorphic features to adjust the conversation style of the anthropomorphic dialogue generation model; The embedding vector is input into the anthropomorphic dialogue generation model to generate multiple rounds of anthropomorphic dialogues having the same character dialogue style as the first dialogue sample as the second dialogue sample.

[0135] Further optionally, the second generating unit, before using the anthropomorphic feature as an embedding vector of an anthropomorphic dialogue generation model and generating multiple rounds of anthropomorphic dialogues through the anthropomorphic dialogue generation model as the second dialogue sample, is further configured as follows: Based on data augmentation requirements, determine the model temperature parameters used to control the degree of conversation diversity and randomness; Adjusting the numerical value of the model temperature parameter to adjust the overlap between the dialogue content of multiple rounds of anthropomorphic dialogues generated by the anthropomorphic dialogue generation model and the dialogue content in the first dialogue sample; Among them, the higher the value of the model temperature parameter, the higher the diversity and randomness of the dialogue content of the multiple rounds of anthropomorphic dialogues, and the lower the overlap between the dialogue content of the multiple rounds of anthropomorphic dialogues and the dialogue content of the first dialogue sample.

[0136] Further optionally, the second generation unit adjusts the numerical value of the model temperature parameter to adjust the overlap between the dialogue content of multiple rounds of anthropomorphic dialogues generated by the anthropomorphic dialogue generation model and the dialogue content in the first dialogue sample, and is configured as follows: Setting a plurality of parameter value intervals of the model temperature parameter; wherein the numerical interval ranges of the plurality of parameter value intervals are associated with the characteristics of the person; Randomly select any one of the multiple parameter value intervals to set the model temperature parameter of the anthropomorphic dialogue generation model in the current interval to obtain the second dialogue sample with multiple gradient dialogue diversity and randomness.

[0137] Further optionally, the second generating unit regenerates the dialogue content in the first dialogue sample based on the anthropomorphic feature to obtain a third dialogue sample, and is configured as follows: Convert the anthropomorphic features into corresponding embedding vectors; Encoding context information of the first conversation sample into a context vector; Selecting a large language model used in the current environment as the anthropomorphic dialogue generation model, and setting conditional generation parameters of the anthropomorphic dialogue generation model; Using prompt words matching the anthropomorphic features to adjust the conversation style of the anthropomorphic dialogue generation model; The embedding vector and the context vector are input into the anthropomorphic dialogue generation model to generate multiple rounds of anthropomorphic dialogues having the same character dialogue style as the first dialogue sample as the third dialogue sample.

[0138] Further optionally, the evaluation unit performs quality evaluation on the second dialogue sample and the third dialogue sample, and updates the dialogue samples that pass the quality evaluation as second training data into the training data set, and is configured to: Randomly selecting target dialogue sample segments for quality assessment from the second dialogue sample and the third dialogue sample; wherein the ratio between the selected dialogue sample segments and the corresponding dialogue samples complies with a pre-configured sampling ratio; Setting quality assessment conditions for the second dialogue sample and the third dialogue sample; the quality assessment conditions are composed of adaptive configurations from at least one dimension of grammar detection, spelling detection, consistency detection, context coherence, sentiment analysis, dialogue style, topic relevance, and character individualization; Screening the second dialogue sample and the third dialogue sample based on the quality evaluation condition to obtain quality evaluation values ​​corresponding to the second dialogue sample and the third dialogue sample respectively; The conversation samples whose quality evaluation values ​​reach the set evaluation threshold are used as the second training data, and the second training data are updated into the training data set.

[0139] Further optionally, after randomly selecting a target dialogue sample segment for quality assessment from the second dialogue sample and the third dialogue sample, the evaluation unit is further configured to: Determine the key dialogue scenes of the second dialogue sample and the third dialogue sample, respectively; wherein the key dialogue scenes include at least: dialogue turning points and key information fragments containing preset semantic types; Identify whether the unselected dialogue samples contain key dialogue scenes; If the unselected dialogue samples contain key dialogue scenes, the dialogue sample segments corresponding to the key dialogue scenes are extracted and updated into the target dialogue sample segments.

[0140] Further optionally, after randomly selecting a target dialogue sample segment for quality assessment from the second dialogue sample and the third dialogue sample, the evaluation unit is further configured to: Detecting whether there are multiple dialogue lengths of the target dialogue sample; Detecting whether there are multiple types of emotional expressions contained in the target dialogue sample; Detecting whether the target conversation sample has multiple topic ranges; If any dimension of the target conversation sample in terms of conversation length, emotion expression type, or topic scope is of a single type, conversation sample segments of other types are re-extracted and updated into the target conversation sample segments.

[0141] The system can implement various steps in the above method embodiment, which will not be expanded here.

[0142] In the embodiment of the present application, a data enhancement device for anthropomorphic dialogue is used to implement automated data enhancement processing for anthropomorphic dialogue, thereby improving the data enhancement efficiency of model training data, enriching the diversity of anthropomorphic dialogue while ensuring the quality of training data, and helping to further improve model training effects and model performance.

[0143] See also Figure 3 , Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present application. Figure 3 As shown, an embodiment of the present application provides an electronic device 500, including a memory 510, a processor 520, and a computer program 511 stored in the memory 510 and executable on the processor 520. When the processor 520 executes the computer program 511, the following steps are implemented: obtaining first training data of multiple rounds of anthropomorphic dialogues from a training data set; the first training data at least includes: text data and / or sound data; analyzing and extracting the first training data based on an anthropomorphic analysis model to obtain anthropomorphic features and a first dialogue sample corresponding to the first training data; the first dialogue sample is a training data segment containing the anthropomorphic features in the first training data; generating a second dialogue sample based on the anthropomorphic features; the second dialogue sample is consistent with the character dialogue style of the first dialogue sample; regenerating the dialogue content in the first dialogue sample based on the anthropomorphic features to obtain a third dialogue sample; the third dialogue sample is consistent with the character dialogue style of the first dialogue sample; performing quality assessment on the second dialogue sample and the third dialogue sample, and updating the dialogue sample that passes the quality assessment as the second training data into the training data set.

[0144] See also Figure 4 , Figure 4 A schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present application. Figure 4As shown, this embodiment provides a computer-readable storage medium 600, on which a computer program 611 is stored. When the computer program 611 is executed by a processor, the following steps are implemented: obtaining first training data of multiple rounds of anthropomorphic dialogues from a training data set; the first training data at least includes: text data and / or sound data; analyzing and extracting the first training data based on an anthropomorphic analysis model to obtain anthropomorphic features and a first dialogue sample corresponding to the first training data; the first dialogue sample is a training data segment containing the anthropomorphic features in the first training data; generating a second dialogue sample based on the anthropomorphic features; the second dialogue sample is consistent with the character dialogue style of the first dialogue sample; regenerating the dialogue content in the first dialogue sample based on the anthropomorphic features to obtain a third dialogue sample; the third dialogue sample is consistent with the character dialogue style of the first dialogue sample; performing quality assessment on the second dialogue sample and the third dialogue sample, and updating the dialogue sample that passes the quality assessment as the second training data into the training data set.

[0145] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0146] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.

[0147] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data enhancement method for human-like dialogue, characterized in that: The method comprises: Acquire first training data of multiple rounds of anthropomorphic dialogue from a training data set; the first training data at least includes: text data and / or sound data; Analyze and extract the first training data based on the anthropomorphic analysis model to obtain anthropomorphic features and a first dialogue sample corresponding to the first training data; the first dialogue sample is a training data segment containing the anthropomorphic features in the first training data; generating a second dialogue sample based on the anthropomorphic feature; wherein the second dialogue sample has a consistent dialogue style with the character in the first dialogue sample; Regenerate the dialogue content in the first dialogue sample based on the anthropomorphic features to obtain a third dialogue sample; the third dialogue sample has a consistent dialogue style with the character in the first dialogue sample; The second dialogue sample and the third dialogue sample are quality evaluated, and the dialogue samples that pass the quality evaluation are updated into the training data set as second training data.

2. The method for data enhancement of human-like dialogue according to claim 1, characterized in that: The analyzing and extracting the first training data based on the anthropomorphic analysis model to obtain anthropomorphic features and a first dialogue sample corresponding to the first training data includes: Performing data cleaning and formatting processing on the first training data to obtain preprocessed first training data; Inputting the preprocessed first training data into the anthropomorphic analysis model to extract an anthropomorphic feature set consisting of a plurality of key features; The first dialogue sample is extracted from the preprocessed first training data according to the anthropomorphic feature set.

3. The method for data enhancement of human-like dialogue according to claim 2, characterized in that: The anthropomorphic analysis model at least includes the following structures: a text feature extraction layer, a pattern recognition layer, a speech analysis layer, and a feature integration layer; The pre-processed first training data is input into the anthropomorphic analysis model to extract an anthropomorphic feature set consisting of multiple key features, including: Analyzing the preprocessed text data in the first training data through a text feature extraction layer to identify character features and first dialogue mode features in the text data; Analyzing the contextual relationship in the preprocessed first training data through the pattern recognition layer to obtain a second dialogue pattern feature derived from the contextual relationship; Performing feature analysis on the sound data in the preprocessed first training data through the speech analysis layer to obtain speech emotion features in the sound data; By integrating the character features, the first dialogue mode features, the second dialogue mode features, and the voice emotion features through the feature integration layer, the anthropomorphic feature set is constructed; Among them, character characteristics include at least one of the following: personal information, personality characteristics, emotional state, voice characteristics, and knowledge background; dialogue mode characteristics include at least one of the following: greeting method, farewell method, inquiry method, answering method, emotional expression characteristics, request and command method, and topic change method.

4. The method for data enhancement of human-like dialogue according to claim 1, characterized in that: The generating a second dialogue sample based on the anthropomorphic feature comprises: The anthropomorphic features are used as embedding vectors of an anthropomorphic dialogue generation model, and multiple rounds of anthropomorphic dialogues are generated by the anthropomorphic dialogue generation model as the second dialogue samples.

5. The method for data enhancement of human-like dialogue according to claim 4, characterized in that: The method of using the anthropomorphic features as the embedding vector of the anthropomorphic dialogue generation model and generating multiple rounds of anthropomorphic dialogues through the anthropomorphic dialogue generation model as the second dialogue samples includes: Convert the anthropomorphic features into corresponding embedding vectors; Selecting a large language model used in the current environment as the anthropomorphic dialogue generation model, and setting conditional generation parameters of the anthropomorphic dialogue generation model; Using prompt words matching the anthropomorphic features to adjust the conversation style of the anthropomorphic dialogue generation model; The embedding vector is input into the anthropomorphic dialogue generation model to generate multiple rounds of anthropomorphic dialogues having the same character dialogue style as the first dialogue sample as the second dialogue sample.

6. The method for data enhancement of human-like dialogue according to claim 4, characterized in that: Before using the anthropomorphic features as the embedding vectors of the anthropomorphic dialogue generation model and generating multiple rounds of anthropomorphic dialogues through the anthropomorphic dialogue generation model as the second dialogue sample, the method further includes: Based on data augmentation requirements, determine the model temperature parameters used to control the degree of conversation diversity and randomness; Adjusting the numerical value of the model temperature parameter to adjust the overlap between the dialogue content of multiple rounds of anthropomorphic dialogues generated by the anthropomorphic dialogue generation model and the dialogue content in the first dialogue sample; Among them, the higher the value of the model temperature parameter, the higher the diversity and randomness of the dialogue content of the multiple rounds of anthropomorphic dialogues, and the lower the overlap between the dialogue content of the multiple rounds of anthropomorphic dialogues and the dialogue content of the first dialogue sample.

7. The method for data enhancement of human-like dialogue according to claim 6, characterized in that: The adjusting the numerical value of the model temperature parameter to adjust the overlap between the dialogue content of the multiple rounds of anthropomorphic dialogues generated by the anthropomorphic dialogue generation model and the dialogue content in the first dialogue sample includes: Setting a plurality of parameter value intervals of the model temperature parameter; wherein the numerical interval ranges of the plurality of parameter value intervals are associated with the characteristics of the person; Randomly select any one of the multiple parameter value intervals to set the model temperature parameter of the anthropomorphic dialogue generation model in the current interval to obtain the second dialogue sample with multiple gradient dialogue diversity and randomness.

8. The method for data enhancement of human-like dialogue according to claim 1, characterized in that: The regenerating the dialogue content in the first dialogue sample based on the anthropomorphic feature to obtain a third dialogue sample includes: Convert the anthropomorphic features into corresponding embedding vectors; Encoding context information of the first conversation sample into a context vector; Selecting a large language model used in the current environment as the anthropomorphic dialogue generation model, and setting conditional generation parameters of the anthropomorphic dialogue generation model; Using prompt words matching the anthropomorphic features to adjust the conversation style of the anthropomorphic dialogue generation model; The embedding vector and the context vector are input into the anthropomorphic dialogue generation model to generate multiple rounds of anthropomorphic dialogues having the same character dialogue style as the first dialogue sample as the third dialogue sample.

9. The method for data enhancement of human-like dialogue according to claim 1, characterized in that: The step of performing quality assessment on the second dialogue sample and the third dialogue sample, and updating the dialogue samples that pass the quality assessment into the training data set as second training data, comprises: Randomly selecting target dialogue sample segments for quality assessment from the second dialogue sample and the third dialogue sample; wherein the ratio between the selected dialogue sample segments and the corresponding dialogue samples complies with a pre-configured sampling ratio; Setting quality assessment conditions for the second dialogue sample and the third dialogue sample; the quality assessment conditions are composed of adaptive configurations from at least one dimension of grammar detection, spelling detection, consistency detection, context coherence, sentiment analysis, dialogue style, topic relevance, and character individualization; Screening the second dialogue sample and the third dialogue sample based on the quality evaluation condition to obtain quality evaluation values ​​corresponding to the second dialogue sample and the third dialogue sample respectively; The conversation samples whose quality evaluation values ​​reach the set evaluation threshold are used as the second training data, and the second training data are updated into the training data set.

10. A data enhancement device for anthropomorphic dialogue, characterized in that: The device comprises the following units, wherein: An acquisition unit is configured to acquire first training data of multiple rounds of anthropomorphic dialogues from a training data set; the first training data at least includes: text data and / or sound data; an extraction unit configured to analyze and extract the first training data based on an anthropomorphic analysis model to obtain an anthropomorphic feature and a first dialogue sample corresponding to the first training data; the first dialogue sample is a training data segment containing the anthropomorphic feature in the first training data; A first generating unit is configured to generate a second dialogue sample based on the anthropomorphic feature; the second dialogue sample has a consistent character dialogue style with the first dialogue sample; A second generating unit is configured to regenerate the dialogue content in the first dialogue sample based on the anthropomorphic feature to obtain a third dialogue sample; the third dialogue sample has a consistent dialogue style with the character in the first dialogue sample; An evaluation unit is configured to perform quality evaluation on the second dialogue sample and the third dialogue sample, and update the dialogue samples that pass the quality evaluation into the training data set as second training data.

Citation Information

Patent Citations

  • Virtual anchor dialogue model processing method and device and electronic equipment

    CN117253480A

  • Method for generating statement from natural language to SQL in business scene based on large model

    CN117708162A

  • Dialogue style migration reply information display method and device, equipment and readable medium

    CN117932043A

  • Natural language processing task execution and model training method, device and equipment

    CN118278527A

  • Real-time system for spoken natural stylistic conversations with large language models

    WO2024112393A1

Cited By

  • Controllable dialogue case generation method based on large model

    CN120353907A

  • Personality adaptive training and dynamic evolution method of role large model and related products

    CN121766484A