A method, device, equipment and medium for separating roles based on voice

By obtaining the scene, style and attitude information of the simulated conversation, generating high-quality simulated conversation text and training the target role confirmation model, the difficult problems of speaker separation and role confirmation in complex conversation scenarios are solved, and accurate role confirmation is achieved in single-channel recordings.

CN119724196BActive Publication Date: 2025-09-30PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies have difficulty in achieving speaker separation and role confirmation in complex dialogue scenarios, especially in single-channel recordings, where it is difficult to accurately capture subtle emotional fluctuations and contextual changes. They also have a strong dependence on labeled data, resulting in insufficient generalization capabilities.

Method used

By obtaining the scene information, style information and attitude information of the simulated conversation, generating conversation prompts, using the pre-trained language model to generate simulated conversation text, and training the target role confirmation model, role separation of customer service recording data is achieved.

Benefits of technology

The generated simulated conversation data is of excellent quality and sufficient diversity. The trained model can accurately capture subtle emotional fluctuations and context changes in complex conversation scenarios, improving the performance and generalization ability of speaker separation and role confirmation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119724196B_ABST
    Figure CN119724196B_ABST
Patent Text Reader

Abstract

This application belongs to the field of artificial intelligence and relates to a voice-based role separation method, comprising: obtaining scene information, style information, and attitude information of a simulated conversation; generating conversation prompts for the simulated conversation based on the scene information, style information, and attitude information; generating the dialogue text of the simulated conversation using a pre-trained language model based on the dialogue prompts; training a preset role confirmation model based on the dialogue text to obtain a target role confirmation model; obtaining single-channel customer service recording data, and using the target role confirmation model to perform role separation on the customer service recording data to obtain target speech corresponding to different roles in the customer service recording data. This application also provides an apparatus, device, and medium. Furthermore, this application also relates to blockchain technology, and the scene information, style information, and attitude information can be stored in the blockchain. This application can effectively distinguish and confirm the speaker's role.
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 identification, many products and technologies still rely heavily on traditional acoustic and language models. These models rely heavily on labeled data during construction, often requiring massive amounts of labeled data for in-depth training. However, data collection and annotation are not only extremely time-consuming and labor-intensive, but also come with high costs, significantly limiting the further development and adoption of these technologies.

[0003] Furthermore, existing technologies often struggle to cope with complex conversation scenarios, especially speaker separation and role verification tasks in single-channel recordings. Traditional methods struggle to accurately capture subtle emotional fluctuations and contextual changes in conversations, resulting in insufficient generalization and significantly reduced practical application effectiveness. Particularly in scenarios with multiple speakers, existing technologies struggle to effectively distinguish and confirm the specific role of each speaker, especially in the absence of visual auxiliary information. In summary, there is an urgent need for a method that can achieve speaker separation and role verification in complex conversation 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 achieve speaker separation and role confirmation 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 conversation; generate dialogue prompts for the simulated conversation based on the scene information, style information, and attitude information; generate dialogue text for the simulated conversation based on the dialogue prompts using a pre-trained language model; train a preset role confirmation model based on the dialogue text 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 dialogue prompts for the simulated dialogue based on the scene information, style information, and 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 pre-trained language model is used to generate the dialogue text of the simulated dialogue, which specifically includes:

[0010] The dialogue prompts are 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 conversation texts to obtain the conversation text of the simulated conversation specifically includes:

[0012] A preset text vectorization algorithm is used to vectorize each simulated conversation text to obtain a conversation text vector corresponding to each simulated conversation text; the similarity between all conversation 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 conversation texts are marked as duplicate texts; all simulated conversation texts marked as duplicate texts are filtered to obtain the conversation text of the simulated conversation.

[0013] Furthermore, the steps of training a preset role confirmation model based on the dialogue text to obtain a target role confirmation model specifically include:

[0014] The dialogue text is segmented to obtain segmented text data; the text data is filtered for stop words according to a preset stop word list to obtain preprocessed simulated dialogue training text; a training data set is constructed based on the simulated dialogue training text, and each sample in the training data set consists of the simulated dialogue training text and the 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] Obtain a preset test data set, which includes multiple sample data and second role labels corresponding to the multiple sample data; verify the target role confirmation model based on the multiple sample data and the second role labels to obtain a verification result; and evaluate the performance of the target role confirmation model based on the verification result and preset model performance indicators.

