Voice-based role separation method and device, equipment and medium

By obtaining and utilizing dialogue scenes, styles and attitude information, generating simulated dialogue texts and training role confirmation models, the problem of speaker separation and role confirmation in complex dialogue scenes is solved, and efficient role separation and confirmation effects are achieved.

CN119724196AActive Publication Date: 2025-03-28PING AN TECH (SHENZHEN) CO LTD

Patent Information

Application Number
CN202411765118.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-28
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

It is difficult to achieve speaker separation and role confirmation in the prior art in complex dialogue scenarios, especially in single-channel recordings, which are difficult to accurately capture subtle emotional fluctuations and context changes in dialogue.

Method used

By obtaining the scene information, style information and attitude information of the simulated dialogue, a dialogue prompt for the simulated dialogue is generated, and a pre-trained language model is used to generate dialogue text, training the target role confirmation model, and finally separating the customer service recording data.

Benefits of technology

It realizes the precise capture of subtle emotional fluctuations and context changes in dialogue in complex dialogue scenarios, effectively distinguishing and confirming the speaker's role, and improving the performance and generalization capabilities of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119724196A_ABST
    Figure CN119724196A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of artificial intelligence, and relates to a voice-based role separation method, which comprises the following steps: acquiring scene information, style information and attitude information of a simulated dialogue; based on the scene information, the style information and the attitude information, generating a dialogue prompt for simulating the dialogue; based on the dialogue prompt, adopting a pre-trained language model to generate a dialogue text for simulating the dialogue; according to the dialogue text, training a preset role confirmation model to obtain a target role confirmation model; and obtaining single-channel customer service recording data, and carrying out role separation on the customer service recording data by adopting the target role confirmation model to obtain target voices corresponding to different roles in the customer service recording data. The invention further provides a device, equipment and a medium. In addition, the invention also relates to a block chain technology, and scene information, style information and attitude information can be stored in a block chain. According to the invention, the roles of the speaker can be effectively distinguished and confirmed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a voice-based role separation method, device, equipment and medium. Background Art

[0002] In the current field of speech recognition and speaker recognition technology, many products and technologies still rely mainly on traditional acoustic models and language models. These models are highly dependent on labeled data during construction and usually require massive amounts of labeled data for in-depth training. However, the data collection and labeling process is not only extremely time-consuming and labor-intensive, but also comes with high costs, which to a large extent limits the further development and popularization of related technologies.

[0003] In addition, existing technologies are often unable to cope with complex dialogue scenarios, especially speaker separation and role confirmation tasks in single-channel recordings. When dealing with such tasks, traditional methods have difficulty accurately capturing subtle emotional fluctuations and contextual changes in the conversation, resulting in insufficient generalization of the technology and greatly reduced practical application effects. In particular, in scenarios with multiple speakers, existing technologies have difficulty effectively distinguishing and confirming the specific role of each speaker, especially in the absence of visual auxiliary information. This problem is particularly prominent. In summary, there is an urgent need for a method that can achieve speaker separation and role confirmation in complex dialogue scenarios. Summary of the invention

[0004] The purpose of the embodiments of the present application is to propose a voice-based role separation method, device, equipment and medium to solve the problem that it is difficult to separate speakers and confirm roles in complex dialogue scenarios using existing methods.

[0005] In order to solve the above technical problems, the embodiment of the present application provides a voice-based role separation method, which adopts the following technical solutions:

[0006] Acquire scene information, style information and attitude information of the simulated dialogue; generate dialogue prompts for the simulated dialogue based on the scene information, style information and attitude information; based on the dialogue prompts, use a pre-trained language model to generate dialogue text for the simulated dialogue; according to the dialogue text, train a preset role confirmation model to obtain a target role confirmation model; acquire single-channel customer service recording data, use the target role confirmation model to perform role separation on the customer service recording data, and obtain target voices corresponding to different roles in the customer service recording data.

[0007] Furthermore, the step of generating a dialogue prompt for a simulated dialogue based on the scene information, the style information, and the attitude information specifically includes:

[0008] The scene information, style information and attitude information are analyzed and processed respectively to obtain a scene feature vector corresponding to the scene information, a style feature vector corresponding to the style information, and an attitude feature vector corresponding to the attitude information; according to the scene feature vector, the dialogue scene is matched from a pre-built dialogue scene library to obtain scene auxiliary information of the dialogue scene; according to the style feature vector, the dialogue style is matched from a pre-built dialogue style library to obtain style expression information of the dialogue style; according to the attitude feature vector, the dialogue attitude is matched from a pre-built dialogue attitude library to obtain attitude expression elements of the dialogue attitude; the scene auxiliary information, style expression information and attitude expression elements are integrated to generate dialogue prompts for simulated dialogue that conform to the dialogue scene, dialogue style and dialogue attitude.

[0009] Furthermore, based on the dialogue prompts, the steps of using the pre-trained language model to generate a dialogue text of the simulated dialogue specifically include:

[0010] The dialogue prompt is input into a pre-trained language model to generate a candidate simulated dialogue text set, where the candidate simulated dialogue text set includes multiple simulated dialogue texts; the multiple simulated dialogue texts are deduplicated to obtain a dialogue text of the simulated dialogue.

[0011] Furthermore, the step of performing deduplication processing on the multiple simulated dialogue texts to obtain the dialogue text of the simulated dialogue specifically includes:

[0012] A preset text vectorization algorithm is used to vectorize each simulated dialogue text to obtain a dialogue text vector corresponding to each simulated dialogue text; the similarity between all dialogue text vectors is calculated to obtain a similarity matrix; a preset similarity threshold is obtained to determine whether the value of each element in the similarity matrix is ​​higher than the similarity threshold; if the value of each element in the similarity matrix is ​​higher than the similarity threshold, the corresponding two simulated dialogue texts are marked as duplicate texts; all simulated dialogue texts marked as duplicate texts are filtered to obtain the dialogue text of the simulated dialogue.

[0013] Further, according to the dialogue text, the preset role confirmation model is trained to obtain the step of the target role confirmation model, which specifically includes:

[0014] The dialogue text is segmented to obtain text data after segmentation; stop words are filtered out of the text data according to a preset stop word list to obtain a preprocessed simulated dialogue training text; a training data set is constructed according to the simulated dialogue training text, and each sample in the training data set consists of a simulated dialogue training text and a first role label corresponding to the simulated dialogue training text; based on the simulated dialogue training text and the first role label, a preset role confirmation model is trained to obtain a trained target role confirmation model.

[0015] Furthermore, after the step of training a preset role confirmation model based on the simulated dialogue training text and the first role label to obtain a trained target role confirmation model, the method further includes:

[0016] A preset test data set is obtained, where the test data set includes multiple sample data and second role labels corresponding to the multiple sample data; based on the multiple sample data and the second role labels, a target role confirmation model is verified to obtain a verification result; based on the verification result and preset model performance indicators, the performance of the target role confirmation model is evaluated.

