An audio text character recognition method, device, equipment and medium
By combining the role recognition methods of Albert-tiny and Electra-base models, along with loss weights and sliding window segmentation, the accuracy and efficiency issues of role recognition in audio text were resolved, achieving efficient and accurate role recognition.
Patent Information
- Application Number
- CN202211397178.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-09
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-11-09
AI Technical Summary
Existing voice recognition technologies for recorded texts have shortcomings in accuracy and efficiency. In particular, speech separation is poor in short calls and long texts, resulting in a high error rate in voice recognition and poor universality of rules and models.
The Albert-tiny model is used for binary classification of roles in long-duration calls, while the Electra-base model is used for role sequence labeling in short-duration calls or when the text is too long. The recognition accuracy is improved by combining loss weights and sliding window segmentation. At the same time, the generalization ability of the model is improved through adversarial training.
It improves the efficiency and accuracy of voice character recognition in recorded texts, increases the diversity of recognition, can identify the corresponding voice character and the point where speech stops, and reduces the error rate.
Smart Images

Figure CN115831128B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of natural language processing, and in particular to a recording text role recognition method, device, equipment and medium. BACKGROUND
[0002] In the prior art, sales and customer service personnel communicate with customers through call centers, and a platform generates a large number of recordings every day. These recordings often contain a lot of valuable information. Speech-to-text conversion and text mining analysis, speaker role recognition is an important part of mining analysis, which is used to determine the identity of the two parties in the conversation (agent or customer), and then process the downstream tasks. For single-channel recordings, convert speech to text and output information from different channels representing different people, but do not know which channel the specific agent or customer is. Currently, there are two common text role recognition techniques. One is to determine the role of a single sentence from the keyword and semantic angles. The other is to extract keywords by using the difference between the words spoken by the agent and the customer. The agent usually speaks with a certain regularity to determine the role. The sentence semantics uses a binary classification model for role classification. If the model predicts a certain role (agent or customer) with a probability greater than a certain threshold, the model's predicted role is determined as the final role of the single sentence. However, the effect depends on the speech role separation. Even if the model correctly assigns the role, the overall role accuracy is still not high. According to statistics, when the conversation time is longer, the speech separation effect is relatively good. When the conversation time is shorter, the speech separation is more mixed. And the text is too long to perform a sequence labeling task with high complexity. Speech role separation can lead to a large number of single sentence roles being misclassified, i.e., speaker A contains single sentences of speaker B, and speaker B contains single sentences belonging to speaker A. Currently, the optimization of speech role separation is complex, time-consuming, and the effect is not obvious. The role is determined based on the keyword rule. Some agent and customer text is not clearly distinguished, and no regularity can be found. Moreover, the rule is not effective for different company's speech, and is not universal. The role is determined based on the binary classification model, which depends on the speech separation effect. If the speech is not separated, it will affect the role effect.
[0003] As can be seen from the above, in the process of recording text role recognition, how to improve the efficiency of recording text role recognition, increase the accuracy of recording text role recognition, and improve the diversity of recording text role recognition is a problem to be solved in the field. SUMMARY
[0004] Therefore, the purpose of the present application is to provide a recording text role recognition method, device, equipment and medium, which can improve the efficiency of recording text role recognition, increase the accuracy of recording text role recognition, and improve the diversity of recording text role recognition. The specific scheme is as follows:
[0005] In a first aspect, this application discloses a method for identifying the roles of characters in recorded text, including:
[0006] The audio recording content to be identified is obtained, and the text information of each recording and the total recording duration are determined based on the audio recording content.
[0007] The relationship between the total recording duration and a preset threshold is determined. If the total recording duration is greater than the preset threshold, a preset first training model is used to perform role recognition on each of the recorded text information to obtain the role recognition result.
[0008] If the total recording duration is less than a preset threshold, then the preset second training model is used to perform role sequence annotation on each of the recorded text information to obtain annotated recorded text information. It is then determined whether the information length of the annotated recorded text information is less than a preset processing length. If the information length of the annotated recorded text information is less than the preset processing length, then the role recognition result is determined based on the annotated recorded text information.
[0009] Optionally, the step of acquiring the recording content to be identified and determining the text information of each recording and the total recording duration based on the recording content includes:
[0010] The recording content to be identified is obtained, and the recording content is processed using third-party speech recognition technology to obtain all the recording text information and the total recording duration.
[0011] All the recorded text information is classified according to the type of recording channel to obtain each recorded text information.
[0012] Optionally, the step of using a preset first training model to perform role recognition on each of the recorded text information to obtain role recognition results includes:
[0013] The preset Albert-tiny model is optimized using loss weighting to obtain a first training model. The first training model is then used to perform binary classification and role recognition on each of the recorded text information to obtain the prediction results for each role.
[0014] Determine whether the prediction results of each role are the same. If the prediction results of each role are different, then determine the role recognition result based on the prediction results.
[0015] Optionally, after determining whether the prediction results for each role are the same, the method further includes:
[0016] If the prediction results for each of the aforementioned roles are the same, then each predicted role and its corresponding prediction probability are determined based on the prediction results for each of the aforementioned roles.
[0017] The maximum predicted probability of a character is selected from all predicted character probabilities and taken as the character probability. The character recognition result is determined based on the character probability and the predicted character corresponding to the character probability.
[0018] Optionally, the step of using a preset second training model to perform role sequence annotation on the recorded text information to obtain the annotated recorded text content includes:
[0019] The annotated text information in the recorded text information is determined, and the preset electra-base model is optimized using loss weighting to obtain the second training model;
[0020] Based on the labeled text information and using the second training model to perform role sequence labeling on the audio text information, the labeled audio text content is obtained.
[0021] Optionally, the step of optimizing the preset electra-base model using loss weighting to obtain the second trained model includes:
[0022] A second training method is determined from the preset training methods;
[0023] The embedding layer of the electra-base model is trained using the second training method and loss weighting to obtain the second trained model;
[0024] Accordingly, the optimization of the preset Albert-tiny model using loss weighting to obtain the first training model includes:
[0025] The first training method is determined from the preset training methods;
[0026] The embedding layer of the Albert-tiny model is trained using the first training method and loss weighting to obtain the first trained model.
[0027] Optionally, after determining whether the length of the annotated audio text information is less than a preset processing length, the method further includes:
[0028] If the length of the annotated audio text information is not less than the preset processing length, the annotated audio text information is segmented using a sliding window segmentation method to obtain annotated sub-audio text information, and the role recognition result is determined based on all the annotated sub-audio text information.
[0029] Secondly, this application discloses a recording text role recognition device, comprising:
[0030] The recording content acquisition module is used to acquire the recording content to be identified, and determine the text information of each recording and the total recording duration based on the recording content;
[0031] The first role recognition result determination module is used to determine the relationship between the total recording time and the preset threshold. If the total recording time is greater than the preset threshold, the preset first training model is used to perform role recognition on each of the recorded text information to obtain the role recognition result.
[0032] The second role recognition result determination module is used to, if the total recording duration is less than a preset threshold, use a preset second training model to perform role sequence annotation on each of the recorded text information to obtain annotated recorded text information, determine whether the information length of the annotated recorded text information is less than a preset processing length, and if the information length of the annotated recorded text information is less than the preset processing length, determine the role recognition result based on the annotated recorded text information.
[0033] Thirdly, this application discloses an electronic device, including:
[0034] Memory, used to store computer programs;
[0035] A processor is used to execute the computer program to implement the aforementioned method for identifying the role of the recorded text.
[0036] Fourthly, this application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disclosed audio text role recognition method.
[0037] As can be seen, this application provides a method for role recognition in recorded text, including acquiring the recorded content to be recognized, and determining each recorded text information and the total recording duration based on the recorded content; determining the relationship between the total recording duration and a preset threshold; if the total recording duration is greater than the preset threshold, then using a preset first training model to perform role recognition on each of the recorded text information to obtain a role recognition result; if the total recording duration is less than the preset threshold, then using a preset second training model to perform role sequence annotation on each of the recorded text information to obtain annotated recorded text information; determining whether the information length of the annotated recorded text information is less than a preset processing length; if the information length of the annotated recorded text information is less than the preset processing length, then determining a role recognition result based on the annotated recorded text information. This application uses the output text of single-channel recorded data from third-party speech recognition technology. For call text with a call duration greater than a certain threshold, the Albert-Tiny model is used for role binary classification; otherwise, the Electra model is used for role sequence annotation. Sequence annotation does not depend on the effect of speech separation; it can not only identify the corresponding role but also identify the corresponding role's speech stop point. We employ loss weighting to improve the accuracy of character recognition, and sentence-based sliding window segmentation to handle excessively long texts. Furthermore, we utilize adversarial training to enhance the model's generalization ability, thereby improving the efficiency, accuracy, and diversity of character recognition in recorded text. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0039] Figure 1 This is a flowchart of a method for character recognition of audio recordings disclosed in this application;
[0040] Figure 2 This is a flowchart of a method for character recognition of audio recordings disclosed in this application;
[0041] Figure 3 This is a specific example diagram of a method for identifying the role of a recording text disclosed in this application;
[0042] Figure 4 This is a specific example diagram of a method for identifying the role of a recording text disclosed in this application;
[0043] Figure 5This is a specific example diagram of a method for identifying the role of a recording text disclosed in this application;
[0044] Figure 6 This is a specific example diagram of a method for identifying the role of a recording text disclosed in this application;
[0045] Figure 7 This is a schematic diagram of the structure of a voice recording text role recognition device disclosed in this application;
[0046] Figure 8 This application provides a structural diagram of an electronic device. Detailed Implementation
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] In existing technologies, sales and customer service personnel communicate with customers via call centers, generating a large number of recordings daily. These recordings often contain valuable information. Converting speech to text and performing text mining and analysis are crucial components of this process. Speaker role recognition is used to determine the identities of the two parties in the call (agent or customer) before proceeding with downstream tasks. For mono recordings, speech-to-text conversion outputs information from different channels representing different people, but it doesn't specify which channel the agent or customer belongs to. Currently, two common text role recognition technologies are used: one based on keywords and the other on semantics. Keyword extraction relies on the differences between the agent's and customer's speech, as agents often exhibit certain patterns in their speech. Sentence semantics uses a binary classification model to categorize roles. If the model predicts a role (agent or customer) with a probability greater than a certain threshold, then the model's predicted role is determined as the final role for that sentence. However, the effectiveness depends on speech role separation. Even if the model correctly assigns roles, the overall role accuracy remains low. Statistically, speech separation is relatively better for longer calls, but more confusing for shorter calls. Furthermore, long texts increase the complexity of sequence labeling, and speech role separation leads to numerous misclassifications of single sentences (i.e., speaker A contains sentences belonging to speaker B, and speaker B contains sentences belonging to speaker A). Current optimization methods for speech role separation are complex, time-consuming, and ineffective. Keyword-based role identification is ineffective in distinguishing between agent and customer texts, lacking regularity, and the rules are not universally applicable across different companies. Binary classification models rely heavily on speech separation; if the speech itself is not separated, it affects the role identification results. Therefore, improving the efficiency, accuracy, and diversity of recorded text role recognition is a problem that needs to be solved in this field.
[0049] See Figure 1 As shown in the figure, an embodiment of the present invention discloses a method for character recognition in audio recordings, which may specifically include:
[0050] Step S11: Obtain the recording content to be identified, and determine the text information of each recording and the total recording duration based on the recording content.
[0051] Step S12: Determine the relationship between the total recording duration and the preset threshold. If the total recording duration is greater than the preset threshold, use the preset first training model to perform role recognition on each of the recorded text information to obtain the role recognition result.
[0052] In this embodiment, if the total recording duration exceeds a preset threshold, the preset Albert-Tiny model is optimized using loss weighting to obtain a first training model. The first training model is then used to perform binary classification and role recognition on each of the recorded text information to obtain a prediction result for each role. It is then determined whether the prediction results for each role are the same. If the prediction results for each role are different, the role recognition result is determined based on the prediction results.
[0053] In this embodiment, if the prediction results of each role are the same, each predicted role and its corresponding prediction probability are determined based on the prediction results of each role; the maximum prediction probability of a role is selected from all the prediction probabilities of a role as the role probability; and the role recognition result is determined based on the role probability and the prediction role corresponding to the role probability.
[0054] Step S13: If the total recording duration is less than a preset threshold, then the preset second training model is used to perform role sequence annotation on each of the recorded text information to obtain the annotated recorded text information. It is then determined whether the information length of the annotated recorded text information is less than a preset processing length. If the information length of the annotated recorded text information is less than the preset processing length, then the role recognition result is determined based on the annotated recorded text information.
[0055] In this embodiment, if the total recording duration is less than a preset threshold, each labeled text information in the recorded text information is determined, and the preset electra-base model is optimized using loss weighting to obtain a second training model; based on each labeled text information and using the second training model, the recorded text information is labeled with role sequences to obtain the labeled recorded text content.
[0056] In this embodiment, the steps for determining the first training model and the second training model are as follows: a first training method is determined from the preset training methods, and the embedding layer of the Albert-tiny model is trained using the first training method and loss weighting to obtain the first training model; a second training method is determined from the preset training methods, and the embedding layer of the electra-base model is trained using the second training method and loss weighting to obtain the second training model.
[0057] In this embodiment, the recorded content to be identified is obtained, and the recorded text information and total recording duration are determined based on the recorded content. The relationship between the total recording duration and a preset threshold is determined. If the total recording duration is greater than the preset threshold, a preset first training model is used to perform role recognition on each of the recorded text information to obtain a role recognition result. If the total recording duration is less than the preset threshold, a preset second training model is used to perform role sequence annotation on each of the recorded text information to obtain annotated recorded text information. It is then determined whether the information length of the annotated recorded text information is less than a preset processing length. If the information length of the annotated recorded text information is less than the preset processing length, a role recognition result is determined based on the annotated recorded text information. This application uses the output text of single-channel recorded data from third-party speech recognition technology. For call text with a call duration greater than a certain threshold, the Albert-Tiny model is used for role binary classification; otherwise, the Electra model is used for role sequence annotation. Sequence annotation does not depend on the speech separation effect; it can not only identify the corresponding role but also the corresponding role's speech stop point. We employ loss weighting to improve the accuracy of character recognition, and sentence-based sliding window segmentation to handle excessively long texts. Furthermore, we utilize adversarial training to enhance the model's generalization ability, thereby improving the efficiency, accuracy, and diversity of character recognition in recorded text.
[0058] See Figure 2 As shown in the figure, an embodiment of the present invention discloses a method for character recognition in audio recordings, which may specifically include:
[0059] Step S21: Obtain the recording content to be identified, and use third-party speech recognition technology to identify and process the recording content to obtain all the recording text information and the total recording duration. Classify all the recording text information according to the type of recording channel to obtain each recording text information.
[0060] For example, using commercially available third-party speech recognition technology, the input is a recording URL (Uniform Resource Locator), and the output is speech-to-text information and text information from different channels. The output structure is as follows: the output data only shows that different channels represent different people, but it does not know which channel the specific agent or customer belongs to. Some kind of recognition is needed to distinguish between the agent and the customer.
[0061] {['text': 'Hello', 'channel': 0],\
[0062] ['text': 'what', 'channel': 1], \
[0063] ['text': 'Hello sir, this is', 'channel': 0], \
[0064] ['text': 'Company XX, then to see if you understand our XX system, we are looking for', 'channel': 1],
[0065] ['text': 'Customer resources, sales management, or ', 'channel': 0],
[0066] ['text': 'Busy, add me on WeChat, goodbye', 'channel': 1]}
[0067] Step S22: Determine the relationship between the total recording duration and the preset threshold. If the total recording duration is greater than the preset threshold, use the preset first training model to perform role recognition on each of the recorded text information to obtain the role recognition result.
[0068] Step S23: If the total recording duration is less than a preset threshold, then the preset second training model is used to perform role sequence annotation on each of the recorded text information to obtain the annotated recorded text information. It is then determined whether the information length of the annotated recorded text information is less than a preset processing length. If the information length of the annotated recorded text information is less than the preset processing length, then the role recognition result is determined based on the annotated recorded text information.
[0069] In this embodiment, after determining whether the information length of the annotated audio text information is less than the preset processing length, the method further includes: if the information length of the annotated audio text information is not less than the preset processing length, then the annotated audio text information is segmented using a sliding window segmentation method to obtain annotated sub-audio text information, and the role recognition result is determined based on all the annotated sub-audio text information.
[0070] In this embodiment, the specific process is as follows: Figure 3As shown, the recording content to be identified in the call recording is obtained, and then ASR (Automatic Speech Recognition) is used to recognize the recording content to obtain all the recording text information and the total recording time. The relationship between the total recording time and a preset threshold is determined. If the total recording time is greater than the preset threshold, the Albert-Tiny model with loss weighting optimization is used to perform role identification on each recording text information to obtain the role identification results. It is determined whether the prediction results of each role are the same. If the prediction results of each role are different, the role identification result is determined based on the role prediction results. If the prediction results of each role are the same, it is necessary to further judge according to the probability. The role with the higher probability is identified as one role, and the role with the lower probability is identified as another role, thus obtaining the role identification result. If the total recording duration is less than a preset threshold, the Electra-base model, optimized using loss weighting, is used to perform role sequence labeling on each recording text information to obtain labeled recording text information. Then, it is determined whether the information length of the labeled recording text information is less than a preset processing length. If the information length of the labeled recording text information is less than the preset processing length, the role recognition result is determined based on the labeled recording text information. If the information length of the labeled recording text information is less than the preset processing length, the sliding window segmentation method is used to segment the labeled recording text information to obtain labeled sub-recording text information. The role recognition result is determined based on all labeled sub-recording text information.
[0071] For example, such as Figure 4 As shown, the text output above is divided and merged into two texts according to the type of recording channel. These texts are then input into the role sequence model Albert-tiny. If the model's predictions are different, for example, channel 0 is a sales agent and channel 1 is a customer, then the role identification result is determined. If the model's predictions are the same, meaning both sentence 1 and sentence 2 are sales agents or both are customers, the determination is based on the probability of both being sales agents or customers. If the probability of sentence 1 being a sales agent is 0.93 and the probability of sentence 2 being a sales agent is 0.75, then sentence 1 is a sales agent and sentence 2 is a customer, thus determining the role identification result.
[0072] For audio recordings with a total duration less than a preset threshold, the speech separation performance is relatively poor. Therefore, a role sequence labeling task independent of speech separation is used. For example, in the above example, regardless of whether channel 1 is predicted as an agent or a customer, role recognition is incorrect because channel 1 contains text for both customers and agents. Thus, using Electra-base, role recognition is treated as a sequence labeling task. First, the labeled text is defined: customer ends with the symbol ' / ', agent ends with the symbol '+', and other text ends with 'o'. The sequence labeling method is punctuation_enc = {'o':'0', ' / ':'1', '+':'2'}, as shown below. Figure 5 As shown, firstly, the input text is annotated using `punctuation_enc`, and the encoded text is input into the `electra_base` model. The output is then decoded, and the output text is generated according to `punctuation_decode = {'0':'o','1':' / ','2':'+'}`: Agent: Hello\nCustomer: What\nAgent: Hello, sir...
[0073] If the length of the annotated audio text information is not less than the preset processing length, then a sliding window segmentation method is used to segment the annotated audio text information. Because accuracy is required in real-world scenarios and customers are concerned about error rates, we can increase precision through loss weights, which is more practical in engineering. This is mainly achieved by controlling the mask to control the loss weights. If the model fails to recognize a marker it should have recognized, the corresponding loss is increased, thus increasing the penalty on the model; if the model recognizes a marker it shouldn't have recognized, the corresponding loss is decreased. The specific model results are as follows... Figure 6 As shown, based on sentence sliding windows, electra-base cannot handle texts longer than 512 characters. Therefore, a sliding window segmentation method is used, dividing sentences according to punctuation marks. The step size for each slide is the distance of one punctuation mark, and overlapping regions are also used for sliding. This approach greatly increases the amount of data, allowing the model to be trained more thoroughly.
[0074] To improve the generalization ability of the binary classification model Albert-tiny and the role sequence model Electra-base, adversarial training is used. Adversarial training in NLP (Natural Language Processing) primarily enhances the model's generalization ability by adding perturbations to the embedding layer. This application uses FGM methods, including but not limited to FGM (Fast Gradient Ascent), PGD (Projected Gradient Descent), FreeAT (Free Adversarial Training), and YOPO (You Only Propagate Once).
[0075] In this embodiment, the recorded content to be identified is obtained, and the recorded text information and total recording duration are determined based on the recorded content. The relationship between the total recording duration and a preset threshold is determined. If the total recording duration is greater than the preset threshold, a preset first training model is used to perform role recognition on each of the recorded text information to obtain a role recognition result. If the total recording duration is less than the preset threshold, a preset second training model is used to perform role sequence annotation on each of the recorded text information to obtain annotated recorded text information. It is then determined whether the information length of the annotated recorded text information is less than a preset processing length. If the information length of the annotated recorded text information is less than the preset processing length, a role recognition result is determined based on the annotated recorded text information. This application uses the output text of single-channel recorded data from third-party speech recognition technology. For call text with a call duration greater than a certain threshold, the Albert-Tiny model is used for role binary classification; otherwise, the Electra model is used for role sequence annotation. Sequence annotation does not depend on the speech separation effect; it can not only identify the corresponding role but also the corresponding role's speech stop point. We employ loss weighting to improve the accuracy of character recognition, and sentence-based sliding window segmentation to handle excessively long texts. Furthermore, we utilize adversarial training to enhance the model's generalization ability, thereby improving the efficiency, accuracy, and diversity of character recognition in recorded text.
[0076] See Figure 7 As shown, this embodiment of the invention discloses a recording text role recognition device, which may specifically include:
[0077] The recording content acquisition module 11 is used to acquire the recording content to be identified, and determine the recording text information and total recording duration based on the recording content;
[0078] The first role recognition result determination module 12 is used to determine the relationship between the total recording time and the preset threshold. If the total recording time is greater than the preset threshold, the preset first training model is used to perform role recognition on each of the recorded text information to obtain the role recognition result.
[0079] The second role recognition result determination module 13 is used to perform role sequence annotation on each of the recorded text information using a preset second training model if the total recording duration is less than a preset threshold, so as to obtain each annotated recorded text information, determine whether the information length of the annotated recorded text information is less than a preset processing length, and determine the role recognition result based on the annotated recorded text information if the information length of the annotated recorded text information is less than the preset processing length.
[0080] In this embodiment, the recorded content to be identified is obtained, and the recorded text information and total recording duration are determined based on the recorded content. The relationship between the total recording duration and a preset threshold is determined. If the total recording duration is greater than the preset threshold, a preset first training model is used to perform role recognition on each of the recorded text information to obtain a role recognition result. If the total recording duration is less than the preset threshold, a preset second training model is used to perform role sequence annotation on each of the recorded text information to obtain annotated recorded text information. It is then determined whether the information length of the annotated recorded text information is less than a preset processing length. If the information length of the annotated recorded text information is less than the preset processing length, a role recognition result is determined based on the annotated recorded text information. This application uses the output text of single-channel recorded data from third-party speech recognition technology. For call text with a call duration greater than a certain threshold, the Albert-Tiny model is used for role binary classification; otherwise, the Electra model is used for role sequence annotation. Sequence annotation does not depend on the speech separation effect; it can not only identify the corresponding role but also the corresponding role's speech stop point. We employ loss weighting to improve the accuracy of character recognition, and sentence-based sliding window segmentation to handle excessively long texts. Furthermore, we utilize adversarial training to enhance the model's generalization ability, thereby improving the efficiency, accuracy, and diversity of character recognition in recorded text.
[0081] In some specific embodiments, the recording content acquisition module 11 may specifically include:
[0082] The audio recording content recognition module is used to acquire the audio recording content to be recognized and to use third-party speech recognition technology to recognize and process the audio recording content in order to obtain all the audio recording text information and the total recording duration.
[0083] The audio recording text information determination module is used to classify all the audio recording text information according to the type of recording channel to obtain each audio recording text information.
[0084] In some specific embodiments, the first role recognition result determination module 12 may specifically include:
[0085] The role prediction result determination module is used to optimize the preset Albert-tiny model using loss weighting to obtain a first training model, and to use the first training model to perform binary classification role recognition and differentiation operations on each of the recorded text information to obtain the prediction result of each role.
[0086] The role prediction result judgment module is used to determine whether the prediction results of each role are the same. If the prediction results of each role are different, the role recognition result is determined based on the prediction results.
[0087] In some specific embodiments, the first role recognition result determination module 12 may specifically include:
[0088] The prediction role determination module is used to determine each predicted role and its corresponding prediction probability based on the prediction results of each role if the prediction results of each role are the same.
[0089] The role probability determination module is used to select the maximum predicted role probability from all predicted role probabilities as the role probability, and determine the role recognition result based on the role probability and the predicted role corresponding to the role probability.
[0090] In some specific embodiments, the second role recognition result determination module 13 may specifically include:
[0091] The second training model determination module is used to determine each labeled text information in the recorded text information, and optimize the preset electra-base model using loss weighting to obtain the second training model.
[0092] The role sequence annotation module is used to perform role sequence annotation on the audio text information based on the annotated text information and using the second training model to obtain the annotated audio text content.
[0093] In some specific embodiments, the second role recognition result determination module 13 may specifically include:
[0094] The second training method determination module is used to determine a second training method from preset training methods;
[0095] The second model training module is used to train the embedding layer of the electra-base model using the second training method and loss weighting to obtain the second training model;
[0096] Accordingly, the optimization of the preset Albert-tiny model using loss weighting to obtain the first training model includes:
[0097] The first training method determination module is used to determine the first training method from the preset training methods;
[0098] The first model training module is used to train the Embedding layer of the Albert-tiny model using a first training method and loss weighting to obtain the first training model.
[0099] In some specific embodiments, the second role recognition result determination module 13 may specifically include:
[0100] The segmentation module is used to segment the labeled audio text information using a sliding window segmentation method if the information length of the labeled audio text information is not less than a preset processing length, so as to obtain labeled sub-audio text information, and determine the role recognition result based on all the labeled sub-audio text information.
[0101] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the audio recording text role recognition method performed by the electronic device disclosed in any of the foregoing embodiments.
[0102] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0103] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored on it include operating system 221, computer program 222 and data 223, etc., and the storage method can be temporary storage or permanent storage.
[0104] The operating system 221 manages and controls the various hardware devices on the electronic device 20 and the computer program 222 to enable the processor 21 to perform operations and processing on the data 223 in the memory 22. The operating system 221 can be Windows, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing the audio recording text role recognition method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the audio recording text role recognition device from external devices, as well as data collected by its own input / output interface 25.
[0105] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0106] Furthermore, this application also discloses a computer-readable storage medium storing a computer program. When the computer program is loaded and executed by a processor, it implements the steps of the audio recording text role recognition method disclosed in any of the foregoing embodiments.
[0107] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0108] The present invention has provided a detailed description of a method, apparatus, device, and storage medium for recording text role recognition. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for identifying the role of characters in recorded text, characterized in that, include: The audio recording content to be identified is obtained, and the text information of each recording and the total recording duration are determined based on the audio recording content. The relationship between the total recording duration and a preset threshold is determined. If the total recording duration is greater than the preset threshold, a preset first training model is used to perform role recognition on each of the recorded text information to obtain the role recognition result. If the total recording duration is less than a preset threshold, then the preset second training model is used to perform role sequence labeling on each of the recorded text information to obtain each labeled recorded text information. It is then determined whether the information length of the labeled recorded text information is less than a preset processing length. If the information length of the labeled recorded text information is less than the preset processing length, then the role recognition result is determined based on the labeled recorded text information. The step of using a preset second training model to perform role sequence annotation on the recorded text information to obtain annotated recorded text content includes: determining each annotated text information in the recorded text information, optimizing a preset electra-base model using loss weighting to obtain a second training model; and performing role sequence annotation on the recorded text information based on each annotated text information and using the second training model to obtain annotated recorded text content.
2. The audio recording text role recognition method according to claim 1, characterized in that, The process of acquiring the audio content to be identified and determining the text information of each audio recording and the total recording duration based on the audio content includes: The recording content to be identified is obtained, and the recording content is processed using third-party speech recognition technology to obtain all the recording text information and the total recording duration. All the recorded text information is classified according to the type of recording channel to obtain each recorded text information.
3. The audio recording text role recognition method according to claim 1, characterized in that, The step of using a preset first training model to perform role recognition on each of the recorded text information to obtain role recognition results includes: The preset Albert-tiny model is optimized using loss weighting to obtain a first training model. The first training model is then used to perform binary classification and role recognition on each of the recorded text information to obtain the prediction results for each role. Determine whether the prediction results of each role are the same. If the prediction results of each role are different, then determine the role recognition result based on the prediction results.
4. The audio recording text role recognition method according to claim 3, characterized in that, After determining whether the prediction results for each role are the same, the method further includes: If the prediction results for each of the aforementioned roles are the same, then each predicted role and its corresponding prediction probability are determined based on the prediction results for each of the aforementioned roles. The maximum predicted probability of a character is selected from all predicted character probabilities and taken as the character probability. The character recognition result is determined based on the character probability and the predicted character corresponding to the character probability.
5. The method for identifying the role of characters in recorded text according to claim 1, characterized in that, The step of optimizing the preset electra-base model using loss weighting to obtain the second training model includes: A second training method is determined from the preset training methods; The embedding layer of the electra-base model is trained using the second training method and loss weighting to obtain the second trained model; Accordingly, the optimization of the preset Albert-tiny model using loss weighting to obtain the first training model includes: The first training method is determined from the preset training methods; The embedding layer of the Albert-tiny model is trained using the first training method and loss weighting to obtain the first trained model.
6. The method for identifying the role of characters in recorded text according to any one of claims 1 to 5, characterized in that, After determining whether the length of the annotated audio text information is less than the preset processing length, the method further includes: If the length of the annotated audio text information is not less than the preset processing length, the annotated audio text information is segmented using a sliding window segmentation method to obtain annotated sub-audio text information, and the role recognition result is determined based on all the annotated sub-audio text information.
7. A device for recognizing the role of a person in recorded text, characterized in that, include: The recording content acquisition module is used to acquire the recording content to be identified, and determine the text information of each recording and the total recording duration based on the recording content; The first role recognition result determination module is used to determine the relationship between the total recording time and the preset threshold. If the total recording time is greater than the preset threshold, the preset first training model is used to perform role recognition on each of the recorded text information to obtain the role recognition result. The second role recognition result determination module is used to, if the total recording duration is less than a preset threshold, use a preset second training model to perform role sequence annotation on each of the recorded text information to obtain annotated recorded text information, determine whether the information length of the annotated recorded text information is less than a preset processing length, and if the information length of the annotated recorded text information is less than the preset processing length, determine the role recognition result based on the annotated recorded text information. The step of using a preset second training model to perform role sequence annotation on the recorded text information to obtain annotated recorded text content includes: determining each annotated text information in the recorded text information, optimizing a preset electra-base model using loss weighting to obtain a second training model; and performing role sequence annotation on the recorded text information based on each annotated text information and using the second training model to obtain annotated recorded text content.
8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the audio text role recognition method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the audio text role recognition method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Automatic marking method for speaker
CN108735200A
Role recognition method and device for monophonic voice data
CN109785846A