[0017] Furthermore, 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 the target voices corresponding to different roles.

[0019] In order to solve the above technical problems, the embodiment of the present application further 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 is used to generate dialogue prompts for simulated dialogue based on scene information, style information, and attitude information;

[0022] The text generation module is used to generate dialogue text based on dialogue prompts and a pre-trained language model to simulate the dialogue;

[0023] A training module is used to train a preset role confirmation model based on 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, use the target role confirmation model to 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 to existing technologies, the embodiments of this application offer the following key benefits: By accurately capturing the scene, style, and attitude information of simulated conversations, a solid contextual foundation is laid for subsequent conversation generation. Based on this rich information, the generated conversation prompts meticulously guide the pre-trained language model, resulting in simulated conversation data that is both sufficient in quantity and high in quality, effectively circumventing the challenges of insufficient and inconsistent training data in traditional methods. Thanks to the powerful generative power of large pre-trained language models and the refined control of this solution, the generated simulated conversation data fully captures the complexity and diversity of real conversations. From scene simulation to style and attitude capture, each step strives for high fidelity, resulting in training data that is both realistic and diverse. Furthermore, this highly simulated training data is used to train a target role confirmation model, significantly improving its performance and generalization capabilities. In complex conversation scenarios, particularly for speaker separation and role confirmation tasks in single-channel recordings, the model accurately captures subtle emotional fluctuations and contextual changes in the conversation, enabling effective speaker role distinction and confirmation. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0030] Figure 2 This is a flow chart of a voice-based role separation method provided by this application;

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

[0032] Figure 4This is a structural 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 meanings as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of the application are for the purpose of describing specific embodiments only and are not intended to limit this application. The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0034] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, 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, system architecture 100 may include a terminal device 101, a network 102, and a server 103. Terminal device 101 may be a laptop computer 1011, a tablet computer 1012, or a mobile phone 1013. Network 102 is a medium for providing a communication link between terminal device 101 and server 103. Network 102 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0037] The user can use the terminal device 101 to interact with the server 103 via 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 various electronic devices with a display screen and supporting web browsing. In addition to the laptop computer 1011, tablet computer 1012 or 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) player, a laptop computer and 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 set in the server.

[0041] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.