[0017] Further, based on the conversation text, the target role confirmation model is used to separate the roles of the customer service recording data to obtain the target voices corresponding to different roles in the customer service recording data, which specifically includes:

[0018] Preprocess the customer service recording data to obtain preprocessed recording data; use a preset voice activity detection algorithm to segment the recording data to obtain multiple voice segments; extract the acoustic features of each voice segment to obtain a voiceprint feature vector for each voice segment; input the voiceprint feature vector into the target role confirmation model for role classification to obtain a role classification result for each voice segment; based on the role classification result, merge the voice segments of the same role to obtain target voices corresponding to different roles.

[0019] In order to solve the above technical problems, the embodiment of the present application also provides a voice-based role separation device, which adopts the following technical solutions:

[0020] An acquisition module is used to obtain scene information, style information and attitude information of the simulated dialogue;

[0021] A prompt generation module, used to generate dialogue prompts for simulated dialogue based on scene information, style information, and attitude information;

[0022] A text generation module is used to generate dialogue text of simulated dialogue based on dialogue prompts using a pre-trained language model;

[0023] A training module is used to train a preset role confirmation model according to the dialogue text to obtain a target role confirmation model;

[0024] The role separation module is used to obtain single-channel customer service recording data, adopt the target role confirmation model, separate the customer service recording data into roles, and obtain the target voices corresponding to different roles in the customer service recording data.

[0025] In order to solve the above technical problems, an embodiment of the present application also provides a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the above-mentioned voice-based role separation method are implemented.

[0026] In order to solve the above technical problems, an embodiment of the present application also provides a computer-readable storage medium, which stores computer-readable instructions. The computer-readable instructions can be executed by at least one processor to enable at least one processor to perform the steps of the above-mentioned voice-based role separation method.

[0027] Compared with the prior art, the embodiment of the present application has the following beneficial effects: by accurately acquiring the scene information, style information and attitude information of the simulated dialogue, a solid contextual foundation is laid for the subsequent dialogue generation. Based on this rich information, the generated dialogue prompts can meticulously guide the pre-trained language model, so that the simulated dialogue data produced by it is not only sufficient in quantity but also excellent in quality, effectively avoiding the problem of insufficient training data and uneven quality in traditional methods. Thanks to the powerful generation power of the large pre-trained language model and the refined control of this solution, the generated simulated dialogue data fully demonstrates the complexity and diversity of real dialogues. From scene simulation to style and attitude grasp, each step strives to be highly simulated, so that the training data is both real and diverse. Furthermore, this highly simulated training data is used to train the target role confirmation model, which greatly improves the performance and generalization ability of the model. In the face of complex dialogue scenes, especially the speaker separation and role confirmation tasks in single-channel recordings, the model can accurately capture the subtle emotional fluctuations and context changes in the dialogue, and realize the effective distinction and confirmation of the speaker's role. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0029] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0030] Figure 2 It is a flowchart of a voice-based role separation method provided by the present application;

[0031] Figure 3 It is a structural schematic diagram of a voice-based role separation device provided by the present application;

[0032] Figure 4It is a structural schematic diagram of a computer device provided by this application. DETAILED DESCRIPTION

[0033] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0034] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0035] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0036] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables.

[0037] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0038] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to a laptop computer 1011, a tablet computer 1012 or a mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.

[0039] The server 103 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal device 101 .

[0040] It should be noted that the voice-based role separation method provided in the embodiment of the present application is generally executed by a server, and accordingly, the voice-based role separation device is generally arranged in the server.

[0041] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0042] Continue to refer Figure 2 , shows a flow chart of an embodiment of a method for separating roles based on speech according to the present application. The method for separating roles based on speech comprises the following steps:

[0043] Step S201, obtaining scene information, style information and attitude information of simulated dialogue.

[0044] In this embodiment, the electronic device (eg, Figure 1 The server shown in the figure) can obtain scene information, style information and attitude information through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.

[0045] Among them, simulated dialogue refers to the dialogue content generated by computer algorithms that simulates real scenes. It is based on preset scenes, styles and attitude information, guided by dialogue prompts, and used to simulate real dialogue scenes to train and optimize speech recognition and speaker recognition technology. For example, a simulated dialogue can be a conversation between two characters ordering food in a restaurant.

[0046] The scene information refers to the specific environment or background where the conversation takes place, such as a restaurant, office, or home. It represents the location and context of the conversation and is used to generate conversation prompts that match the scene. For example, if the scene information is "restaurant", the generated conversation may involve ordering food, checking out, and so on.

[0047] The style information refers to the language style in the conversation, such as formal, casual, humorous, etc. It represents the language characteristics of the interlocutor and is used to generate dialogue prompts that match the style. For example, if the style information is "casual", the generated dialogue may use more colloquial and friendly language.

[0048] Among them, attitude information refers to the emotional attitude expressed by the interlocutor, such as positive, negative, neutral, etc. It represents the emotional state of the interlocutor and is used to generate dialogue prompts that match the attitude. For example, if the attitude information is "positive", the generated dialogue may contain more encouragement and praise.

[0049] Step S202: Generate a dialogue prompt for a simulated dialogue based on the scene information, style information, and attitude information.

[0050] Among them, the dialogue prompt refers to the instruction or prompt that guides the generation of the dialogue. It is generated based on the scene, style and attitude information, and contains key information such as the context, role, and topic of the dialogue. For example, the dialogue prompt can be "a conversation between an enthusiastic waiter and a satisfied customer ordering food in a restaurant."

[0051] Step S203, based on the dialogue prompts, using the pre-trained language model, generates a dialogue text of the simulated dialogue.

[0052] Among them, the pre-trained language model refers to a language model that has been pre-trained on large-scale text data. It has powerful text generation capabilities and can generate high-quality dialogue text based on dialogue prompts.

[0053] The dialogue text refers to the simulated dialogue content generated by the pre-trained language model, which is used to train the role confirmation model. For example, the dialogue text can be "Waiter: Hello, welcome! What would you like to order? Customer: I would like a steak and a Coke."

[0054] Step S204: training a preset role confirmation model according to the dialogue text to obtain a target role confirmation model.

[0055] The preset role confirmation model refers to a model that has been set before training and is used to identify the speaker role in the conversation. It needs to be trained with the conversation text to improve the recognition performance. For example, the role confirmation model can be a classification model based on deep learning.

[0056] The target role confirmation model refers to a model that can accurately identify the speaker role in a conversation after being trained with the conversation text. It can be used for role classification tasks in practical applications. For example, the target role confirmation model can identify the "waiter" and "customer" in a conversation.

[0057] Step S205, obtaining single-channel customer service recording data, using the target role confirmation model to perform role separation on the customer service recording data, and obtaining target voices corresponding to different roles in the customer service recording data.

[0058] Among them, single channel refers to the situation where the recorded data has only one channel, which means that the sound signal in the recorded data comes from a single source. For example, single channel customer service recording data means that the conversation between the customer service and the customer is recorded on the same channel.

[0059] The customer service recording data refers to the audio data recorded when the customer service staff has a conversation with the customer, which is used to extract acoustic features and perform role classification. For example, the customer service recording data contains multiple conversation segments between the customer service staff and the customer.