[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 includes the following steps:

[0043] Step S201: Acquire scene information, style information, and attitude information of a simulated dialogue.

[0044] In this embodiment, the electronic device (eg Figure 1 The server shown in FIG. 1 may obtain scene information, style information, and attitude information through a wired connection or a wireless connection. It should be noted that the wireless connection 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 currently known or future developed wireless connection methods.

[0045] Simulated dialogue refers to conversations generated by computer algorithms that simulate real-world scenarios. Based on pre-set context, style, and attitude, and guided by conversational prompts, it simulates real-world conversations to train and optimize speech recognition and speaker identification technologies. For example, a simulated dialogue might involve two characters ordering food in a restaurant.

[0046] Context information refers to the specific environment or context in which a conversation occurs, such as a restaurant, office, or home. It characterizes the location and context of the conversation and is used to generate conversation prompts that fit the context. For example, if the context information is "restaurant," the generated conversation might involve ordering food, paying the bill, and so on.

[0047] Style information refers to the language style of the conversation, such as formal, casual, or humorous. It characterizes the interlocutor's language characteristics and is used to generate conversational prompts that match the style. For example, if the style information is "casual," the generated conversation may use more colloquial and friendly language.

[0048] Attitude information refers to the emotional attitude expressed by the interlocutor, such as positive, negative, or neutral. It represents the interlocutor's emotional state and is used to generate conversational prompts that match their attitude. For example, if the attitude information is "positive," the generated conversation 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] Dialogue prompts are instructions or prompts that guide the flow of a conversation. They are generated based on scene, style, and attitude information, and contain key information such as the conversation's context, characters, and topic. For example, a dialogue prompt might be "a conversation between a welcoming waiter and a satisfied customer ordering food at a restaurant."

[0051] Step S203: Based on the dialogue prompts, a pre-trained language model is used to generate a dialogue text of a 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 simulated conversation content generated by a pre-trained language model and is used to train the role confirmation model. For example, the dialogue text might be: "Waiter: Hello, welcome! What could you order? Customer: I'd 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 pre-set role identification model is a pre-trained model used to identify the speaker's role in a conversation. It needs to be trained using conversation text to improve recognition performance. For example, the role identification model can be a classification model based on deep learning.

[0056] The target role confirmation model is a model that, after being trained on conversational text, can accurately identify the speaker's role in a conversation. It can be used for role classification tasks in real-world applications. For example, the target role confirmation model can identify "waiter" and "customer" in a conversation.

[0057] Step S205 , obtaining single-channel customer service recording data, using a 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] Single-channel recordings are defined as recordings with only one channel, meaning the sound signal in the recording comes from a single source. For example, single-channel customer service recordings involve conversations between customer service representatives and customers recorded on the same channel.

[0059] Customer service recording data refers to audio data recorded during conversations between customer service representatives and customers. It is used to extract acoustic features and perform role classification. For example, customer service recording data may contain multiple conversation segments between customer service representatives and customers.

[0060] The target speech refers to the collection of speech segments belonging to the same role, obtained by merging the segmented segments based on the role classification results. This is used for subsequent analysis or processing. For example, the target speech could be the result of merging all the speech segments belonging to the "Customer Service" role.

[0061] The embodiments of the present application can accurately obtain scene information, style information, and attitude information of simulated conversations, laying a solid contextual foundation for subsequent conversation generation. Based on this rich information, the generated conversation prompts can meticulously guide the pre-trained language model, so that the simulated conversation data it produces is not only sufficient in quantity but also of excellent quality, effectively circumventing the problems of insufficient training data and uneven quality in traditional methods. Thanks to the powerful generation power of large-scale pre-trained language models and the refined control of this solution, the generated simulated conversation data fully demonstrates the complexity and diversity of real conversations. From scene simulation to style and attitude grasping, each step strives for high simulation, making the training data both realistic and diverse. Furthermore, this highly simulated training data is used to train the target role confirmation model, greatly improving the model's performance and generalization ability. Faced with complex conversation scenarios, especially speaker separation and role confirmation tasks in single-channel recordings, the model can accurately capture subtle emotional fluctuations and contextual changes in the conversation, achieving effective distinction and confirmation of speaker roles.

[0062] In some optional implementations of this embodiment, step 202, generating a dialogue prompt for a simulated dialogue based on the scene information, style information, and 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 converts scene information into a computer-readable numerical vector, which is used to match the corresponding conversation scene from the conversation scene library. For example, the feature vector of a restaurant scene might include vector representations of keywords such as "food" and "service."

[0065] The style feature vector converts style information into a computer-readable numerical vector, which is used to match the corresponding conversational style from the conversational style library. For example, the feature vector for a casual style might include vector representations of keywords such as "colloquial" and "friendly."

[0066] The attitude feature vector converts attitude information into a computer-readable numerical vector, which is used to match the corresponding conversation attitude from the conversation attitude library. For example, the feature vector of a positive attitude might include vector representations of keywords such as "encouragement" and "praise."

[0067] The conversation scenario library is a database that stores conversation scenario information in different scenarios and is used to match the corresponding conversation scenario based on the scenario feature vector. For example, the conversation scenario library may include multiple scenarios such as a restaurant, an office, and a home.

[0068] A conversation scenario refers to the specific environment and context in which a conversation occurs. It is matched from a conversation scenario library and used to generate conversation prompts that match the scenario. For example, a conversation scenario might be "ordering food in a restaurant."

[0069] Scene-related information refers to auxiliary information related to the conversation scene, such as the scene's background description and character settings, which is used to enrich conversation prompts. For example, the scene-related information for a restaurant ordering scene might include "the restaurant environment is elegant and the waiters are warm and attentive."

[0070] The conversation style library is a database that stores conversation style information for different language styles and is used to match the corresponding conversation style based on the style feature vector. For example, the conversation style library may include various styles such as formal, casual, and humorous.

[0071] The conversation style refers to the language style of the conversation. It 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] Stylistic information refers to information related to the conversational style, such as language characteristics and word usage habits, and is used to enrich conversational prompts. For example, stylistic information for a casual chat style might include "using colloquial vocabulary and a friendly tone."