[0060] The target speech refers to a set of speech segments belonging to the same role obtained by merging the role classification results, which is used for subsequent analysis or processing. For example, the target speech can be the result of merging all the speech segments of the "customer service" role.

[0061] The embodiment of the present application can lay a solid contextual foundation for subsequent dialogue generation by accurately obtaining the scene information, style information and attitude information of the simulated dialogue. Based on this rich information, the generated dialogue prompts can guide the pre-trained language model in detail, so that the simulated dialogue data produced by it is not only sufficient in quantity but also excellent in quality, effectively avoiding the problem of lack of training data and uneven quality in traditional methods. Thanks to the powerful generation power of the large pre-trained language model and the refined control of this solution, the generated simulated dialogue data fully demonstrates the complexity and diversity of real dialogues. From scene simulation to style and attitude grasp, each step strives to be highly simulated, so that the training data is both real and diverse. Furthermore, this highly simulated training data is used to train the target role confirmation model, which greatly improves the performance and generalization ability of the model. In the face of complex dialogue scenes, especially the speaker separation and role confirmation tasks in single-channel recordings, the model can accurately capture the subtle emotional fluctuations and context changes in the dialogue, and realize the effective distinction and confirmation of the speaker's role.

[0062] In some optional implementations of this embodiment, step 202, generating a dialogue prompt for a simulated dialogue based on the scene information, the style information, and the attitude information, specifically includes the following steps:

[0063] The scene information, style information and attitude information are analyzed and processed respectively to obtain a scene feature vector corresponding to the scene information, a style feature vector corresponding to the style information, and an attitude feature vector corresponding to the attitude information; according to the scene feature vector, the dialogue scene is matched from a pre-built dialogue scene library to obtain scene auxiliary information of the dialogue scene; according to the style feature vector, the dialogue style is matched from a pre-built dialogue style library to obtain style expression information of the dialogue style; according to the attitude feature vector, the dialogue attitude is matched from a pre-built dialogue attitude library to obtain attitude expression elements of the dialogue attitude; the scene auxiliary information, style expression information and attitude expression elements are integrated to generate dialogue prompts for simulated dialogue that conform to the dialogue scene, dialogue style and dialogue attitude.

[0064] The scene feature vector refers to the conversion of scene information into a numerical vector that can be recognized by a computer, which is used to match the corresponding dialogue scene from the dialogue scene library. For example, the feature vector of a restaurant scene may contain vector representations of keywords such as "food" and "service".

[0065] The style feature vector refers to the conversion of style information into a numerical vector that can be recognized by a computer, which is used to match the corresponding conversation style from the conversation style library. For example, the feature vector of the casual style may contain vector representations of keywords such as "colloquial" and "friendly".

[0066] The attitude feature vector refers to the conversion of attitude information into a numerical vector that can be recognized by a computer, which is used to match the corresponding conversation attitude from the conversation attitude library. For example, the feature vector of a positive attitude may contain vector representations of keywords such as "encouragement" and "praise".

[0067] The dialogue scene library refers to a database that stores dialogue scene information in different scenarios, and is used to match the corresponding dialogue scene according to the scene feature vector. For example, the dialogue scene library may contain multiple scenes such as a restaurant, an office, and a home.

[0068] The dialogue scene refers to the specific environment and context in which the dialogue takes place. It is matched from the dialogue scene library and used to generate dialogue prompts that match the scene. For example, a dialogue scene can be "ordering food in a restaurant."

[0069] Among them, scene auxiliary information refers to auxiliary information related to the dialogue scene, such as the background description of the scene, role settings, etc., which is used to enrich the dialogue prompts. For example, the scene auxiliary information of the restaurant ordering scene may include "the restaurant environment is elegant and the waiters are warm and thoughtful."

[0070] The conversation style library refers to a database storing conversation style information of different language styles, which is used to match the corresponding conversation style according to the style feature vector. For example, the conversation style library may contain multiple styles such as formal, casual, and humorous.

[0071] The conversation style refers to the language style in the conversation, which is matched from the conversation style library and used to generate conversation prompts that match the style. For example, a conversation style can be "casual chat".

[0072] Among them, style expression information refers to expression information related to the conversation style, such as language characteristics, word usage habits, etc., which is used to enrich conversation prompts. For example, the style expression information of casual chat style may include "using colloquial vocabulary and friendly tone".

[0073] In one example, the input scenario information (such as "loan consultation"), style information (such as "formal"), and attitude information (such as "positive") are parsed and processed. Using the deep learning model, the scenario feature vector, style feature vector, and attitude feature vector are extracted respectively. Then, according to the scenario feature vector, the "loan consultation" scenario is matched from the pre-built financial dialogue scenario library, and the scenario auxiliary information under this scenario is obtained, such as a list of common questions, a professional terminology library, etc. According to the style feature vector, the "formal" style is matched from the dialogue style library, and the corresponding style expression information is obtained, such as polite language, formal address, etc. According to the attitude feature vector, the "positive" attitude is matched from the dialogue attitude library, and the attitude expression elements are obtained, such as encouraging reply templates, positive emotional vocabulary, etc. Finally, the above three types of information are fused to generate simulated dialogue prompts that meet the "loan consultation" scenario, "formal" style, and "positive" attitude.

[0074] The embodiments of the present application can deeply capture the multi-dimensional information in the conversation, including environmental background, communication methods, emotional tendencies, etc., by analyzing the scene, style and attitude information and generating corresponding feature vectors respectively, providing a rich data foundation for subsequent matching and fusion. Using the pre-built dialogue scene library, dialogue style library and dialogue attitude library, it is possible to quickly match the scene auxiliary information, style expression information and attitude expression elements that best match the current dialogue. This process not only reduces the dependence on massive annotated data, but also significantly improves the generalization ability of the technology, enabling it to flexibly respond to various complex dialogue scenarios. Finally, by integrating the above-mentioned multi-dimensional information, the generated simulated dialogue prompts not only meet the requirements of dialogue scenes, styles and attitudes, but also can accurately reflect the subtle emotional fluctuations and context changes in the dialogue.

[0075] In some optional implementations of this embodiment, step S203, based on the dialogue prompt, using the pre-trained language model to generate a dialogue text of the simulated dialogue, specifically includes the following steps:

[0076] The dialogue prompt is input into a pre-trained language model to generate a candidate simulated dialogue text set, where the candidate simulated dialogue text set includes multiple simulated dialogue texts; the multiple simulated dialogue texts are deduplicated to obtain a dialogue text of the simulated dialogue.

[0077] The candidate simulated dialogue text set may include multiple possible dialogue contents for subsequent deduplication and screening. For example, the candidate simulated dialogue text set may include multiple versions of restaurant ordering dialogues.