[0073] In one example, input scenario information (e.g., "loan consultation"), style information (e.g., "formal"), and attitude information (e.g., "positive") are parsed and processed. Using a deep learning model, the scenario feature vector, style feature vector, and attitude feature vector are extracted, respectively. Next, based on the scenario feature vector, the "loan consultation" scenario is matched from a pre-built library of financial dialogue scenarios, and auxiliary scenario information for this scenario, such as a list of frequently asked questions and a library of professional terminology, is obtained. Based on the style feature vector, the "formal" style is matched from the dialogue style library, and corresponding style expression information, such as polite language and formal titles, is obtained. Based on the attitude feature vector, the "positive" attitude is matched from the dialogue attitude library, and attitude expression elements, such as encouraging response templates and positive emotion vocabulary, are obtained. Finally, the above three types of information are integrated to generate simulated dialogue prompts that match the "loan consultation" scenario, the "formal" style, and the "positive" attitude.

[0074] The embodiments of the present application can deeply capture the multi-dimensional information in the conversation, including environmental background, communication methods and emotional tendencies, by analyzing the scene, style and attitude information and generating corresponding feature vectors respectively, providing a rich data foundation for subsequent matching and fusion. By 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 labeled data, but also significantly improves the generalization ability of the technology, enabling it to flexibly respond to various complex dialogue scenarios. Ultimately, 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 can also 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 prompts, uses a pre-trained language model to generate a dialogue text of a simulated dialogue, which specifically includes the following steps:

[0076] The dialogue prompts are 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 conversation text set may include multiple possible conversation contents for subsequent deduplication and screening. For example, the candidate simulated conversation text set may include multiple versions of a restaurant ordering conversation.

[0078] In one example, a conversation prompt is generated based on the conversation scenario, style, and attitude in the financial sector. For example, the conversation scenario is "Credit Card Repayment Consultation," the style is "Formal and Friendly," and the attitude is "Patient Answers." Based on this information, a conversation prompt is generated: "Please explain the credit card repayment methods and precautions to the user, and ensure your answers are formal, friendly, and patient." The conversation prompt is then input into a pre-trained language model to generate a set of candidate simulated conversation texts. Leveraging its powerful natural language processing capabilities, the model is able to generate multiple simulated conversation texts that meet the requirements. These texts cover key information such as various credit card repayment methods, payment date settings, and the consequences of overdue payments. They are formal, friendly, and patient in answering user questions. However, the generated candidate simulated conversation texts may contain duplicate or similar text. To enhance conversation diversity and user experience, duplicate removal can be performed on the multiple simulated conversation texts. By comparing the similarity between texts, duplicate or highly similar text is removed, ultimately generating a single, deduplicated simulated conversation text.

[0079] This embodiment of the present application utilizes conversational prompts that incorporate context, style, and attitude information into a pre-trained language model. This step leverages the pre-trained model's deep understanding of language structure and contextual information, resulting in a collection of candidate simulated conversational texts that are not only rich in content but also closely align with the requirements of the conversational prompts. Deduplication effectively avoids redundancy and repetition in the generated simulated conversational texts, ensuring the uniqueness and practicality of each text. This step not only increases the diversity of conversational 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 conversation text to obtain a conversation text vector corresponding to each simulated conversation text; the similarity between all conversation 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 conversation texts are marked as duplicate texts; all simulated conversation texts marked as duplicate texts are filtered to obtain the conversation text of the simulated conversation.

[0082] Text vectorization algorithms are algorithms that convert text into computer-readable numerical vectors, such as TF-IDF (Term Frequency-Inverse Document Frequency) and Word2Vec.