[0078] In one example, a dialogue prompt is generated based on the dialogue scenario, style, and attitude information in the financial field. For example, the dialogue scenario is "credit card repayment consultation", the style is "formal and friendly", and the attitude is "patient answer". Based on this information, a dialogue prompt is generated: "Please explain to the user the method and precautions of credit card repayment, and ensure that the answer is formal, friendly, and patient." Then, the dialogue prompt is input into the pre-trained language model to generate a candidate simulated dialogue text set. With its powerful natural language processing capabilities, the model can generate multiple simulated dialogue texts that meet the requirements. These texts cover key information such as various methods of credit card repayment, the setting of repayment dates, and the consequences of overdue repayments, and are formal, friendly, and patiently answer users' questions. However, there may be duplicate or similar texts in the generated candidate simulated dialogue text set. In order to improve the diversity of dialogue and user experience, multiple simulated dialogue texts can be deduplicated. By comparing the similarity between texts, duplicate or highly similar texts are deleted, and finally a simulated dialogue text after deduplication is obtained.

[0079] The embodiment of the present application can input the dialogue prompts that integrate the scene, style and attitude information into the pre-trained language model. This step fully utilizes the pre-trained model's deep understanding of language structure and context information, so that the generated candidate simulated dialogue text set is not only rich in content, but also closely fits the requirements in the dialogue prompts. In the multiple simulated dialogue texts generated, the redundancy and repetition of the content are effectively avoided through deduplication processing, ensuring the uniqueness and practicality of each dialogue text. This step not only improves the diversity of dialogue texts, but also provides a richer selection space for subsequent applications.

[0080] In some optional implementations of this embodiment, the step of “deduplicate multiple simulated conversation texts to obtain conversation texts of simulated conversations” specifically includes the following steps:

[0081] A preset text vectorization algorithm is used to vectorize each simulated dialogue text to obtain a dialogue text vector corresponding to each simulated dialogue text; the similarity between all dialogue text vectors is calculated to obtain a similarity matrix; a preset similarity threshold is obtained to determine whether the value of each element in the similarity matrix is ​​higher than the similarity threshold; if the value of each element in the similarity matrix is ​​higher than the similarity threshold, the corresponding two simulated dialogue texts are marked as duplicate texts; all simulated dialogue texts marked as duplicate texts are filtered to obtain the dialogue text of the simulated dialogue.

[0082] Among them, the text vectorization algorithm refers to the algorithm that converts text into a numerical vector that can be recognized by a computer, such as TF-IDF (Term Frequency-Inverse Document Frequency) and Word2Vec.

[0083] The conversation text vector refers to the numerical vector representation of the conversation text generated by the text vectorization algorithm, which is used to calculate the similarity between conversation texts. For example, a conversation text vector may contain multiple dimensional numerical values ​​representing different features of the text.

[0084] The similarity matrix is ​​a matrix used to store the similarities between conversation text vectors, and is used to determine whether the conversation texts are repeated. For example, each element of the similarity matrix can represent the cosine similarity between two conversation text vectors.

[0085] Here, an element is a single value in the similarity matrix, which represents the similarity between two conversation text vectors. For example, the value of an element may be 0.8, indicating that the similarity between the corresponding two conversation text vectors is high.

[0086] In one example, in a financial intelligent customer service system, multiple simulated conversation texts generated often have repeated or highly similar content, and need to be deduplicated. The TF-IDF algorithm can be used as a preset text vectorization algorithm to vectorize each simulated conversation text. Then the cosine similarity between all conversation text vectors can be calculated to obtain a similarity matrix. Cosine similarity is a measurement method for measuring the difference in the directions of two vectors. The value range is [-1,1]. The larger the value, the more similar the two vectors are. In order to determine the threshold of duplicate text, a similarity threshold (for example, 0.85) can be preset. Then, each element in the similarity matrix is ​​traversed to determine whether its value is higher than the similarity threshold. If the value of an element is higher than the threshold, the two corresponding simulated conversation texts are marked as duplicate texts. Finally, all simulated conversation texts marked as duplicate texts are filtered, and only unique texts are retained, thereby obtaining a deduplicated simulated conversation text set.

[0087] The embodiment of the present application can convert each simulated dialogue text into a corresponding dialogue text vector through a preset text vectorization algorithm. This process makes full use of the efficiency and accuracy of the text vectorization algorithm in processing large-scale text data. Then, the similarity between all dialogue text vectors is calculated to obtain a similarity matrix. This step not only takes into account the overall similarity between texts, but also intuitively displays the similarity relationship between texts in the form of a similarity matrix, providing strong support for subsequent deduplication processing. After obtaining the preset similarity threshold, traverse each element in the similarity matrix to determine whether its value is higher than the threshold. If it is higher than the threshold, the corresponding two simulated dialogue texts are marked as duplicate texts. This step can accurately identify and filter out highly similar texts by setting a reasonable threshold, avoiding the interference of redundant information. Finally, all simulated dialogue texts marked as duplicate texts are filtered to obtain a simulated dialogue text set after deduplication. This process not only improves the quality and diversity of the text set, but also provides more accurate and efficient text data support for subsequent dialogue system applications.

[0088] In some optional implementations of this embodiment, step S204, training a preset role confirmation model according to the dialogue text to obtain a target role confirmation model, specifically includes the following steps:

[0089] Perform word segmentation on the dialogue text to obtain the segmented text data; according to the preset stop word list, filter the stop words from the text data to obtain the preprocessed simulated dialogue training text; based on the simulated dialogue training text, construct a training data set, where each sample in the training data set consists of the simulated dialogue training text and the corresponding first role label; based on the simulated dialogue training text and the first role label, train the preset role confirmation model to obtain the trained target role confirmation model.

[0090] Among them, the first role label refers to the role label of the speaker in the simulated dialogue training text, which is used to construct the training data set and serve as the training target of the role confirmation model. For example, the first role label can be "waiter" or "customer".

[0091] In one example, word segmentation can be performed on the dialogue text to obtain the segmented text data. Word segmentation is a basic step in natural language processing, which can cut continuous text into meaningful lexical units, facilitating subsequent processing. Then, according to the preset stop word list, filter the stop words from the segmented text data. The stop word list contains a series of words that frequently appear in the text but contribute little to the meaning of the text, such as "de" (的), "le" (了), etc. By filtering out the stop words, the noise in the data can be reduced, improving the efficiency and accuracy of model training. Next, construct the training data set. Each sample consists of the preprocessed simulated dialogue training text and the corresponding first role label. The role label is used to identify different roles in the dialogue, such as "customer service", "customer", etc. By constructing such a training data set, rich training samples can be provided for the role confirmation model, enabling it to learn the characteristics and differences between different roles. Finally, train based on the training data set and the preset role confirmation model (such as a deep learning model, a machine learning model, etc.). During the training process, the model will continuously learn and optimize to more accurately identify different roles in the dialogue. After multiple iterative trainings, the trained target role confirmation model is obtained.

[0092] Among them, during the process of training the role confirmation model, the cross-entropy loss function can be used to optimize the parameters of the role confirmation model, and the regularization method can be used to prevent the role confirmation model from overfitting.