[0083] A conversation text vector is a numerical vector representation of a conversation text generated by a text vectorization algorithm. It is used to calculate the similarity between conversation texts. For example, a conversation text vector may contain numerical values ​​in multiple dimensions, 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 often contain duplicate or highly similar content, necessitating deduplication. The TF-IDF algorithm can be used as the default text vectorization algorithm to generate a vector representation for each simulated conversation text. The cosine similarity between all conversation text vectors is then calculated, resulting in a similarity matrix. Cosine similarity measures the directional difference between two vectors, with values ​​ranging from -1 to 1, where larger values ​​indicate greater similarity. To determine the threshold for duplicate text, a preset similarity threshold (for example, 0.85) can be used. Next, each element in the similarity matrix is ​​traversed to determine whether its value exceeds the similarity threshold. If the value of an element exceeds the threshold, the two corresponding simulated conversation texts are marked as duplicates. Finally, all simulated conversation texts marked as duplicates are filtered, retaining only unique text, thus obtaining a deduplicated simulated conversation text set.

[0087] The embodiments of the present application utilize a preset text vectorization algorithm to convert each simulated conversation text into a corresponding conversation text vector. This process fully leverages the efficiency and accuracy of text vectorization algorithms when processing large-scale text data. Next, the similarities between all conversation text vectors are calculated to generate a similarity matrix. This step not only considers the overall similarity between texts but also intuitively displays the similarity relationships between texts in the form of a similarity matrix, providing strong support for subsequent deduplication processing. After obtaining a preset similarity threshold, each element in the similarity matrix is ​​traversed to determine whether its value exceeds the threshold. If so, the corresponding two simulated conversation texts are marked as duplicates. By setting a reasonable threshold, this step accurately identifies and filters out highly similar texts, avoiding interference from redundant information. Finally, all simulated conversation texts marked as duplicates are filtered to obtain a collection of deduplicated simulated conversation texts. This process not only improves the quality and diversity of the text collection 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 based on 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; according to the simulated dialogue training text, construct a training data set, and each sample in the training data set consists of the simulated dialogue training text and the first role label corresponding to the simulated dialogue training text; 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 an 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" (的) and "le" (了). By filtering stop words, the noise in the data can be reduced, and the efficiency and accuracy of model training can be improved. Next, construct a 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" and "customer". 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, in 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 embodiments of the present application effectively improve the granularity of text data by accurately segmenting the conversation text, laying a solid foundation for subsequent processing. Subsequently, the segmented text data is filtered using a preset stop word list, effectively removing redundant information from the conversation, such as common words that are not substantively helpful for conversation analysis. This significantly improves the quality and relevance of the simulated conversation training text. On this basis, the constructed training dataset not only contains a wealth of simulated conversation training text but also creatively incorporates the first role label. This design enriches the dataset dimensionally and provides comprehensive and accurate material for training the role confirmation model. Finally, based on this high-quality training dataset, the preset role confirmation model is trained to ensure that the model fully learns the inherent connection between the conversation text and the role labels. This process not only enhances the model's recognition accuracy but also improves its ability to accurately determine role identities in complex conversation scenarios. Therefore, in practical applications, the trained target role confirmation model can more quickly and accurately determine the role identities of each party in a conversation, providing strong support for subsequent tasks such as conversation analysis and emotion recognition.