[0093] The embodiment of the present application can effectively improve the granularity of text data by accurately segmenting the dialogue text, laying a solid foundation for subsequent processing. Then, the text data after segmentation is filtered using a preset stop word list, effectively removing redundant information in the dialogue, such as common words that are not substantially helpful for dialogue analysis, thereby significantly improving the quality and pertinence of the simulated dialogue training text. On this basis, the constructed training data set not only contains a wealth of simulated dialogue training texts, but also creatively incorporates the first role label. This design makes the data set more dimensional and provides comprehensive and accurate materials for the training of the role confirmation model. Finally, based on such a high-quality training data set, the preset role confirmation model is trained to ensure that the model fully learns the intrinsic connection between the dialogue text and the role label. This process not only enhances the recognition accuracy of the model, but also improves its ability to accurately judge the role identity in complex dialogue scenarios. Therefore, the trained target role confirmation model can more quickly and accurately confirm the role identities of the parties in the dialogue in practical applications, providing strong support for subsequent dialogue analysis, emotion recognition and other tasks.

[0094] In some optional implementations of this embodiment, after the step of "training a preset role confirmation model based on the simulated dialogue training text and the first role label to obtain a trained target role confirmation model", the following steps are specifically included:

[0095] A preset test data set is obtained, where the test data set includes multiple sample data and second role labels corresponding to the multiple sample data; based on the multiple sample data and the second role labels, a target role confirmation model is verified to obtain a verification result; based on the verification result and preset model performance indicators, the performance of the target role confirmation model is evaluated.

[0096] The test data set refers to a data set used to verify the performance of the role confirmation model, which includes multiple sample data and corresponding second role labels. For example, the test data set may include dialogue texts of multiple different scenes and corresponding role labels.

[0097] The second role label refers to the role label of the speaker in the test data set, which is used to verify the accuracy of the role confirmation model. For example, the second role label can be "manager" or "employee".

[0098] The validation result refers to the result obtained after validating the role confirmation model through the test data set, which is used to evaluate the performance of the model. For example, the validation result may include indicators such as the accuracy and recall rate of the model.

[0099] The preset model performance index refers to a preset standard or index for evaluating the performance of the role confirmation model, such as accuracy, recall, F1 score, etc. For example, the preset model performance index may be an accuracy rate of not less than 90%.

[0100] In one example, during the development of a financial dialogue system, a test data set containing multiple financial dialogue samples can be prepared. These sample data cover a variety of dialogue scenarios between bank customer service and customers, such as account inquiries, transfer operations, financial consulting, etc. Each sample data corresponds to a second role label, which clearly identifies the speaker role in the dialogue, such as "customer service" or "customer". Using the above test data set, the trained target role confirmation model is verified based on multiple sample data and corresponding second role labels. The task of the target role confirmation model is to predict the role label in each sample data and compare it with the actual second role label. According to the verification results, the preset model performance indicators such as the accuracy, recall rate and F1 score of the target role confirmation model are calculated. Among them, the accuracy reflects the proportion of role labels correctly predicted by the target role confirmation model. The recall rate measures the ability of the target role confirmation model to identify all correct role labels. The F1 score is the harmonic average of the accuracy and recall rate, which comprehensively reflects the performance of the target role confirmation model.

[0101] The embodiment of the present application can provide a comprehensive and objective verification environment for the target role confirmation model by obtaining a preset test data set containing rich and diverse sample data and corresponding second role labels. This step ensures that the target role confirmation model can be rigorously tested in different situations, thereby verifying its generalization ability in practical applications. During the verification process, the target role confirmation model can be predicted based on the sample data and the second role label, and compared with the actual label. This process not only verifies the prediction accuracy of the model, but also reveals its stability and reliability in the role recognition task. The output of the verification result provides detailed data support for the subsequent model performance evaluation. Finally, based on the verification results and preset model performance indicators (such as accuracy, recall rate, F1 score, etc.), the target role confirmation model is comprehensively and deeply evaluated. This evaluation not only quantifies the performance of the target role confirmation model in the role confirmation task, but also reveals the advantages and disadvantages of the target role confirmation model by comparing different indicators, and provides a clear guiding direction for the optimization and improvement of the subsequent target role confirmation model.

[0102] In some optional implementations of this embodiment, step S205, using a target role confirmation model to perform role separation on the customer service recording data to obtain target voices corresponding to different roles in the customer service recording data, may specifically include the following steps:

[0103] Preprocess the customer service recording data to obtain preprocessed recording data; use a preset voice activity detection algorithm to segment the recording data to obtain multiple voice segments; extract the acoustic features of each voice segment to obtain a voiceprint feature vector for each voice segment; input the voiceprint feature vector into the target role confirmation model for role classification to obtain a role classification result for each voice segment; based on the role classification result, merge the voice segments of the same role to obtain target voices corresponding to different roles.

[0104] The voice activity detection algorithm refers to an algorithm for detecting voice activity (i.e., speech) in the recording data, and it can divide the recording data into multiple speech segments. For example, the voice activity detection algorithm can identify the silent part and the speech part in the recording.

[0105] Among them, acoustic features refer to features extracted from recording data that can characterize the characteristics of sound signals, such as frequency, energy, spectrum, etc. For example, acoustic features may include the fundamental frequency and formant of speech.

[0106] The voiceprint feature vector refers to the process of converting acoustic features into a numerical vector that can be recognized by a computer. It is used to represent the uniqueness of the voice signal. For example, the voiceprint feature vector may contain multiple dimensional values, representing different characteristics of the voice signal.

[0107] The role classification result refers to the result obtained by classifying the voiceprint feature vector through the target role confirmation model, which indicates the speaker role corresponding to each voice segment. For example, the role classification result may be "customer service" or "customer".

[0108] In one example, first, single-channel recording data containing conversations between customer service and customers can be obtained from a financial customer service system. Next, the recording data can be pre-processed by noise reduction, echo removal, and other pre-processing operations to improve the accuracy of subsequent processing. Then, a preset voice activity detection algorithm is used to segment the pre-processed recording data to obtain multiple voice segments containing voice activities. Then, acoustic features are extracted for each voice segment to obtain its voiceprint feature vector. These feature vectors can reflect the uniqueness of the voice, such as pitch, timbre, etc. The voiceprint feature vector is then input into the trained target role confirmation model for role classification to obtain the role classification result for each voice segment (i.e., customer service or customer). Finally, based on the role classification results, the voice segments of the same role are merged to obtain the target voices corresponding to different roles.

[0109] The embodiment of the present application can effectively reduce environmental noise and interference, and improve the clarity and availability of the recorded data by accurately acquiring single-channel customer service recording data and preprocessing the data. Subsequently, an advanced preset voice activity detection algorithm is used to finely segment the preprocessed recording data, and multiple voice segments containing complete voice activities are successfully obtained, providing high-quality material for subsequent processing. In the feature extraction stage, the acoustic features of each voice segment are accurately captured and converted into voiceprint feature vectors. These vectors highly summarize the uniqueness of the voice segment and provide a strong basis for role classification. After the voiceprint feature vector is input into the target role confirmation model, the model uses its powerful learning and recognition capabilities to accurately classify the role of each voice segment and output reliable role classification results. Finally, according to the role classification results, the voice segments of the same role are intelligently merged to form target voices corresponding to different roles.