[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 further included:

[0095] Obtain a preset test data set, which includes multiple sample data and second role labels corresponding to the multiple sample data; verify the target role confirmation model based on the multiple sample data and the second role labels to obtain a verification result; and evaluate the performance of the target role confirmation model based on the verification result and preset model performance indicators.

[0096] The test dataset is a dataset used to verify the performance of the role confirmation model. It contains multiple sample data and corresponding second role labels. For example, the test dataset may contain dialogue texts from multiple different scenarios and corresponding role labels.

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

[0098] Validation results refer to the results obtained after validating the role validation model using the test dataset. They are used to evaluate the model's performance. For example, validation results may include metrics such as the model's accuracy and recall.

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

[0100] In one example, during the development of a financial conversational system, a test dataset containing multiple financial conversation samples can be prepared. These sample data covers a variety of conversation scenarios between bank customer service representatives and customers, such as account inquiries, transfers, and financial consulting. Each sample data point is assigned a secondary role label, clearly identifying the speaker's role in the conversation, such as "customer service" or "customer." Using this test dataset, a trained target role confirmation model is validated based on the multiple sample data points and their corresponding secondary role labels. The target role confirmation model's task is to predict the role label for each sample data point and compare it with the actual secondary role label. Based on the validation results, the target role confirmation model's pre-defined model performance metrics, including precision, recall, and F1 score, are calculated. Precision reflects the proportion of role labels correctly predicted by the target role confirmation model. Recall measures the target role confirmation model's ability to identify all correct role labels. The F1 score, the harmonic average of precision and recall, 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 scenarios, thereby verifying its generalization ability in practical applications. During the verification process, the target role confirmation model can make predictions based on the sample data and the second role label and compare them 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 results 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 in-depth 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, providing a clear guiding direction for the subsequent optimization and improvement of the target role confirmation model.

[0102] In some optional implementations of this embodiment, step S205, using a target role confirmation model to separate the customer service recording data into roles, and obtaining 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 the target voices corresponding to different roles.

[0104] A voice activity detection algorithm is an algorithm used to detect voice activity (i.e., speech) in audio recordings. It can segment audio recordings into multiple speech segments. For example, a voice activity detection algorithm can identify silent and spoken segments in an audio recording.

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

[0106] A voiceprint feature vector is the process of converting acoustic features into a computer-readable numerical vector, which is used to represent the uniqueness of a speech signal. For example, a voiceprint feature vector may contain numerical values ​​in multiple dimensions, representing different characteristics of the speech signal.

[0107] The role classification result refers to the result obtained by classifying the voiceprint feature vector using the target role confirmation model. It represents 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. Acoustic features are then 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 usability of the recorded data by accurately acquiring single-channel customer service recording data and pre-processing the data. Subsequently, an advanced preset voice activity detection algorithm is used to finely segment the pre-processed recording data, successfully obtaining multiple voice segments containing complete voice activities, and 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 the 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 for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the 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, and target role confirmation models. Artificial Intelligence (AI) models are the crystallization of theory and practice that simulate the decision-making process of human intelligence through algorithms and data analysis to solve complex problems, predict future trends, or achieve automated tasks. These models utilize large amounts of historical data and real-time information, and are trained and optimized through a specific algorithmic framework to achieve efficient, accurate, and reliable performance.

[0113] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware via computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes in the above-described method embodiments. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic 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 flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed 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 some of the steps in the flowcharts 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 portion 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. 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] Acquisition module 401, for acquiring scene information, style information, and attitude information of the simulated dialogue;

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

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

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

[0121] The role separation module 405 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.

[0122] The embodiments of the present application can accurately obtain scene information, style information, and attitude information of simulated conversations, laying a solid contextual foundation for subsequent conversation generation. Based on this rich information, the generated conversation prompts can meticulously guide the pre-trained language model, so that the simulated conversation data it produces is not only sufficient in quantity but also of excellent quality, effectively circumventing the problems of insufficient training data and uneven quality in traditional methods. Thanks to the powerful generation power of large-scale pre-trained language models and the refined control of this solution, the generated simulated conversation data fully demonstrates the complexity and diversity of real conversations. From scene simulation to style and attitude grasping, each step strives for high simulation, making the training data both realistic and diverse. Furthermore, this highly simulated training data is used to train the target role confirmation model, greatly improving the model's performance and generalization ability. Faced with complex conversation scenarios, especially speaker separation and role confirmation tasks in single-channel recordings, the model can accurately capture subtle emotional fluctuations and contextual changes in the conversation, achieving effective distinction and confirmation of speaker roles.

[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] The first acquisition submodule is used to match the dialogue scene from the pre-built dialogue scene library according to the scene feature vector and obtain scene auxiliary information of the dialogue scene;

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

[0127] The third acquisition submodule is used to match the conversation attitude from the pre-built conversation attitude library based on the attitude feature vector and obtain the attitude expression elements of the conversation 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 conforms 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 and emotional tendencies, by analyzing the scene, style and attitude information and generating corresponding feature vectors respectively, providing a rich data foundation for subsequent matching and fusion. By 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 labeled data, but also significantly improves the generalization ability of the technology, enabling it to flexibly respond to various complex dialogue scenarios. Ultimately, 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 can also 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, configured to input the conversation prompts into a pre-trained language model to generate a candidate simulated conversation text set, wherein the candidate simulated conversation text set includes multiple simulated conversation texts;

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