[0110] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned scene information, style information and attitude information, the above-mentioned scene information, style information and attitude information can also be stored in a node of a blockchain.

[0111] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0112] The embodiments of the present application can build and optimize related models and networks based on artificial intelligence technology, such as pre-trained language models, role confirmation models, target role confirmation models, etc. Among them, artificial intelligence (AI) models are the crystallization of theory and practice that simulates the decision-making process of human intelligence through algorithms and data analysis to solve complex problems, predict future trends, or realize automation tasks. These models use a large amount of historical data and real-time information, and are trained and optimized through a specific algorithm framework to achieve efficient, accurate and reliable performance.

[0113] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0114] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0115] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a voice-based role separation device, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0116] like Figure 3 As shown, the voice-based role separation device 400 of this embodiment includes: an acquisition module 401, a prompt generation module 402, a text generation module 403, a training module 404 and a role separation module 405. Among them:

[0117] An acquisition module 401 is used to acquire scene information, style information and attitude information of a simulated dialogue;

[0118] A prompt generation module 402, for generating a dialogue prompt for a simulated dialogue based on the scene information, the style information, and the attitude information;

[0119] A text generation module 403 is used to generate a dialogue text of a simulated dialogue based on the dialogue prompts and using a pre-trained language model;

[0120] The training module 404 is used to train the preset role confirmation model according to the dialogue text to obtain a target role confirmation model;

[0121] The role separation module 405 is used to obtain the customer service recording data of a single channel, use the target role confirmation model to perform role separation on the customer service recording data, and obtain the target voices corresponding to different roles in the customer service recording data.

[0122] The embodiment of the present application can lay a solid contextual foundation for subsequent dialogue generation by accurately obtaining the scene information, style information and attitude information of the simulated dialogue. Based on this rich information, the generated dialogue prompts can guide the pre-trained language model in detail, so that the simulated dialogue data produced by it is not only sufficient in quantity but also excellent in quality, effectively avoiding the problem of lack of training data and uneven quality in traditional methods. Thanks to the powerful generation power of the large pre-trained language model and the refined control of this solution, the generated simulated dialogue data fully demonstrates the complexity and diversity of real dialogues. From scene simulation to style and attitude grasp, each step strives to be highly simulated, so that the training data is both real and diverse. Furthermore, this highly simulated training data is used to train the target role confirmation model, which greatly improves the performance and generalization ability of the model. In the face of complex dialogue scenes, especially the speaker separation and role confirmation tasks in single-channel recordings, the model can accurately capture the subtle emotional fluctuations and context changes in the dialogue, and realize the effective distinction and confirmation of the speaker's role.

[0123] In one embodiment, the prompt generation module 402 includes:

[0124] The parsing submodule is used to parse the scene information, style information and attitude information respectively to obtain a scene feature vector corresponding to the scene information, a style feature vector corresponding to the style information, and an attitude feature vector corresponding to the attitude information;

[0125] A first acquisition submodule is used to match a dialogue scene from a pre-built dialogue scene library according to a scene feature vector, and acquire scene auxiliary information of the dialogue scene;

[0126] The second acquisition submodule is used to match the dialogue style from a pre-built dialogue style library according to the style feature vector, and obtain the style expression information of the dialogue style;

[0127] The third acquisition submodule is used to match the dialogue attitude from the pre-built dialogue attitude library according to the attitude feature vector, and obtain the attitude expression elements of the dialogue attitude;

[0128] The fourth acquisition submodule is used to integrate the scene auxiliary information, style expression information and attitude expression elements to generate dialogue prompts for simulated dialogue that conform to the dialogue scene, dialogue style and dialogue attitude.

[0129] The embodiments of the present application can deeply capture the multi-dimensional information in the conversation, including environmental background, communication methods, emotional tendencies, etc., by analyzing the scene, style and attitude information and generating corresponding feature vectors respectively, providing a rich data foundation for subsequent matching and fusion. Using the pre-built dialogue scene library, dialogue style library and dialogue attitude library, it is possible to quickly match the scene auxiliary information, style expression information and attitude expression elements that best match the current dialogue. This process not only reduces the dependence on massive annotated data, but also significantly improves the generalization ability of the technology, enabling it to flexibly respond to various complex dialogue scenarios. Finally, by integrating the above-mentioned multi-dimensional information, the generated simulated dialogue prompts not only meet the requirements of dialogue scenes, styles and attitudes, but also can accurately reflect the subtle emotional fluctuations and context changes in the dialogue.

[0130] In one embodiment, the text generation module 403 includes:

[0131] An input submodule, used for inputting the dialogue prompt into the pre-trained language model to generate a candidate simulated dialogue text set, wherein the candidate simulated dialogue text set includes a plurality of simulated dialogue texts;

[0132] The deduplication submodule is used to perform deduplication processing on multiple simulated dialogue texts to obtain dialogue texts of simulated dialogues.

[0133] The embodiment of the present application can input the dialogue prompts that integrate the scene, style and attitude information into the pre-trained language model. This step fully utilizes the pre-trained model's deep understanding of language structure and context information, so that the generated candidate simulated dialogue text set is not only rich in content, but also closely fits the requirements in the dialogue prompts. In the multiple simulated dialogue texts generated, the redundancy and repetition of the content are effectively avoided through deduplication processing, ensuring the uniqueness and practicality of each dialogue text. This step not only improves the diversity of dialogue texts, but also provides a richer selection space for subsequent applications.

[0134] In one embodiment, the deduplication submodule is further used to use a preset text vectorization algorithm to vectorize each simulated conversation text to obtain a conversation text vector corresponding to each simulated conversation text; calculate the similarity between all conversation text vectors to obtain a similarity matrix; obtain a preset similarity threshold to determine whether the value of each element in the similarity matrix is ​​higher than the similarity threshold; if the value of each element in the similarity matrix is ​​higher than the similarity threshold, mark the corresponding two simulated conversation texts as duplicate texts; filter all simulated conversation texts marked as duplicate texts to obtain conversation texts of simulated conversations.

[0135] The embodiment of the present application can convert each simulated dialogue text into a corresponding dialogue text vector through a preset text vectorization algorithm. This process makes full use of the efficiency and accuracy of the text vectorization algorithm in processing large-scale text data. Then, the similarity between all dialogue text vectors is calculated to obtain a similarity matrix. This step not only takes into account the overall similarity between texts, but also intuitively displays the similarity relationship between texts in the form of a similarity matrix, providing strong support for subsequent deduplication processing. After obtaining the preset similarity threshold, traverse each element in the similarity matrix to determine whether its value is higher than the threshold. If it is higher than the threshold, the corresponding two simulated dialogue texts are marked as duplicate texts. This step can accurately identify and filter out highly similar texts by setting a reasonable threshold, avoiding the interference of redundant information. Finally, all simulated dialogue texts marked as duplicate texts are filtered to obtain a simulated dialogue text set after deduplication. This process not only improves the quality and diversity of the text set, but also provides more accurate and efficient text data support for subsequent dialogue system applications.