[0133] This embodiment of the present application utilizes conversational prompts that incorporate context, style, and attitude information into a pre-trained language model. This step leverages the pre-trained model's deep understanding of language structure and contextual information, resulting in a collection of candidate simulated conversational texts that are not only rich in content but also closely align with the requirements of the conversational prompts. Deduplication effectively avoids redundancy and repetition in the generated simulated conversational texts, ensuring the uniqueness and practicality of each text. This step not only increases the diversity of conversational texts but also provides a richer selection space for subsequent applications.

[0134] In one embodiment, the deduplication submodule is further configured to use a preset text vectorization algorithm to perform vector representation on 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 and 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; and filter all simulated conversation texts marked as duplicate texts to obtain the conversation text of the simulated conversation.

[0135] The embodiments of the present application utilize a preset text vectorization algorithm to convert each simulated conversation text into a corresponding conversation text vector. This process fully leverages the efficiency and accuracy of text vectorization algorithms when processing large-scale text data. Next, the similarities between all conversation text vectors are calculated to generate a similarity matrix. This step not only considers the overall similarity between texts but also intuitively displays the similarity relationships between texts in the form of a similarity matrix, providing strong support for subsequent deduplication processing. After obtaining a preset similarity threshold, each element in the similarity matrix is ​​traversed to determine whether its value exceeds the threshold. If so, the corresponding two simulated conversation texts are marked as duplicates. By setting a reasonable threshold, this step accurately identifies and filters out highly similar texts, avoiding interference from redundant information. Finally, all simulated conversation texts marked as duplicates are filtered to obtain a collection of deduplicated simulated conversation texts. This process not only improves the quality and diversity of the text collection 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 conversation text to obtain the text data after word segmentation;

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

[0139] A construction submodule is used to construct a training data set based on the simulated dialogue training text, where 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 embodiments of the present application effectively improve the granularity of text data by accurately segmenting the conversation text, laying a solid foundation for subsequent processing. Subsequently, the segmented text data is filtered using a preset stop word list, effectively removing redundant information from the conversation, such as common words that are not substantively helpful for conversation analysis. This significantly improves the quality and relevance of the simulated conversation training text. On this basis, the constructed training dataset not only contains a wealth of simulated conversation training text but also creatively incorporates the first role label. This design enriches the dataset dimensionally and provides comprehensive and accurate material for training the role confirmation model. Finally, based on this high-quality training dataset, the preset role confirmation model is trained to ensure that the model fully learns the inherent connection between the conversation text and the role labels. This process not only enhances the model's recognition accuracy but also improves its ability to accurately determine role identities in complex conversation scenarios. Therefore, in practical applications, the trained target role confirmation model can more quickly and accurately determine the role identities of each party in a conversation, providing strong support for subsequent tasks such as conversation analysis and emotion recognition.

[0142] In one embodiment, the voice-based role separation apparatus 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 second role labels corresponding to the plurality of sample data;

[0144] A verification module, configured 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 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 scenarios, thereby verifying its generalization ability in practical applications. During the verification process, the target role confirmation model can make predictions based on the sample data and the second role label and compare them 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 results 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 in-depth 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, providing a clear guiding direction for the subsequent optimization and improvement of the 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 is used to segment the recorded 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 for 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 usability of the recorded data by accurately acquiring single-channel customer service recording data and pre-processing the data. Subsequently, an advanced preset voice activity detection algorithm is used to finely segment the pre-processed recording data, successfully obtaining multiple voice segments containing complete voice activities, and 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 the 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 through a system bus. It should be noted that the figure only shows a computer device 6 with 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 a microprocessor, an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.

[0156] Computer devices can be desktop computers, laptops, PDAs, cloud servers, etc. Computer devices can interact with users through keyboards, mice, remote controls, touchpads, or voice-activated devices.

[0157] Memory 61 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), 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 storage, magnetic disk, optical disk, etc. In some embodiments, memory 61 may be an internal storage unit of computer device 6, such as the hard disk or memory of computer device 6. In other embodiments, memory 61 may also be an external storage device of computer device 6, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash memory card, etc. Of course, memory 61 may also include both internal storage units and external storage devices of computer device 6. In this embodiment, memory 61 is generally used to store the operating system and various application software installed on computer device 6, such as computer-readable instructions for the voice-based character separation method. In addition, memory 61 may also be used to temporarily store various types of data that have been output or are about to be output.