[0136] In one embodiment, the training module 404 includes:

[0137] The word segmentation submodule is used to perform word segmentation on the dialogue text to obtain text data after word segmentation;

[0138] A filtering submodule is used to filter the text data for stop words according to a preset stop word list to obtain a preprocessed simulated dialogue training text;

[0139] A construction submodule is used to construct a training data set according to the simulated dialogue training text, wherein each sample in the training data set consists of the simulated dialogue training text and a first role label corresponding to the simulated dialogue training text;

[0140] The training submodule is used to train a preset role confirmation model based on the simulated dialogue training text and the first role label to obtain a trained target role confirmation model.

[0141] The embodiment of the present application can effectively improve the granularity of text data by accurately segmenting the dialogue text, laying a solid foundation for subsequent processing. Then, the text data after segmentation is filtered using a preset stop word list, effectively removing redundant information in the dialogue, such as common words that are not substantially helpful for dialogue analysis, thereby significantly improving the quality and pertinence of the simulated dialogue training text. On this basis, the constructed training data set not only contains a wealth of simulated dialogue training texts, but also creatively incorporates the first role label. This design makes the data set more dimensional and provides comprehensive and accurate materials for the training of the role confirmation model. Finally, based on such a high-quality training data set, the preset role confirmation model is trained to ensure that the model fully learns the intrinsic connection between the dialogue text and the role label. This process not only enhances the recognition accuracy of the model, but also improves its ability to accurately judge the role identity in complex dialogue scenarios. Therefore, the trained target role confirmation model can more quickly and accurately confirm the role identities of the parties in the dialogue in practical applications, providing strong support for subsequent dialogue analysis, emotion recognition and other tasks.

[0142] In one embodiment, the voice-based role separation device 400 further includes:

[0143] A data set acquisition module is used to acquire a preset test data set, where the test data set includes a plurality of sample data and a second role label corresponding to the plurality of sample data;

[0144] A verification module, used to verify the target role confirmation model based on multiple sample data and the second role label to obtain a verification result;

[0145] The evaluation module is used to evaluate the performance of the target role confirmation model based on the verification results and the preset model performance indicators.

[0146] The embodiment of the present application can provide a comprehensive and objective verification environment for the target role confirmation model by obtaining a preset test data set containing rich and diverse sample data and corresponding second role labels. This step ensures that the target role confirmation model can be rigorously tested in different situations, thereby verifying its generalization ability in practical applications. During the verification process, the target role confirmation model can be predicted based on the sample data and the second role label, and compared with the actual label. This process not only verifies the prediction accuracy of the model, but also reveals its stability and reliability in the role recognition task. The output of the verification result provides detailed data support for the subsequent model performance evaluation. Finally, based on the verification results and preset model performance indicators (such as accuracy, recall rate, F1 score, etc.), the target role confirmation model is comprehensively and deeply evaluated. This evaluation not only quantifies the performance of the target role confirmation model in the role confirmation task, but also reveals the advantages and disadvantages of the target role confirmation model by comparing different indicators, and provides a clear guiding direction for the optimization and improvement of the subsequent target role confirmation model.

[0147] In one embodiment, the role separation module 405 includes:

[0148] The preprocessing submodule is used to preprocess the customer service recording data to obtain the preprocessed recording data;

[0149] A segmentation module, used to segment the recording data using a preset voice activity detection algorithm to obtain multiple voice segments;

[0150] The extraction submodule is used to extract the acoustic features of each speech segment and obtain the voiceprint feature vector of each speech segment;

[0151] The classification submodule is used to input the voiceprint feature vector into the target role confirmation model for role classification, and obtain the role classification result of each voice segment;

[0152] The merging submodule is used to merge the voice segments of the same role according to the role classification results to obtain the target voices corresponding to different roles.

[0153] The embodiment of the present application can effectively reduce environmental noise and interference, and improve the clarity and availability of the recorded data by accurately acquiring single-channel customer service recording data and preprocessing the data. Subsequently, an advanced preset voice activity detection algorithm is used to finely segment the preprocessed recording data, and multiple voice segments containing complete voice activities are successfully obtained, providing high-quality material for subsequent processing. In the feature extraction stage, the acoustic features of each voice segment are accurately captured and converted into voiceprint feature vectors. These vectors highly summarize the uniqueness of the voice segment and provide a strong basis for role classification. After the voiceprint feature vector is input into the target role confirmation model, the model uses its powerful learning and recognition capabilities to accurately classify the role of each voice segment and output reliable role classification results. Finally, according to the role classification results, the voice segments of the same role are intelligently merged to form target voices corresponding to different roles.

[0154] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0155] The computer device 6 includes a memory 61, a processor 62, and a network interface 63 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 6 having a memory 61, a processor 62, and a network interface 63, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASIC), programmable gate arrays (FPGA), digital signal processors (DSP), embedded devices, etc.

[0156] Computer devices can be computing devices such as desktop computers, notebooks, PDAs, and cloud servers. Computer devices can interact with users through keyboards, mice, remote controls, touch pads, or voice control devices.

[0157] The memory 61 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 61 can be an internal storage unit of the computer device 6, such as a hard disk or memory of the computer device 6. In other embodiments, the memory 61 can also be an external storage device of the computer device 6, such as a plug-in hard disk equipped on the computer device 6, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 61 can also include both the internal storage unit of the computer device 6 and its external storage device. In this embodiment, the memory 61 is generally used to store the operating system and various application software installed on the computer device 6, such as computer-readable instructions of the voice-based role separation method, etc. In addition, the memory 61 can also be used to temporarily store various types of data that have been output or are to be output.

[0158] The processor 62 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 62 is generally used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is used to run computer-readable instructions stored in the memory 61 or process data, such as computer-readable instructions for running a voice-based role separation method.

[0159] The network interface 63 may include a wireless network interface or a wired network interface, and the network interface 63 is generally used to establish a communication connection between the computer device 6 and other electronic devices.

[0160] The embodiment of the present application can lay a solid contextual foundation for subsequent dialogue generation by accurately obtaining the scene information, style information and attitude information of the simulated dialogue. Based on this rich information, the generated dialogue prompts can guide the pre-trained language model in detail, so that the simulated dialogue data produced by it is not only sufficient in quantity but also excellent in quality, effectively avoiding the problem of lack of training data and uneven quality in traditional methods. Thanks to the powerful generation power of the large pre-trained language model and the refined control of this solution, the generated simulated dialogue data fully demonstrates the complexity and diversity of real dialogues. From scene simulation to style and attitude grasp, each step strives to be highly simulated, so that the training data is both real and diverse. Furthermore, this highly simulated training data is used to train the target role confirmation model, which greatly improves the performance and generalization ability of the model. In the face of complex dialogue scenes, especially the speaker separation and role confirmation tasks in single-channel recordings, the model can accurately capture the subtle emotional fluctuations and context changes in the dialogue, and realize the effective distinction and confirmation of the speaker's role.