[0158] In some embodiments, the processor 62 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. 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 execute computer-readable instructions stored in the memory 61 or process data, such as computer-readable instructions for executing a speech-based character separation method.

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

[0160] The embodiments of the present application can accurately obtain scene information, style information, and attitude information of simulated conversations, laying a solid contextual foundation for subsequent conversation generation. Based on this rich information, the generated conversation prompts can meticulously guide the pre-trained language model, so that the simulated conversation data it produces is not only sufficient in quantity but also of excellent quality, effectively circumventing the problems of insufficient training data and uneven quality in traditional methods. Thanks to the powerful generation power of large-scale pre-trained language models and the refined control of this solution, the generated simulated conversation data fully demonstrates the complexity and diversity of real conversations. From scene simulation to style and attitude grasping, each step strives for high simulation, making the training data both realistic and diverse. Furthermore, this highly simulated training data is used to train the target role confirmation model, greatly improving the model's performance and generalization ability. Faced with complex conversation scenarios, especially speaker separation and role confirmation tasks in single-channel recordings, the model can accurately capture subtle emotional fluctuations and contextual changes in the conversation, achieving effective distinction and confirmation of speaker roles.

[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 embodiments of the present application can accurately obtain scene information, style information, and attitude information of simulated conversations, laying a solid contextual foundation for subsequent conversation generation. Based on this rich information, the generated conversation prompts can meticulously guide the pre-trained language model, so that the simulated conversation data it produces is not only sufficient in quantity but also of excellent quality, effectively circumventing the problems of insufficient training data and uneven quality in traditional methods. Thanks to the powerful generation power of large-scale pre-trained language models and the refined control of this solution, the generated simulated conversation data fully demonstrates the complexity and diversity of real conversations. From scene simulation to style and attitude grasping, each step strives for high simulation, making the training data both realistic and diverse. Furthermore, this highly simulated training data is used to train the target role confirmation model, greatly improving the model's performance and generalization ability. Faced with complex conversation scenarios, especially speaker separation and role confirmation tasks in single-channel recordings, the model can accurately capture subtle emotional fluctuations and contextual changes in the conversation, achieving effective distinction and confirmation of speaker roles.

[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 the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this 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, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of each embodiment of the present application.

[0164] Obviously, the embodiments described above are only some of the embodiments of the present application, rather than all of the 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 has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions described in the aforementioned specific embodiments, or to make equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the present application specification and the accompanying drawings, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present 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 prompts, 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 separate the roles of 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: Analyzing the scene information, the style information, and the 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; Matching a dialogue scene from a pre-built dialogue scene library according to the scene feature vector, and obtaining scene auxiliary information of the dialogue scene; Matching a conversation style from a pre-built conversation style library according to the style feature vector to obtain style expression information of the conversation style; Matching a conversation attitude from a pre-built conversation attitude library according to the attitude feature vector to obtain attitude expression elements of the conversation 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 conversation prompt into a pre-trained language model to generate a candidate simulated conversation text set, wherein the candidate simulated conversation text set includes a plurality of simulated conversation 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 conversation text is represented by a vector to obtain a conversation text vector corresponding to each simulated conversation text; Calculating the similarity between all the conversation 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, marking the corresponding two simulated conversation texts 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 based on the dialogue text to obtain a target role confirmation model specifically includes: Performing word segmentation processing on the conversation text to obtain text data after word segmentation; Filtering the text data for stop words according to a preset stop word list to obtain a preprocessed simulated dialogue training text; Constructing a training data set based on 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; 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; Verifying the target role confirmation model based on the plurality of sample data and the second role label to obtain a verification result; Based on the verification results and preset model performance indicators, the performance of the target role confirmation model is evaluated.

7. 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, configured to train a preset role confirmation model based on 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.

8. A computer device, characterized in that: The method comprises 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 voice-based role separation method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the voice-based role separation method according to any one of claims 1 to 6.