[0161] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which stores computer-readable instructions. The computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the voice-based role separation method as described above.

[0162] The embodiment of the present application can lay a solid contextual foundation for subsequent dialogue generation by accurately obtaining the scene information, style information and attitude information of the simulated dialogue. Based on this rich information, the generated dialogue prompts can guide the pre-trained language model in detail, so that the simulated dialogue data produced by it is not only sufficient in quantity but also excellent in quality, effectively avoiding the problem of lack of training data and uneven quality in traditional methods. Thanks to the powerful generation power of the large pre-trained language model and the refined control of this solution, the generated simulated dialogue data fully demonstrates the complexity and diversity of real dialogues. From scene simulation to style and attitude grasp, each step strives to be highly simulated, so that the training data is both real and diverse. Furthermore, this highly simulated training data is used to train the target role confirmation model, which greatly improves the performance and generalization ability of the model. In the face of complex dialogue scenes, especially the speaker separation and role confirmation tasks in single-channel recordings, the model can accurately capture the subtle emotional fluctuations and context changes in the dialogue, and realize the effective distinction and confirmation of the speaker's role.

[0163] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0164] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A voice-based role separation method, characterized in that: The steps include: Obtaining scene information, style information, and attitude information of simulated dialogue; generating a dialogue prompt for the simulated dialogue based on the scene information, the style information, and the attitude information; Based on the dialogue prompt, using a pre-trained language model, generating a dialogue text of the simulated dialogue; According to the dialogue text, a preset role confirmation model is trained to obtain a target role confirmation model; Single-channel customer service recording data is obtained, and the target role confirmation model is used to perform role separation on the customer service recording data to obtain target voices corresponding to different roles in the customer service recording data.

2. The method according to claim 1, characterized in that The step of generating a dialogue prompt for the simulated dialogue based on the scene information, the style information, and the attitude information specifically includes: Respectively analyzing the scene information, the style information, and the attitude information to obtain a scene feature vector corresponding to the scene information, a style feature vector corresponding to the style information, and an attitude feature vector corresponding to the attitude information; According to the scene feature vector, a dialogue scene is matched from a pre-built dialogue scene library to obtain scene auxiliary information of the dialogue scene; According to the style feature vector, matching a dialogue style from a pre-built dialogue style library to obtain style expression information of the dialogue style; According to the attitude feature vector, matching the dialogue attitude from a pre-built dialogue attitude library, and obtaining the attitude expression element of the dialogue attitude; The scene auxiliary information, the style expression information and the attitude expression elements are integrated to generate a dialogue prompt for the simulated dialogue that conforms to the dialogue scene, the dialogue style and the dialogue attitude.

3. The method according to claim 2, characterized in that The step of generating the dialogue text of the simulated dialogue based on the dialogue prompt using a pre-trained language model specifically includes: Inputting the dialogue prompt into a pre-trained language model to generate a candidate simulated dialogue text set, wherein the candidate simulated dialogue text set includes a plurality of simulated dialogue texts; Deduplication processing is performed on the multiple simulated dialogue texts to obtain the dialogue text of the simulated dialogue.

4. The method according to claim 3, characterized in that The step of performing deduplication processing on the multiple simulated dialogue texts to obtain the dialogue text of the simulated dialogue specifically includes: Using a preset text vectorization algorithm, each simulated dialogue text is represented by a vector to obtain a dialogue text vector corresponding to each simulated dialogue text; Calculating the similarities between all the dialogue text vectors to obtain a similarity matrix; Obtaining a preset similarity threshold, and determining whether the value of each element in the similarity matrix is ​​higher than the similarity threshold; If the value of each element in the similarity matrix is ​​higher than the similarity threshold, the corresponding two simulated dialogue texts are marked as duplicate texts; All the simulated dialogue texts marked as repeated texts are filtered to obtain the dialogue texts of the simulated dialogue.

5. The method according to claim 1, characterized in that The step of training a preset role confirmation model according to the dialogue text to obtain a target role confirmation model specifically includes: Performing word segmentation processing on the dialogue text to obtain text data after word segmentation; According to a preset stop word list, the text data is filtered for stop words to obtain a preprocessed simulated dialogue training text; According to the simulated dialogue training text, a training data set is constructed, wherein each sample in the training data set consists of the simulated dialogue training text and a first role label corresponding to the simulated dialogue training text; Based on the simulated dialogue training text and the first role label, a preset role confirmation model is trained to obtain a trained target role confirmation model.

6. The method according to claim 5, characterized in that After the step of training a preset role confirmation model based on the simulated dialogue training text and the first role label to obtain a trained target role confirmation model, the method further includes: Obtain a preset test data set, where the test data set includes a plurality of sample data and second role labels corresponding to the plurality of sample data; Based on the plurality of sample data and the second role label, verifying the target role confirmation model to obtain a verification result; Based on the verification result and the preset model performance index, the performance of the target role confirmation model is evaluated.

7. The method according to claim 1, characterized in that The step of using the target role confirmation model to separate the roles of the customer service recording data to obtain target voices corresponding to different roles in the customer service recording data specifically includes: Preprocessing the customer service recording data to obtain preprocessed recording data; Using a preset voice activity detection algorithm, segmenting the recorded data to obtain multiple voice segments; Extracting acoustic features of each speech segment to obtain a voiceprint feature vector of each speech segment; Inputting the voiceprint feature vector into the target role confirmation model for role classification to obtain a role classification result for each voice segment; According to the role classification result, the voice segments of the same role are merged to obtain target voices corresponding to different roles.

8. A voice-based role separation device, characterized in that: include: An acquisition module is used to obtain scene information, style information and attitude information of the simulated dialogue; A prompt generation module, configured to generate a dialogue prompt for the simulated dialogue based on the scene information, the style information, and the attitude information; A text generation module, configured to generate a dialogue text of the simulated dialogue based on the dialogue prompts and using a pre-trained language model; A training module, used to train a preset role confirmation model according to the dialogue text to obtain a target role confirmation model; The role separation module is used to obtain single-channel customer service recording data, use the target role confirmation model to perform role separation on the customer service recording data, and obtain target voices corresponding to different roles in the customer service recording data.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the voice-based role separation method according to any one of claims 1 to 7 when executing the computer-readable instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the voice-based role separation method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Speaker's role separation method and system in trial scene

    CN108074576A

  • Voice role segmentation method and device, computer equipment and storage medium

    CN113192516A

  • Role identification method, device and system in dialogue scene

    CN113744742A

  • Role separation method and device based on voice data, equipment and medium

    CN115376541A

  • Audio source separation and audio dubbing

    CN115668367A

Cited By

  • Large model-based mediation verbal skill generation method, apparatus and device, and medium

    CN120877733A

  • Mediation phrase generation method and device based on large model, equipment and medium

    CN120877733B

  • Intention recognition model training method, intention recognition method, and related device

    CN122692187A