Language identification method, device, equipment, medium and product

By employing frame-level language recognition and smooth merging techniques, combined with an adversarial language recognition model, the problem of language recognition accuracy in mixed language and cross-channel scenarios was solved, achieving more efficient language recognition results.

CN118748006APending Publication Date: 2024-10-08HEFEI IFLY DIGITAL TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410656002.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

Existing language recognition methods have low accuracy or even fail to function properly when dealing with mixed languages, especially in cross-channel scenarios.

Method used

By performing frame-level language identification on speech data, beam search is used to determine language segments, and a smooth merging operation is performed to classify short language segments into adjacent language segments. Combined with an adversarial language identification model, channel interference is removed, thereby improving identification accuracy.

Benefits of technology

It achieves accurate recognition of mixed language speech data, improves language recognition performance in cross-channel scenarios, and enhances the accuracy and consistency of recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118748006A_ABST
    Figure CN118748006A_ABST
Patent Text Reader

Abstract

The invention provides a language recognition method and device, equipment, a medium and a product, and the method comprises the steps: carrying out the language recognition of to-be-recognized voice data, obtaining an initial language recognition result corresponding to the voice data, and enabling the initial language recognition result to comprise a frame-level language recognition result corresponding to each voice frame of the voice data; based on the initial language recognition result, determining an intermediate language recognition result corresponding to the voice data, the intermediate language recognition result including each language segment in the voice data; and on the basis of the frame-level language recognition result corresponding to each language segment in the intermediate language recognition result, combining the language segments to obtain a language recognition result corresponding to the voice data. According to the method and the device, the language recognition accuracy of the mixed language data can be improved.
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, and in particular to a language recognition method, device, equipment, medium and product. Background Art

[0002] Language recognition refers to the automatic identification of the language used by the speaker based on the input voice data.

[0003] At present, the mainstream language recognition method is to use training corpus to train a language recognition classification network. After that, the classification network is used to perform language recognition on the test speech. When the test speech is performed on the test speech of a single language, it has a good recognition effect. However, when a test speech includes multiple language categories, the language recognition accuracy of the current classification network is low, and it may even fail to operate normally. Summary of the invention

[0004] Based on the above technical status, the present application provides a language recognition method, device, equipment, medium and product.

[0005] In order to achieve the above technical objectives, this application specifically proposes the following technical solutions:

[0006] According to a first aspect of an embodiment of the present application, a language recognition method is provided, comprising: performing language recognition on speech data to be recognized to obtain an initial language recognition result corresponding to the speech data, the initial language recognition result comprising frame-level language recognition results corresponding to each speech frame of the speech data; based on the initial language recognition result, determining an intermediate language recognition result corresponding to the speech data, the intermediate language recognition result comprising each language segment in the speech data; based on the frame-level language recognition results corresponding to each language segment in the intermediate language recognition result, merging the language segments to obtain a language recognition result corresponding to the speech data.

[0007] According to a second aspect of an embodiment of the present application, a language recognition device is provided, characterized in that it includes: a language recognition unit, used to perform language recognition on speech data to be recognized, and obtain an initial language recognition result corresponding to the speech data, wherein the initial language recognition result includes frame-level language recognition results corresponding to each speech frame of the speech data; a determination unit, used to determine an intermediate language recognition result corresponding to the speech data based on the initial language recognition result, wherein the intermediate language recognition result includes each language segment in the speech data; and a merging unit, used to merge each language segment in the intermediate language recognition result based on the frame-level language recognition results corresponding to each language segment, and obtain a language recognition result corresponding to the speech data.

[0008] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory and a processor; the memory is connected to the processor and is used to store programs; the processor is used to implement the language recognition method as described in the first aspect by running the program in the memory.

[0009] According to a fourth aspect of the embodiments of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the language recognition method as described in the first aspect is implemented.

[0010] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising computer program instructions, which, when executed by a processor, cause the processor to execute: the language recognition method as described in the first aspect.

[0011] The embodiments of the present application provide a language recognition method, device, equipment, medium and product, which performs language recognition on the speech data to be recognized, obtains the frame-level language recognition results corresponding to each speech frame of the speech data, and determines each language segment corresponding to the speech data based on the frame-level language recognition results corresponding to each speech frame, thereby obtaining the intermediate language recognition results corresponding to the speech data, and then uses a smooth merging operation to merge each language segment in the intermediate language recognition results, classifies the jittering short burr segments in each language segment into the most reasonable adjacent language segments, and obtains the language recognition results corresponding to the speech data. Since the smooth merging is based on the frame-level language recognition results, the final language recognition result can accurately provide the time interval information of the alternating appearance of each language category in the speech data, so that the effect of accurate language recognition for mixed language speech data can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0013] Figure 1 A schematic diagram of the structure of a typical language recognition network in the related art;

[0014] Figure 2 A flow chart of a language recognition method provided in an embodiment of the present application;

[0015] Figure 3 A schematic diagram of an example of a beam search provided in an embodiment of the present application;

[0016] Figure 4 A schematic diagram of a process for determining a language recognition result of speech data provided in an embodiment of the present application;

[0017] Figure 5 A schematic diagram of the data flow of the training process of the language recognition model provided in the embodiment of the present application;

[0018] Figure 6 A schematic diagram of the data flow of the mixed language recognition process provided in the embodiment of the present application;

[0019] Figure 7 A schematic diagram of the structure of a language recognition device provided in an embodiment of the present application;

[0020] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0021] The technical solution proposed in the embodiment of the present application is applicable to application scenarios such as international conferences and emergency rescue. The technical solution of the embodiment of the present application can improve the accuracy of language recognition, thereby improving the language recognition effect in various application scenarios. For example, in scenarios such as international conferences and emergency rescue, the technical solution can be applied to achieve cross-language communication and information transmission to help people communicate and cooperate more effectively.

[0022] The technical solution provided in the embodiments of the present application can be exemplarily applied to hardware devices such as processors, electronic devices, servers (including cloud servers), or packaged into software programs to be run. When the hardware device executes the processing of the technical solution of the embodiments of the present application, or the above-mentioned software program is run, the automatic splitting of the target task and the automatic calling of the application program interface required for the task can be achieved to complete the purpose of the target task. The embodiments of the present application only exemplarily introduce the specific processing of the technical solution of the present application, and do not limit the specific implementation form of the technical solution of the present application. Any technical implementation form that can execute the processing of the technical solution of the present application can be adopted by the embodiments of the present application.

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

[0024] Before introducing this application solution, the relevant technologies are first introduced:

[0025] Language recognition, also known as language identification, refers to the process of automatically determining the language type of a speech segment by a machine. In the study of language recognition technology, by analyzing the frequency, tone, phonetic features and other information of the speech signal, the machine can accurately determine the language type of the speech segment. The development of language recognition technology not only provides new possibilities for machine intelligence and human-computer interaction, but also brings more convenience and benefits to applications in various fields.

[0026] The mainstream language recognition method currently uses technologies such as neural networks. This method uses training corpus to train a language recognition classification network, where the typical network structure includes time-delay neural networks (TDNN). Through this network, the speech to be tested is recognized as a set of scores, and finally the language classification attribute of the speech to be tested is determined according to the category corresponding to the maximum score. The following is an introduction to this process with the accompanying figure:

[0027] Figure 1 FIG. 1 is a schematic diagram of a typical language recognition network in the related art. Figure 1 As shown in the figure, the deep neural network used in the language recognition system is a TDNN network, and its structure mainly includes frame processing layers (fame-level layers), pooling layers, segment processing layers (segment-level layers) and output layers (corresponding language labels).

[0028] During the training process, the speech features of the speech sample are first input into the TDNN network. Each time, the TDNN network takes the speech features of a fixed time delay frame and inputs it into the fully connected layer. Since the TDNN network takes into account the information of the previous and next frames, the output of the TDNN network also contains longer speech information. After that, the pooling layer calculates the mean and standard deviation in the frame dimension on the final output vector of the TDNN as the output of the pooling layer. The pooling layer is followed by two omnidirectional connection layers, and finally a softmax layer is added as the output. The number of neurons in its output is consistent with the number of language categories included in the training set. When performing language recognition, the speech to be recognized is first divided into speech segments of fixed length, and then sent to the language recognition network to obtain the recognition result score. Finally, the scores of multiple recognition results are averaged, and the language category corresponding to the result with the largest average value is selected as the final recognition result.

[0029] The above language recognition scheme works well for the case where a single piece of data contains only a single language and the same channel. However, one of the very important prerequisites for the success of mainstream language recognition technology is that the speech it processes must be in a single language. If faced with mixed language data, the recognition effect will be significantly reduced.

[0030] In addition, with the development of communication methods and the increase in cross-regional communication, cross-channel situations in language recognition applications are becoming more common. For example, a model trained with single-channel data (telephone data) may not perform well or even fail to work properly in language recognition scenarios such as satellite phones or video conferences.

[0031] In summary, affected by interference factors such as channels and mixed languages, existing language recognition technologies are difficult to accurately identify the target language. Therefore, it is necessary to further improve the language recognition method to improve the accuracy of language recognition.

[0032] In view of this, the embodiments of the present application are dedicated to providing a language recognition method, apparatus, device and storage medium, which can more accurately recognize the language of mixed language speech data, and can also accurately recognize the language when facing mixed language data across channels. The following embodiments are described in detail one by one.

[0033] Exemplary Methods

[0034] Figure 2 A flow chart of a language recognition method provided in an embodiment of the present application. Figure 2 As shown, the language method provided in this embodiment includes steps S201-S203:

[0035] S201. Perform language recognition on the speech data to be recognized to obtain an initial language recognition result corresponding to the speech data.

[0036] Before performing step S201, it is necessary to obtain voice data to be recognized. The voice data refers to a recording file or real-time recording for which language recognition is required, which can be obtained through a sound collection device, such as a microphone or a recording device.

[0037] In order to improve the efficiency of language recognition, this embodiment will perform preprocessing and segmentation operations on the voice data after obtaining it. Preprocessing includes filtering out silence, noise and other processing to ensure the clarity and accuracy of the voice data. The preset segmentation length valid_time_thred can be set to 15-25 seconds according to actual needs, for example, 20 seconds. After preprocessing and segmentation operations, several voice segments with a preset segmentation length will be obtained, which will help improve the accuracy and efficiency of language recognition.

[0038] In this embodiment, the initial language recognition result includes the frame-level language recognition result corresponding to each speech frame of the speech data. Among them, the frame is the smallest basic unit of speech processing, usually a small speech segment of 25ms. When performing language recognition on the speech data, the language recognition is performed on each speech segment of the speech data at the frame level. It can also be understood that each speech segment is divided into at least one speech frame, and the language recognition is performed on each speech frame to obtain the frame-level language recognition result corresponding to the speech frame. By summarizing and integrating the frame-level language recognition results corresponding to each speech frame, the initial language recognition result corresponding to the speech data can be obtained.

[0039] S202: Determine an intermediate language recognition result corresponding to the speech data based on the initial language recognition result.

[0040] The initial language recognition result is a frame-level language recognition result, which represents the recognition probability of each speech frame under each language category and is the initial result of language recognition. Therefore, it is necessary to further generate each language segment based on the frame-level language recognition results corresponding to each speech frame in the initial language recognition result, so as to obtain an intermediate language recognition result. That is, the intermediate language recognition result includes each language segment in the speech data. Each language segment refers to a small segment of speech in the speech data that is recognized as a language category. The previous language segment that is adjacent to the language segment in time is different from the language category of the language segment, and the next language segment that is adjacent to the language segment in time is also different from the language category of the language segment.

[0041] In some embodiments, a beam search may be performed on the initial language recognition result to obtain Nbest intermediate language recognition results corresponding to the speech data, where Nbest is a positive integer greater than 1.

[0042] Specifically, the process of the beam search includes: for each speech frame in each speech frame, retaining the language category corresponding to the largest Nbest recognition probabilities on the speech frame, and determining the language category corresponding to the Nbest recognition probabilities corresponding to the speech segment (also referred to as a speech frame sequence) formed by the two speech frames based on the language category corresponding to the Nbest recognition probabilities and the frame-level language recognition result of the next speech frame on the next speech frame. After performing the above steps for each speech frame, Nbest intermediate language recognition results can be obtained. The beam search process is introduced below with reference to the accompanying drawings and examples:

[0043] Figure 3 The schematic diagram of the example of the beam search provided in the embodiment of the present application. Figure 3As shown, it is assumed that there are three language categories, namely Chinese, Korean and English, and the value of Nbest is 2. Then the frame-level language recognition result of the first speech frame in the time dimension includes the recognition probabilities of the speech frame in the three language categories, which are 0.5, 0.2 and 0.3 respectively. It can be seen that the recognition probabilities of the two language categories of Chinese and English are the highest (0.5 and 0.3 respectively). Therefore, the two language categories of Chinese and English are retained at the first speech frame moment, and the recognition probabilities of the speech frame combination generated by the second speech frame under each language category combination are calculated. As shown in the figure, the recognition probability of the speech frame combination under the Chinese-Chinese combination is 0.1, the recognition probability under the Chinese-English combination is 0.9, the recognition probability under the Chinese-Korean combination is 0.3, the recognition probability under the English-Chinese combination is 0.2, the recognition probability under the English-English combination is 0.6, and the recognition probability under the English-Korean combination is 0.1, and then the two language category combinations of Chinese-English and English-English are retained at the second speech frame moment. And so on, until the last speech frame is traversed, Chinese and English are taken as the starting points respectively, and the language categories of each speech frame corresponding to the connected gray boxes are taken as the Nbest recognition routes.

[0044] In each recognition route, assuming that multiple language categories in the retained language category combination are the same, the speech frames under the language category combination are merged, and the merged speech frames are a language segment. For example, Figure 3 The English-English combination retained in the speech data has the same language category, both of which are English. Therefore, the first speech frame and the second speech frame can be merged to obtain a language segment. Similarly, the intermediate language recognition result of the entire speech data can be obtained.

[0045] S203: Based on the frame-level language recognition results corresponding to the language segments in the intermediate language recognition results, the language segments are merged to obtain the language recognition results corresponding to the speech data.

[0046] Each language segment in the intermediate language recognition result has a corresponding time length, some language segments have a longer time length, and some language segments may have a shorter time length. Considering that in a mixed language scenario, a new language category is usually rarely generated in a short period of time. Therefore, the present embodiment may also set a preset time length time_duration_thred, such as 0.2 seconds, and based on the comparison result of the time length of each language segment with the preset time length, determine the burr segments in each language segment, and smoothly merge the burr segments in each language segment, that is, merge the burr segments into reasonable adjacent language segments, so that the language recognition result of the speech data is more reasonable.

[0047] The intermediate language recognition results include Nbest ones. In this embodiment, the language segments of each intermediate language recognition result in the Nbest intermediate language recognition results are merged to obtain Nbest candidate language recognition results corresponding to the speech data.

[0048] Figure 4 A flow chart of determining the language recognition result of speech data provided in an embodiment of the present application. Figure 4 As shown, step S203 includes steps S401-S402:

[0049] S401. For each of the Nbest intermediate language recognition results, based on the frame-level language recognition results corresponding to each language segment in the intermediate language recognition result, merge the language segments to obtain a candidate language recognition result corresponding to the intermediate language recognition result.

[0050] As described in step S201, the frame-level language recognition result corresponding to each speech frame includes: the recognition probability of the speech frame being recognized as each language category. The recognition probability of the speech frame being recognized as each language category represents the possibility of the speech frame being recognized as each language category. For example, the greater the recognition probability of the speech frame under a certain language category, the greater the possibility that the language attribute of the speech frame is of the language category, and vice versa, the smaller the possibility that the speech attribute of the speech frame is of the language category.

[0051] Step S401 aims to classify the burr segments in each language segment into more reasonable adjacent language segments based on the frame-level language recognition results corresponding to each language segment in the intermediate language recognition result, so as to make the language recognition result more reasonable. Specifically, this embodiment can sequentially determine each language segment as the t-th language segment, and perform a smooth merge operation on the t-th language segment, and classify the burr segments in each language segment into more reasonable adjacent language segments. t is a positive integer. Among them, the smooth merge operation can include the following implementation methods:

[0052] In some implementations, step S401 may include steps a1) to a2):

[0053] a1) when the time length of the t-th language segment is less than a preset time length, and the time lengths of the t-1-th language segment and the t+1-th language segment are both greater than the preset time lengths, determining a first score for re-identifying the language category of the t-1-th language segment as the language category of the t-1-th language segment, and determining a second score for re-identifying the language category of the t-th language segment as the language category of the t+1-th language segment.

[0054] In this embodiment, if the time length of the t-th language segment is less than the preset time length, it indicates that the time length of the t-th language segment is short, and a new language category will not be generated in such a short time. The time lengths of the t-1-th language segment and the t+1-th language segment are both greater than the preset time length, indicating that the language recognition categories of the t-1-th language segment and the t+1-th language segment are more reasonable in terms of time length. Therefore, the t-th language segment is likely to be a burr segment, and it is necessary to determine the first score Score of the merged t-1-th language segment under the language category of the t-1-th language segment before the merger after the t-1-th language segment is merged. t-1,t . And, after the t-th language segment is merged into the t+1-th language segment, the second score Score of the merged t+1-th language segment under the language category of the t+1-th language segment before the merger is determined t,t+1 .

[0055] Wherein, determining the first score for re-identifying the language category of the t-th language segment as the language category of the t-1-th language segment in step a1) includes: determining the first score based on the cumulative sum of the maximum recognition probabilities of all speech frames in the t-1-th language segment, the cumulative sum of the recognition probabilities of all speech frames of the t-th language segment under the language category of the t-1-th language segment, and the sum of the time lengths of the t-1-th language segment and the t-th language segment.

[0056] Specifically, the first score Score t-1,t It can be calculated according to the following formula (1):

[0057]

[0058] In the formula, rec_score t-1 (num) represents the maximum recognition probability of the num-th speech frame in the t-1-th language segment; T t-1 Represents the total number of speech frames in the t-1th language segment; rec_score t-1,t (num) represents the recognition probability of the num-th speech frame of the t-th language segment according to the language category of the t-1-th language segment; T t represents the total number of speech frames in the t-th language segment; T t-1 +T t It represents the total number of speech frames in the merged t-1th language segment after the t-th language segment is merged into the t-1th language segment.

[0059] According to the above formula (1), the first term in the numerator represents the number of T in the t-1th language segment. t-1The cumulative sum of the maximum recognition probabilities of speech frames; the second term in the numerator represents the number of T in the t-th language segment t The cumulative sum of the recognition probabilities of the speech frames determined by the language category of the t-1th language segment. Dividing the numerator and the denominator, we can get the first score Score t-1,t .

[0060] For example, assuming that the language category corresponding to the t-1th language segment is Chinese, the cumulative sum of the maximum recognition probabilities of all speech frames in the t-1th language segment refers to the sum of the recognition probabilities of all speech frames in the t-1th language segment under the Chinese language. Furthermore, the cumulative sum of the recognition probabilities of all speech frames in the t-1th language segment under the language category of the t-1th language segment refers to the sum of the recognition probabilities of all speech frames in the t-1th language segment under the Chinese language.

[0061] Wherein, determining the second score for re-identifying the language category of the t-th language segment as the language category of the t+1-th language segment in step a1) includes: determining the second score based on the cumulative sum of the maximum recognition probabilities of all speech frames in the t-th language segment, the cumulative sum of the recognition probabilities of all speech frames in the t-th language segment under the language category of the t+1-th language segment, and the sum of the time lengths of the t+1-th language segment and the t-th language segment.

[0062] Specifically, the second score Score t,t+1 It can be calculated according to the following formula (2):

[0063]

[0064] In the formula, rec_score t+1 (num) represents the maximum recognition probability of the numth speech frame in the t+1th language segment; T t+1 Represents the total number of speech frames in the t+1th language segment; rec_score t,t+1 (num) represents the recognition probability of the numth speech frame of the tth language segment according to the language category of the t+1th language segment; T t represents the total number of speech frames in the t-th language segment; T t+1 +T t It represents the total number of speech frames in the merged t+1th language segment after the tth language segment is merged into the t+1th language segment.

[0065] For example, assuming that the language category corresponding to the t+1th language segment is Korean, the cumulative sum of the maximum recognition probabilities of all speech frames in the t+1th language segment refers to the sum of the recognition probabilities of all speech frames in the t+1th language segment in the Korean language. Furthermore, the cumulative sum of the recognition probabilities of all speech frames in the tth language segment under the language category of the t+1th language segment refers to the sum of the recognition probabilities of all speech frames in the tth language segment under the Korean language.

[0066] According to the above formula (2), the first term in the numerator represents the number of T in the t+1th language segment. t+1 The cumulative sum of the maximum recognition probabilities of speech frames; the second term in the numerator represents the number of T in the t-th language segment t The cumulative sum of the recognition probabilities of the speech frames determined by the language category of the t+1th language segment. Dividing the numerator and denominator, we can get the second score Score t,t+1 .

[0067] The first score can be understood as the probability that the true language category of the t-th language segment is the language category of the t-1-th language segment. The second score can be understood as the probability that the true language category of the t-th language segment is the language category of the t+1-th language segment.

[0068] a2) Based on the first score and the second score, the t-th language segment, the t-1-th language segment and the t+1-th language segment are merged.

[0069] Specifically, when the first score is greater than or equal to the second score, the t-th language segment and the t-1-th language segment are merged to obtain an updated t-1-th language segment. The language category of the updated t-1-th language segment is the language category corresponding to the t-1-th language segment.

[0070] When the first score is less than the second score, the t-th language segment and the t+1-th language segment are merged to obtain an updated t-th language segment, wherein the language category of the updated t-th language segment is the language category corresponding to the t+1-th language segment.

[0071] Among them, when the first score is greater than or equal to the second score, it indicates that the similarity between the language category of the t-th language segment and the t-1-th language segment is higher than the similarity between the language category of the t-th language segment and the t+1-th language segment. Therefore, it is more reasonable to classify the t-th language segment into the t-1-th language segment. Specifically, the t-th language segment and the t-1-th language segment are merged to obtain an updated t-1-th language segment. The time interval corresponding to the updated t-1-th language segment is from the start time corresponding to the t-1-th language segment to the end time corresponding to the t-th language segment. The language category of the merged t-1-th language segment is the same as that of the t-1-th language segment before the merger.

[0072] When the first score is less than the second score, it indicates that the similarity between the language category of the t-th language segment and the t+1-th language segment is higher than the similarity between the language category of the t-th language segment and the t-1-th language segment. Therefore, it is more reasonable to classify the t-th language segment into the t+1-th language segment. Specifically, the t-th language segment and the t+1-th language segment are merged to obtain an updated t-th language segment. The time interval corresponding to the t-th language segment after the update is from the start time corresponding to the t-th language segment to the end time corresponding to the t+1-th language segment. The language category of the merged t-th language segment is the same as that of the t+1-th language segment before the merge.

[0073] In some implementations, step S401 includes steps b1) to b2):

[0074] b1) when the time length of the t-th language segment among the multiple language segments of the intermediate language recognition result is less than a preset time length, the time length of the t-1-th language segment is greater than or equal to the preset time length, and the time length of the t+1-th language segment is less than the preset time length, determining a third score for re-identifying the language category of the t-1-th language segment as the language category of the t-1-th language segment, and a fourth score for re-identifying the language category of the t-th language segment as the language category of the t+1-th language segment.

[0075] In this embodiment, the time length of the t-1th language segment is greater than the preset time length, indicating that the language category of the t-1th language segment is relatively reasonable in terms of time length. However, the time lengths of the t-th language segment and the t+1th language segment are both less than the preset time length, indicating that the time lengths of the t-th language segment and the t+1th language segment are relatively short, and a new language category is usually not generated in such a short time. Therefore, it is necessary to determine the first score Score of the merged t-1th language segment under the language category of the t-1th language segment before the merger after the t-1th language segment is merged. t-1,t . And, after the t-th language segment is merged into the t+1-th language segment, the second score Score of the merged t+1-th language segment in each language category is determined. t,t+1 .

[0076] Wherein, determining the third score in step b1) includes: determining the third score based on the cumulative sum of the maximum probabilities of all speech frames in the t-1th language segment, the cumulative sum of the probabilities of all speech frames in the t-1th language segment under the language category of the t-1th language segment, and the sum of the time lengths of the t-1th language segment and the tth language segment.

[0077] The process of determining the third score is similar to the process of determining the first score. For details, please refer to the introduction of the embodiment of the process of determining the first score, which will not be repeated here.

[0078] Among them, determining the fourth score in step b1) includes: obtaining M language category probabilities based on the cumulative sum of the language probabilities of all speech frames in the language segment after the tth language segment and the t+1th language segment are merged under M language categories; and determining the fourth score based on the maximum language category probability among the M language category probabilities.

[0079] Specifically, the fourth score Rec_score t,t+1 It can be calculated according to the following formula (3):

[0080] Rec_score t,t+1 =max(P final )=max(P final_1 ,P final_1 ,...,P final_k ,P final_M ); (3)

[0081] In formula (3), P final Represents the average recognition probability of all speech frames in the merged language segment under M language categories.

[0082] Formula (3) indicates that the average value of the maximum recognition probability is selected from the average values ​​of the recognition probabilities of all speech frames in the merged language segments under M language categories as the fourth score. The process of selecting the average value of the maximum recognition probability from the average values ​​of the recognition probabilities of all speech frames in the merged language segments under M language categories can be expressed as the following formula (4):

[0083] Rec_class t,t+1 = argmax final_k (P final )=argmax final_k (P final_1 ,P final_2 ,...,P final_k ,...,P final_M ); (4)

[0084] Formula (4) indicates that the language category corresponding to the maximum recognition probability is selected from the set of average values ​​of recognition probabilities of all speech frames in the merged language segments under M language categories.

[0085] After the language category corresponding to the maximum recognition probability is screened, the fourth score can be determined. Specifically, P can be calculated using the following formula (4): final , and based on P final Determine the fourth score:

[0086]

[0087] 0≤P num_k ≤1, 1≤k≤M

[0088] In formula (5), P final represents the average recognition probability of all speech frames in the merged language segment under M language categories; P num_k represents the recognition probability of the numth speech frame in the merged language segment under the kth language category; P num Represents the set of recognition probabilities of the num-th speech frame in the merged language segment under M language categories.

[0089] The third score represents the probability that the true language category of the t-th language segment is the language category of the t-1th language segment. The fourth score can be understood as the maximum value of the average value of the recognition probabilities of the merged language segment obtained after merging the t-th language segment and the t+1-th language segment in each language category.

[0090] Still taking the three language categories of Chinese, English and Korean as an example, assuming that after the t+1th language segment and the tth language segment are merged, the recognition probability corresponding to Chinese is the largest among the recognition probabilities in Chinese, English and Korean, the fourth score is determined based on the recognition probability corresponding to Chinese.

[0091] b2) Based on the third score and the fourth score, the t-th language segment, the t-1-th language segment and the t+1-th language segment are merged.

[0092] Among them, when the third score is greater than or equal to the fourth score, it indicates that the similarity between the real language category of the t-th language segment and the language category of the t-1th language segment is higher than the similarity between the real language category of the t-th language segment and the language category of the t+1th language segment. Therefore, it is more reasonable to classify the t-th language segment into the t-1th language segment. Specifically, the t-th language segment and the t-1th language segment are merged to obtain an updated t-1th language segment. The time interval corresponding to the updated t-1th language segment is from the start time corresponding to the t-1th language segment to the end time corresponding to the t-1th language segment. The language category of the merged t-1th language segment is the language category of the t-1th language segment before the merger.

[0093] When the third score is less than the fourth score, it indicates that the similarity between the real language category of the t-th language segment and the language category of the t+1-th language segment is higher than the similarity between the real language category of the t-th language segment and the language category of the t-1-th language segment. Therefore, it is more reasonable to classify the t-th language segment into the t+1-th language segment. However, since the time lengths for which the t-th language segment is classified into the t+1-th language segment are respectively less than the preset time lengths, it is necessary to re-determine the recognition probabilities of the merged language segment under each language category, and determine the language category corresponding to the merged language segment based on the re-determined recognition probabilities under each language category.

[0094] Specifically, the t-th language segment and the t+1-th language segment are merged to obtain an updated t-th language segment. The time interval corresponding to the t-th language segment after the update is from the start time corresponding to the t-th language segment to the end time corresponding to the t+1-th language segment. The language category of the merged t-th language segment is the maximum recognition probability among the re-determined recognition probabilities under each language category.

[0095] In some embodiments, when it is determined that the time length of the t-th language segment is greater than or equal to the preset time length, the t-th language segment is not processed, that is, the language recognition result of the t-th language segment remains unchanged.

[0096] In some embodiments, the smooth merging operation further includes: when the time length of the t-th language segment in the multiple language segments of the intermediate language recognition result is less than a preset time length, the time length of the t-1-th language segment is less than a preset time length, and the time length of the t+1-th language segment is greater than or equal to the preset time length, M language category probabilities can also be obtained based on the cumulative sum of the language probabilities of all speech frames in the language segment after the t-th language segment and the t-1-th language segment are merged under M language categories; a fifth score is determined based on the maximum language category probability among the M language category probabilities; and a sixth score is determined based on the cumulative sum of the maximum probability of all speech frames in the t+1-th language segment, the cumulative sum of the probabilities of all speech frames of the t-th language segment under the language category of the t+1-th language segment, and the sum of the time lengths of the t+1-th language segment and the t-th language segment.

[0097] Furthermore, when the fifth score is greater than the sixth score, the t-th language segment and the t-1-th language segment are merged to obtain an updated t-1-th language segment, wherein the language category of the updated t-1-th language segment is the language category of the t-1-th language segment; when the fifth score is less than the sixth score, the t-th language segment and the t+1-th language segment are merged to obtain an updated t-th language segment, wherein the language category of the updated t-1-th language segment is the language category of the t+1-th language segment.

[0098] In some embodiments, after obtaining the t-1th language segment of the first update, it is also possible to determine whether to continue to merge the two based on the language recognition result of the t-1th language segment of the first update and the language recognition result of the t+1th language segment. Specifically, when the language recognition result of the t-1th language segment of the first update is the same as the language recognition result of the t+1th language segment, the t-1th language segment of the first update and the t+1th language segment are merged to obtain the t-1th language segment of the second update.

[0099] In some embodiments, after obtaining the updated t-th language segment, it is also possible to determine whether to continue to merge the two based on the language recognition result of the updated t-1th language segment and the language recognition result of the t+1th language segment. Specifically, when the language recognition result of the updated t-th language segment is the same as the language recognition result of the t-1th language segment, the updated t-th language segment and the t-1th language segment are merged to obtain the updated t-1th language segment.

[0100] Based on the above embodiment, the t-th language segment can be reasonably merged and classified. By looping through all language segments, the candidate language recognition result corresponding to the intermediate language recognition result can be obtained.

[0101] Furthermore, by performing the above-mentioned smooth merging operation on each intermediate language recognition result, Nbest candidate language recognition results corresponding to the Nbest intermediate language recognition results can be obtained.

[0102] S402: Determine the language recognition result corresponding to the speech data based on the obtained Nbest candidate language recognition results.

[0103] This embodiment performs a beam search on the initial language recognition results based on the frame-level language recognition results of the speech data, and performs a smooth merging operation on the cluster search results (Nbest intermediate language recognition results) to re-determine the Nbest candidate language recognition results of the speech data.

[0104] After determining the Nbest candidate language recognition results, it is necessary to screen out the most reasonable candidate language recognition result from the Nbest candidate language recognition results and determine it as the final language recognition result. Specifically, step S402 may include steps c1) to c3):

[0105] c1) for each language segment of the candidate language recognition result, determine the average value of the recognition probabilities of all speech frames of the language segment in the target language category to obtain the recognition probability of the language segment in the target language category.

[0106] The target language category is the language category of the language segment.

[0107] The recognition probability of the language segment in the target language category can be expressed as follows

[0108]

[0109] In formula (6), P num,cnt,ibest represents the recognition probability of the num-th speech frame in the cnt-th language segment in the ibest-th candidate language recognition result under the target language category; Sore cnt,ibest It can be obtained based on the average value of the recognition probabilities of all speech frames in the cnt-th language segment in the ibest-th candidate language recognition result under the target language category.

[0110] c2) obtaining a candidate score for the candidate language recognition result based on an average value of the language probabilities of all language segments of the candidate language recognition result under the target language category.

[0111] The candidate score can be determined using the following formula (7):

[0112]

[0113] In formula (7), Score ibest represents the candidate score corresponding to the ibest candidate language recognition result; N ibest Indicates the total number of language segments in the ibest candidate language recognition result; score cnt,ibest It represents the recognition probability of the cnt-th language segment in the ibest-th candidate language recognition result under the target language category.

[0114] c3) determining the candidate language recognition result corresponding to the maximum candidate score among the Nbest candidate scores as the language recognition result corresponding to the speech data.

[0115] The larger the candidate score, the more reasonable the corresponding candidate language recognition result. Therefore, the candidate language recognition result corresponding to the maximum candidate score among the Nbest candidate scores can be taken as the final language recognition result of the speech data.

[0116] The language recognition method of the embodiment of the present application performs language recognition on the speech data to be recognized, obtains the frame-level language recognition results corresponding to each speech frame of the speech data, and determines each language segment corresponding to the speech data based on the frame-level language recognition results corresponding to each speech frame, thereby obtaining the intermediate language recognition results corresponding to the speech data. Then, based on the frame-level language recognition results corresponding to each language segment in the intermediate language recognition results, each language segment is merged by a smooth merging operation, and the jittering short burr segments in each language segment are classified into the most reasonable adjacent language segments to obtain the Nbest intermediate language recognition results corresponding to the speech data. Finally, the Nbest intermediate language recognition results are re-scored, and the final language recognition results are screened out based on the re-scoring results. Since the smooth merging is based on the frame-level language recognition results, the final language recognition result can accurately provide the time interval information of the alternating appearance of each language category in the speech data, so that the effect of accurate language recognition for mixed language speech data can be achieved.

[0117] In some embodiments, a language recognition model may be used to perform language recognition on the speech data to be recognized, thereby obtaining an initial language recognition result corresponding to the speech data. Specifically, performing language recognition on the speech data to be recognized in step S201 to obtain an initial language recognition result corresponding to the speech data may include: performing language recognition on the speech data to be recognized by using a language recognition model to obtain an initial language recognition result corresponding to the speech data; wherein the training process of the language recognition model includes an adversarial training process, and the adversarial training aims to remove channel information from the speech features extracted by the feature extraction network of the language recognition model.

[0118] The following is an introduction to the training process of the language recognition model with reference to the accompanying figures:

[0119] Figure 5 A data flow diagram of the training process of the language recognition model provided in the embodiment of the present application. Figure 5 As shown, the above training process may include steps d1) to d3):

[0120] d1) extracting features from the acquired first speech sample through a feature extraction network to obtain first speech sample features, wherein the first speech sample corresponds to a real channel category.

[0121] Here, the first voice sample is used as a training sample, and its corresponding real channel category is used as a training label. The first voice sample includes multiple voice samples, and the multiple voice samples correspond to different real channel categories. In other words, the multiple voice samples come from different channel categories. Different channel categories include: telephone channel, satellite channel, video conference, etc.

[0122] The feature extraction network can be a CPC neural network, a wav2vec2.0 neural network, etc. Taking the CPC network as an example, the network uses a nonlinear coding layer (such as a 5-layer CNN+ReLU) to downsample and encode the first input speech sample to obtain a latent variable; then, an autoregressive model (a layer of GRU RNN) is used to encode the latent variables at historical moments to obtain context features, and a contrastive learning loss function (InfoNCE) is used to optimize the parameters of the CPC network.

[0123] The function of the feature extraction network is to extract speech representation information, namely speech features. The loss function of the feature extraction network is a contrastive learning loss function, which aims to better predict future information, such as language category, based on the first speech sample features extracted from the first speech sample.

[0124] d2) using a channel classification network to predict the channel category of the first speech sample feature to obtain a predicted channel category corresponding to the first language sample.

[0125] Continue reading Figure 5 , the channel classification network is used to classify the channel categories of the voice data. Therefore, after obtaining the first voice sample feature, the channel classification network can be used to predict the channel category classification based on the first voice sample feature, which will classify the channel source of the first voice sample. The gradient descent direction of the channel classification network is in the direction of making the channel classification correct.

[0126] d3) Based on the difference between the predicted channel category and the actual channel category, adversarial training is performed on the feature extraction network and the channel classification network to obtain a language recognition model. The adversarial training aims to make the predicted channel category different from the actual channel category.

[0127] In the cross-channel scenario, since the speech data comes from each channel, the contrastive learning loss function cannot remove the interference of channel interference on speech representation. Therefore, this embodiment uses the channel label information of the real channel category, as well as operations such as channel confrontation and domain adaptation to remove channel interference.

[0128] Among them, adversarial training can optimize the speech features extracted by the feature extraction network in the direction of resisting multi-channel interference. That is, as the adversarial training proceeds, the speech features extracted by the feature extraction network will pay less and less attention to the channel information, or even no longer pay attention to it, thereby removing the channel information and avoiding the influence of channel interference on language recognition. Specifically, step d3) may include steps d31)-step d34):

[0129] d31) Based on the difference between the predicted channel category and the actual channel category, the feature extraction network and the channel classification network are adversarially trained to obtain an adversarially trained feature extraction network.

[0130] like Figure 5 As shown, step d31) can be understood as the first stage of the training process, that is, the pre-training process, which aims to obtain a feature extraction network with anti-channel interference capability. Specifically, step d31) may include: determining the channel classification loss based on the difference between the predicted channel category and the actual channel category, the channel classification loss is used to train the channel classification network in the direction of a channel classification accuracy greater than a first preset channel classification accuracy; determining the comprehensive loss based on the target channel classification loss after gradient reversal of the channel classification loss, the target channel classification loss is used to train the channel classification accuracy of the channel classification based on the speech sample features extracted by the feature extraction network to be less than the second preset classification accuracy; converging the feature extraction network based on the comprehensive loss to obtain an adversarially trained feature extraction network.

[0131] In this embodiment, the channel classification loss DomainLoss acts on the channel classification network, aiming to classify the channel source of the voice data, and its gradient descent direction is in the direction of correctly classifying the channel category. In order to remove the channel information of the voice features extracted by the feature extraction network, the gradient of the channel classification loss can be reversed, so as to control the feature extraction network to proceed in the direction of incorrect channel classification, thereby forming adversarial training, so that the voice features finally extracted by the feature extraction network cannot distinguish the channel information.

[0132] Therefore, in some embodiments, the comprehensive loss may be determined based on the cumulative sum of the contrastive learning loss and the target channel classification loss. Specifically, the comprehensive loss may be expressed as the following formula:

[0133]

[0134] In formula (8), Loss represents the comprehensive loss; infoNCELoss represents the contrastive learning loss, which can be specifically referred to in the introduction of the related art and will not be introduced in detail here; DomainLoss(k) represents the channel classification loss corresponding to the kth speech data sample segment in the batch of speech sample segments (batch) after the first speech sample data is divided into speech sample segments.

[0135] in,

[0136] In formula (9), Represents the true channel category corresponding to the kth speech sample segment in a batch of speech sample segments; σ() is the softmax function; g1() is the channel category linear classification layer function; f() is the mapping function of the pre-trained network. N is the data size of a batch, which can also be understood as the total number of speech sample segments contained therein. Since the DomainLoss corresponding to g1() makes the channel classification network move in the correct direction of channel category judgment, this embodiment inverts the DomainLoss in the joint training, so that the speech features extracted by the feature extraction network are optimized as much as possible in the direction of being unable to distinguish the channel information, so that adversarial training can be formed. When the final model converges, the obtained speech representation can remove the channel information as much as possible to avoid the influence of channel interference on language recognition.

[0137] In some embodiments, in order to further reduce the impact of channel interference on language recognition, a comprehensive loss can also be determined based on the cumulative sum of contrastive learning loss, target channel classification loss and feature distribution loss; wherein the feature distribution loss is obtained based on the difference between the feature distribution of speech samples corresponding to each of multiple real channel categories and the feature distribution of comprehensive speech samples under multiple real channel categories. Specifically, the comprehensive loss can be expressed as the following formula:

[0138]

[0139] In formula (10), for the first and second terms on the right side of the equal sign, please refer to the introduction of the relevant content in the previous formula; AMMDLoss represents the feature distribution loss, which will make the speech sample features of speech sample data of different channels extracted by the feature extraction network tend to the same distribution, thereby reducing the impact of channel interference on language recognition. AMMDLoss can be calculated using the following formula:

[0140]

[0141] In formula (11), average_batch_l represents the distribution of speech sample features under the lth channel category in the batch of speech sample segments; N l Indicates the data size of the batch under the lth channel category.

[0142]

[0143] In formula (12), average_batch_all represents the mean of the feature distribution of the first speech sample data under L channel categories in the batch of speech sample segments batch; L represents the total number of channel categories.

[0144] Among them, step d31) can be understood as the first stage of the training process, that is, the pre-training process, which aims to obtain a feature extraction network with anti-channel interference capability. After obtaining the pre-trained feature extraction network, the pre-trained feature extraction network can also be subjected to the second stage of the training process, that is, language recognition training, so that it has accurate language recognition capability.

[0145] d32) Construct an initial language recognition model based on the feature extraction network of adversarial training.

[0146] Continue reading Figure 5 , step d32 may include: connecting the adversarial training feature extraction network with a bidirectional long short-term memory network (BILSTM), a deep neural network (DNN) and a language classification network in sequence.

[0147] Among them, the bidirectional long short-term memory network (BILSTM) is used to extract time series features based on the speech sample features extracted by the feature extraction network.

[0148] Deep neural network (DNN) is used to further perform feature extraction based on the temporal features extracted by bidirectional long short-term memory network (BILSTM).

[0149] The language classification network may be a linear classification layer, such as a softmax layer, which is used to predict the language category based on the speech sample features extracted by the DNN to obtain the predicted language category.

[0150] d33) Predicting the language category of the acquired second speech sample based on the initial language recognition model to obtain a predicted language category, and the second speech sample corresponds to a real language category.

[0151] In this embodiment, step d33) is to use the feature extraction network obtained by adversarial training to extract features from the second voice sample, and obtain the first voice sample features corresponding to the second voice sample, and then use the bidirectional long short-term memory network (BILSTM) to perform time series feature extraction on the first voice sample features to obtain the second voice sample features corresponding to the second voice sample, and further use DNN to perform deep feature extraction on the second voice sample features to obtain the third voice sample features corresponding to the second voice sample, and then use the language classification layer to predict the language classification based on the third voice sample features to obtain the predicted language category corresponding to the second voice sample.

[0152] d34) Based on the difference between the predicted language category and the true language category, a language recognition loss is determined, and the initial language recognition model is converged based on the language recognition loss to obtain a language recognition model.

[0153] The language recognition loss can be determined based on the cross entropy loss function CELoss and the difference between the predicted language category and the true language category. The language recognition loss can be expressed as the following formula (13):

[0154]

[0155] In formula (13), Loss class Indicates language recognition loss; Indicates the nth speech sample segment in the current batch, belonging to the i-th language category; express The corresponding real language category; σ() is the softmax function; g2() is the mapping function of the second-stage linear classification layer; f() is the mapping function of the pre-trained network; N2 is the data size of a batch.

[0156] In this embodiment, a back propagation algorithm can be used to fine-tune the feature extraction network based on the language recognition loss until the model converges to obtain a language recognition model. The condition for the model convergence can be that the language recognition loss is less than a preset loss value, or the number of iterations reaches a preset number of iterations, or the prediction accuracy of the model reaches a preset prediction accuracy, etc.

[0157] The embodiment of the present application adds a channel classification loss function during the training process of the language recognition model, and uses it to train the feature extraction network after performing gradient inversion, so that the parameter optimization direction of the feature extraction network is directed towards reducing channel information, thereby making the adversarially trained feature extraction network have the ability to resist channel interference, and can be well applied to mixed language recognition scenarios in cross-channel scenarios, thereby improving the accuracy of language recognition in mixed language recognition scenarios in cross-channel scenarios.

[0158] After obtaining the trained language recognition model, it can be applied to the mixed language recognition scenario to accurately recognize the mixed language. The following is an introduction to the mixed language recognition process with the accompanying figures:

[0159] Figure 6 A schematic diagram of the data flow of the mixed language recognition process provided in the embodiment of the present application. Figure 6 As shown, the mixed language recognition process includes the following seven steps:

[0160] (1) Feature extraction

[0161] In this embodiment, the speech data to be recognized is preprocessed and then input into the feature extraction network (also referred to as the target feature extraction network) trained in the above two stages for feature extraction, thereby obtaining the initial speech features.

[0162] (2) Temporal feature extraction

[0163] After obtaining the initial speech features output by the target feature extraction network, a bidirectional long short-term memory network (BILSTM) can be used to extract time series features based on the initial speech features to obtain the time series features corresponding to the speech data.

[0164] (3) Deep speech feature extraction

[0165] After obtaining the time series features corresponding to the speech data, in order to further improve the accuracy of language recognition, a deep neural network (DNN) can be used to extract deep speech features based on the time series features to obtain the target speech features. The speech information contained in the target speech features is richer than that in the initial speech features.

[0166] (4) Language classification

[0167] In this embodiment, the target speech features can be input into the language classification layer that has been trained in the second stage, so that the language classification layer can perform language classification based on the target speech features to obtain an initial language recognition result corresponding to the speech data. The initial language recognition result includes a frame-level language recognition result corresponding to each speech frame of the speech data.

[0168] (5) Beam Search

[0169] After obtaining the frame-level language recognition result, it is necessary to perform a beam search on it to form Nbest intermediate language recognition results, each of which includes various language segments in the speech data. The specific implementation process of the beam search can be found in the introduction of the above embodiment, which will not be repeated here.

[0170] (6) Smooth merging

[0171] Since the intermediate language recognition result may contain jittery burr segments, which affect the accuracy and rationality of the language recognition result, the present embodiment can also adopt a smooth merging operation, based on the frame-level language recognition result, to smoothly merge each language segment to obtain a candidate language recognition result, and the candidate language recognition result is more rational and accurate. The specific implementation process of the smooth merging operation can be referred to the introduction of the aforementioned embodiment, which will not be repeated here.

[0172] (7) Re-scoring

[0173] Since the Nbest intermediate language recognition results are smoothly merged respectively, the language segments in the intermediate language recognition results are changed. Therefore, it is necessary to re-score the Nbest candidate language recognition results after the smooth merger, and select the final language recognition result from the Nbest candidate language recognition results based on the re-scoring results.

[0174] Exemplary Devices

[0175] Corresponding to the above-mentioned language recognition method, the embodiment of the present application also provides a language recognition device. Figure 7 Schematic diagram of a language recognition device provided in an embodiment of the present application. Figure 7 As shown, the language recognition device provided by the embodiment of the present application includes: a language recognition unit 701, which is used to perform language recognition on the speech data to be recognized, and obtain an initial language recognition result corresponding to the speech data, and the initial language recognition result includes a frame-level language recognition result corresponding to each speech frame of the speech data; a determination unit 702, which is used to determine an intermediate language recognition result corresponding to the speech data based on the initial language recognition result, and the intermediate language recognition result includes each language segment in the speech data; a merging unit 703, which is used to merge each language segment based on the frame-level language recognition result corresponding to each language segment in the intermediate language recognition result, and obtain a language recognition result corresponding to the speech data.

[0176] Optionally, the determination unit 702 determines an intermediate language recognition result corresponding to the speech data based on the initial language recognition result, including: performing a beam search on the initial language recognition result to obtain Nbest intermediate language recognition results corresponding to the speech data, where Nbest is a positive integer greater than 1; the merging unit 703 merges the multiple language segments based on the frame-level language recognition result under the intermediate language recognition result to obtain a target language recognition result corresponding to the speech data, including: for each intermediate language recognition result in the Nbest intermediate language recognition results, merging the language segments based on the frame-level language recognition results corresponding to each language segment in the intermediate language recognition result to obtain a candidate language recognition result corresponding to the intermediate language recognition result; and determining the language recognition result corresponding to the speech data based on the obtained Nbest candidate language recognition results.

[0177] Optionally, the merging unit 703 merges the language segments based on the frame-level language recognition results corresponding to the language segments in the intermediate language recognition result to obtain a candidate language recognition result corresponding to the intermediate language recognition result, including: when the time length of the t-th language segment in the intermediate language recognition result is less than a preset time length, and the time lengths of the t-1-th language segment and the t+1-th language segment are both greater than the preset time length, determining a first score for re-identifying the language category of the t-1-th language segment as the language category of the t-1-th language segment, and determining a second score for re-identifying the language category of the t-th language segment as the language category of the t+1-th language segment, where t is a positive integer; and merging the t-th language segment, the t-1-th language segment, and the t+1-th language segment based on the first score and the second score.

[0178] Optionally, the frame-level language recognition result corresponding to each speech frame includes the recognition probability of the speech frame being recognized as each language category; the merging unit 703 determines a first score for re-recognizing the language category of the t-th language segment as the language category of the t-1th language segment, and determines a second score for re-recognizing the language category of the t-th language segment as the language category of the t+1th language segment, including: based on the cumulative sum of the maximum recognition probabilities of all speech frames in the t-1th language segment, the language category of the t-th language segment is re-recognized as the language category of the t+1th language segment. The first score is determined based on the cumulative sum of the recognition probabilities of all speech frames under the language category of the t-1th language segment and the sum of the time lengths of the t-1th language segment and the tth language segment; the second score is determined based on the cumulative sum of the maximum recognition probabilities of all speech frames in the tth language segment, the cumulative sum of the recognition probabilities of all speech frames in the tth language segment under the language category of the t+1th language segment, and the sum of the time lengths of the t+1th language segment and the tth language segment.

[0179] Optionally, the merging unit 703 merges the t-th language segment, the t-1-th language segment and the t+1-th language segment based on the first score and the second score, including: when the first score is greater than or equal to the second score, merging the t-th language segment and the t-1-th language segment to obtain an updated t-1-th language segment, and the language category of the updated t-1-th language segment is the language category corresponding to the t-1-th language segment; when the first score is less than the second score, merging the t-th language segment and the t+1-th language segment to obtain an updated t-th language segment, and the language category of the updated t-1-th language segment is the language category corresponding to the t+1-th language segment.

[0180] Optionally, the merging unit 703 merges the language segments based on the frame-level language recognition results corresponding to the language segments in the intermediate language recognition result to obtain a candidate language recognition result corresponding to the intermediate language recognition result, including: determining a third score for re-identifying the language category of the t-1 language segment as the language category of the t-1 language segment and a fourth score for re-identifying the language category of the t-1 language segment as the language category of the t+1 language segment when the time length of the t-1 language segment among the multiple language segments in the intermediate language recognition result is less than a preset time length, the time length of the t-1 language segment is greater than or equal to the preset time length, and the time length of the t+1 language segment is less than the preset time length; and merging the t-1 language segment, the t-1 language segment, and the t+1 language segment based on the third score and the fourth score.

[0181] Optionally, the frame-level language recognition result corresponding to each speech frame includes the probability of respectively recognizing the speech frame as a plurality of language categories; the merging unit 703 determines a third score for re-recognizing the language category of the t-th language segment as the language category of the t-1th language segment, and a fourth score for re-recognizing the language category of the t-th language segment as the language category of the t+1th language segment, including: based on the cumulative sum of the maximum probabilities of all speech frames in the t-1th language segment, the t-th language segment is re-recognized as the language category of the t+1th language segment. The third score is determined based on the cumulative sum of the probabilities of all speech frames in the t-1th language segment under the language category of the t-1th language segment and the sum of the time lengths of the t-1th language segment and the tth language segment; M language category probabilities are obtained based on the cumulative sum of the language probabilities of all speech frames in the language segment after the t-1th language segment and the t+1th language segment are combined under M language categories; and the fourth score is determined based on the maximum language category probability among the M language category probabilities.

[0182] Optionally, the merging unit 703 merges the t-th language segment, the t-1-th language segment and the t+1-th language segment based on the third score and the fourth score, including: when the third score is greater than or equal to the fourth score, merging the t-th language segment and the t-1-th language segment to obtain an updated t-1-th language segment, wherein the language category of the updated t-1-th language segment is the language category of the t-1-th language segment; when the third score is less than the fourth score, merging the t-th language segment and the t+1-th language segment to obtain an updated t-th language segment, wherein the language category of the updated t-1-th language segment is the language category of the t-1-th language segment.

[0183] Optionally, after obtaining the updated t-1th language segment, the merging unit 703 is further used to: when the language recognition result of the updated t-1th language segment is the same as the language recognition result of the t+1th language segment, merge the updated t-1th language segment and the t+1th language segment to obtain a second updated t-1th language segment; after obtaining the updated tth language segment, the merging unit 703 is further used to: when the language recognition result of the updated tth language segment is the same as the language recognition result of the t-1th language segment, merge the updated tth language segment and the t-1th language segment to obtain an updated t-1th language segment.

[0184] Optionally, the merging unit 703 determines the language recognition result corresponding to the speech data based on the obtained Nbest candidate language recognition results, including for each candidate language recognition result in the Nbest candidate language recognition results: for each language segment of the candidate language recognition result, determining the average value of the recognition probabilities of all speech frames of the language segment in the target language category, and obtaining the recognition probability of the language segment in the target language category, wherein the target language category is the language category of the language segment; obtaining a candidate score of the candidate language recognition result based on the average value of the language probabilities of all language segments of the candidate language recognition result in the target language category; and determining the candidate language recognition result corresponding to the maximum candidate score among the Nbest candidate scores as the language recognition result corresponding to the speech data.

[0185] Optionally, the language recognition unit 701 performs language recognition on the speech data to be recognized to obtain an initial language recognition result corresponding to the speech data, including: performing language recognition on the speech data to be recognized through a language recognition model to obtain an initial language recognition result corresponding to the speech data; wherein the training process of the language recognition model includes an adversarial training process, and the adversarial training aims to remove channel information in the speech features extracted by the feature extraction network of the language recognition model.

[0186] Optionally, the language recognition device also includes: a training unit 704, which extracts features from the acquired first speech sample through the feature extraction network of the language recognition model to obtain first speech sample features, and the first speech sample corresponds to a real channel category; uses a channel classification network to predict the channel category of the first speech sample features to obtain a predicted channel category corresponding to the first language sample; based on the difference between the predicted channel category and the real channel category, performs adversarial training on the feature extraction network and the channel classification network to obtain a language recognition model, wherein the adversarial training aims to make the predicted channel category different from the real channel category.

[0187] Optionally, the training unit 704 performs adversarial training on the feature extraction network and the channel classification network based on the difference between the predicted channel category and the real channel category to obtain a language recognition model, including: based on the difference between the predicted channel category and the real channel category, performing adversarial training on the feature extraction network and the channel classification network to obtain an adversarially trained feature extraction network; constructing an initial language recognition model based on the adversarially trained feature extraction network, and predicting the language category of the acquired second speech sample based on the initial language recognition model to obtain a predicted language category, wherein the second speech sample corresponds to a real language category; determining a language recognition loss based on the difference between the predicted language category and the real language category, and converging the initial language recognition model based on the language recognition loss to obtain the language recognition model.

[0188] Optionally, the training unit 704 performs adversarial training on the feature extraction network and the channel classification network based on the difference between the predicted channel category and the actual channel category to obtain an adversarially trained feature extraction network, including: determining a channel classification loss based on the difference between the predicted channel category and the actual channel category, the channel classification loss being used to train the channel classification network in a direction where the channel classification accuracy is greater than a first preset channel classification accuracy; determining a comprehensive loss based on a target channel classification loss after gradient reversal of the channel classification loss, the target channel classification loss being used to train the channel classification accuracy of channel classification based on speech sample features extracted by the feature extraction network in a direction where the channel classification accuracy is less than a second preset classification accuracy; and converging the feature extraction network based on the comprehensive loss to obtain an adversarially trained feature extraction network.

[0189] Optionally, the first speech sample includes multiple samples, and the training unit 704 determines the comprehensive loss based on the target channel classification loss after gradient reversal of the channel classification loss, including: determining the comprehensive loss based on the cumulative sum of the contrastive learning loss and the target channel classification loss, or determining the comprehensive loss based on the cumulative sum of the contrastive learning loss, the target channel classification loss and the feature distribution loss; the feature distribution loss is obtained based on the difference between the feature distribution of speech samples corresponding to each of multiple real channel categories and the feature distribution of the comprehensive speech samples under the multiple real channel categories.

[0190] The language recognition device provided in this embodiment belongs to the same application concept as the language recognition method provided in the above embodiments of this application, can execute the language recognition method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the language recognition method. For technical details not fully described in this embodiment, please refer to the specific processing content of the language recognition method provided in the above embodiments of this application, and will not be repeated here.

[0191] The functions implemented by the above language recognition unit 701, determination unit 702, merging unit 703 and training unit 704 may be implemented by the same or different processors respectively, which is not limited in the embodiment of the present application.

[0192] It should be understood that the units in the above devices can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the units in the device can be implemented in the form of hardware circuits, and the functions of some or all units can be realized by designing the hardware circuits. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD, taking FPGA as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by the configuration file, so as to realize the functions of some or all of the above units. All units of the above devices can be implemented in the form of a processor calling software, or in the form of hardware circuits, or in part by a processor calling software, and the remaining part is implemented in the form of hardware circuits.

[0193] In an embodiment of the present application, a processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.

[0194] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.

[0195] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.

[0196] Exemplary Electronic Devices

[0197] The present application embodiment provides an electronic device, see Figure 8 As shown, the electronic device includes: a memory 200 and a processor 210; wherein the memory 200 is connected to the processor 210 and is used to store programs; the processor 210 is used to implement the language recognition method disclosed in any of the above embodiments by running the program stored in the memory 200.

[0198] Specifically, the electronic device may further include: a bus, a communication interface 220 , an input device 230 and an output device 240 .

[0199] The processor 210, the memory 200, the communication interface 220, the input device 230 and the output device 240 are connected to each other via a bus.

[0200] A bus may include a pathway that transfers information between components of a computer system.

[0201] The processor 210 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0202] The processor 210 may include a main processor, and may also include a baseband chip, a modem, and the like.

[0203] The memory 200 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 200 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.

[0204] The input device 230 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.

[0205] Output device 240 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.

[0206] The communication interface 220 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.

[0207] The processor 210 executes the program stored in the memory 200 and calls other devices, which can be used to implement each step of any language recognition method provided in the above embodiments of the present application.

[0208] An embodiment of the present application also proposes a chip, which includes a processor and a data interface. The processor reads and runs a program stored in a memory through the data interface to execute the language recognition method introduced in any of the above embodiments. The specific processing process and its beneficial effects can be found in the introduction to the embodiment of the above language recognition method.

[0209] Exemplary computer program products and storage media

[0210] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, and when the computer program instructions are executed by a processor, the processor executes the steps of the language recognition method according to various embodiments of the present application described in any of the above embodiments of this specification.

[0211] The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0212] In addition, the embodiment of the present application may also be a storage medium on which a computer program is stored. The computer program is executed by a processor to execute the steps of the language recognition method according to various embodiments of the present application described in any of the above embodiments of this specification, and specifically the following steps may be implemented:

[0213] Step S201: perform language recognition on the speech data to be recognized to obtain an initial language recognition result corresponding to the speech data, wherein the initial language recognition result includes a frame-level language recognition result corresponding to each speech frame of the speech data.

[0214] Step S202: Determine an intermediate language recognition result corresponding to the speech data based on the initial language recognition result, wherein the intermediate language recognition result includes each language segment in the speech data.

[0215] Step S203: Based on the frame-level language recognition results corresponding to the language segments in the intermediate language recognition results, the language segments are merged to obtain the language recognition results corresponding to the speech data.

[0216] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0217] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0218] The steps in the methods of each embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.

[0219] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be combined, divided and deleted according to actual needs.

[0220] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0221] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0222] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.

[0223] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0224] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0225] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0226] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A language identification method, It is characterized in that include: Performing language recognition on the speech data to be recognized to obtain an initial language recognition result corresponding to the speech data, wherein the initial language recognition result includes a frame-level language recognition result corresponding to each speech frame of the speech data; Based on the initial language recognition result, determining an intermediate language recognition result corresponding to the speech data, the intermediate language recognition result including each language segment in the speech data; Based on the frame-level language recognition results corresponding to the respective language segments in the intermediate language recognition result, the respective language segments are merged to obtain the language recognition result corresponding to the speech data.

2. The method according to claim 1, It is characterized in that The determining, based on the initial language recognition result, an intermediate language recognition result corresponding to the speech data includes: Performing a beam search on the initial language recognition result to obtain Nbest intermediate language recognition results corresponding to the speech data, where Nbest is a positive integer greater than 1; The step of merging the language segments based on the frame-level language recognition results corresponding to the language segments in the intermediate language recognition results to obtain the language recognition results corresponding to the speech data includes: For each of the Nbest intermediate language recognition results, based on the frame-level language recognition results corresponding to each language segment in the intermediate language recognition result, each language segment is merged to obtain a candidate language recognition result corresponding to the intermediate language recognition result; Based on the obtained Nbest candidate language recognition results, a language recognition result corresponding to the speech data is determined.

3. The method according to claim 2, It is characterized in that Based on the frame-level language recognition results corresponding to the language segments in the intermediate language recognition result, the language segments are merged to obtain a candidate language recognition result corresponding to the intermediate language recognition result, including: When the time length of the t-th language segment in the intermediate language recognition result is less than the preset time length, and the time lengths of the t-1-th language segment and the t+1-th language segment are both greater than the preset time length, determining a first score for re-identifying the language category of the t-1-th language segment as the language category of the t-1-th language segment, and determining a second score for re-identifying the language category of the t-th language segment as the language category of the t+1-th language segment, where t is a positive integer; Based on the first score and the second score, the t-th language segment, the t-1-th language segment and the t+1-th language segment are merged.

4. The method according to claim 3, It is characterized in that The frame-level language recognition result corresponding to each speech frame includes the recognition probability of the speech frame being recognized as each language category; The step of determining a first score for re-identifying the language category of the t-th language segment as the language category of the t-1th language segment, and determining a second score for re-identifying the language category of the t-th language segment as the language category of the t+1th language segment, comprises: Determine the first score based on the cumulative sum of the maximum recognition probabilities of all speech frames in the t-1th language segment, the cumulative sum of the recognition probabilities of all speech frames in the t-1th language segment under the language category of the t-1th language segment, and the sum of the time lengths of the t-1th language segment and the t-1th language segment; The second score is determined based on the cumulative sum of the maximum recognition probabilities of all speech frames in the t-th language segment, the cumulative sum of the recognition probabilities of all speech frames in the t-th language segment under the language category of the t+1-th language segment, and the sum of the time lengths of the t+1-th language segment and the t-th language segment.

5. The method according to claim 3, It is characterized in that The merging of the t-th language segment, the t-1-th language segment and the t+1-th language segment based on the first score and the second score includes: When the first score is greater than or equal to the second score, merging the t-th language segment and the t-1-th language segment to obtain an updated t-1-th language segment, the language category of the updated t-1-th language segment being the language category corresponding to the t-1-th language segment; When the first score is less than the second score, the t-th language segment and the t+1-th language segment are merged to obtain an updated t-th language segment, and the language category of the updated t-th language segment is the language category corresponding to the t+1-th language segment.

6. The method according to claim 2, It is characterized in that Based on the frame-level language recognition results corresponding to the language segments in the intermediate language recognition result, the language segments are merged to obtain a candidate language recognition result corresponding to the intermediate language recognition result, including: In the case where the time length of the t-th language segment among the multiple language segments in the intermediate language recognition result is less than a preset time length, the time length of the t-1-th language segment is greater than or equal to the preset time length, and the time length of the t+1-th language segment is less than the preset time length, determining a third score for re-identifying the language category of the t-1-th language segment as the language category of the t-1-th language segment, and a fourth score for re-identifying the language category of the t-th language segment as the language category of the t+1-th language segment; Based on the third score and the fourth score, the t-th language segment, the t-1-th language segment and the t+1-th language segment are merged.

7. The method according to claim 6, It is characterized in that The frame-level language recognition result corresponding to each speech frame includes the probability of recognizing the speech frame as a plurality of language categories; The determining of the third score for re-identifying the language category of the t-th language segment as the language category of the t-1th language segment and the fourth score for re-identifying the language category of the t-th language segment as the language category of the t+1th language segment comprises: Determine the third score based on the cumulative sum of the maximum probabilities of all speech frames in the t-1th language segment, the cumulative sum of the probabilities of all speech frames in the t-1th language segment under the language category of the t-1th language segment, and the sum of the time lengths of the t-1th language segment and the t-1th language segment; Obtaining M language category probabilities based on the cumulative sum of the language probabilities of all speech frames in the language segment after the t-th language segment and the t+1-th language segment are combined under M language categories; The fourth score is determined based on the maximum language category probability among the M language category probabilities.

8. The method according to claim 6, It is characterized in that The merging of the t-th language segment, the t-1-th language segment and the t+1-th language segment based on the third score and the fourth score includes: When the third score is greater than or equal to the fourth score, merging the t-th language segment and the t-1-th language segment to obtain an updated t-1-th language segment, wherein the language category of the updated t-1-th language segment is the language category of the t-1-th language segment; When the third score is less than the fourth score, the t-th language segment and the t+1-th language segment are merged to obtain an updated t-th language segment, and the language category of the updated t-th language segment is the language category of the t+1-th language segment.

9. The method according to claim 5 or 8, It is characterized in that After obtaining the updated t-1th language segment, the method further includes: When the language recognition result of the first updated t-1th language segment is the same as the language recognition result of the t+1th language segment, merging the first updated t-1th language segment and the t+1th language segment to obtain a second updated t-1th language segment; After obtaining the updated t-th language segment, the method further includes: When the language recognition result of the updated t-th language segment is the same as the language recognition result of the t-1-th language segment, the updated t-th language segment and the t-1-th language segment are merged to obtain an updated t-1-th language segment.

10. The method according to claim 2, It is characterized in that The determining of the language recognition result corresponding to the speech data based on the obtained Nbest candidate language recognition results includes: for each candidate language recognition result in the Nbest candidate language recognition results: For each language segment of the candidate language recognition result, determine the average value of the recognition probabilities of all speech frames of the language segment in the target language category to obtain the recognition probability of the language segment in the target language category, where the target language category is the language category of the language segment; Obtaining a candidate score for the candidate language recognition result based on an average value of the language probabilities of all language segments of the candidate language recognition result in the target language category; The candidate language recognition result corresponding to the maximum candidate score among the Nbest candidate scores is determined as the language recognition result corresponding to the speech data.

11. The method according to claim 1, It is characterized in that Performing language recognition on the speech data to be recognized to obtain an initial language recognition result corresponding to the speech data includes: Performing language recognition on the speech data to be recognized by using a language recognition model to obtain an initial language recognition result corresponding to the speech data; The training process of the language recognition model includes an adversarial training process, wherein the adversarial training aims to remove channel information from speech features extracted by a feature extraction network of the language recognition model.

12. The method according to claim 11, It is characterized in that The training process of the language recognition model includes: Extracting features from the acquired first speech sample through the feature extraction network of the language recognition model to obtain first speech sample features, wherein the first speech sample corresponds to a real channel category; Using a channel classification network to predict the channel category of the first speech sample feature to obtain a predicted channel category corresponding to the first language sample; Based on the difference between the predicted channel category and the real channel category, adversarial training is performed on the feature extraction network and the channel classification network to obtain a language recognition model, wherein the adversarial training aims to make the predicted channel category different from the real channel category.

13. The method according to claim 12, It is characterized in that The method of performing adversarial training on the feature extraction network and the channel classification network based on the difference between the predicted channel category and the real channel category to obtain a language recognition model includes: Based on the difference between the predicted channel category and the real channel category, performing adversarial training on the feature extraction network and the channel classification network to obtain an adversarially trained feature extraction network; Building an initial language recognition model based on the feature extraction network of adversarial training, and performing language category prediction on the acquired second speech sample based on the initial language recognition model to obtain a predicted language category, wherein the second speech sample corresponds to a real language category; Based on the difference between the predicted language category and the actual language category, a language recognition loss is determined, and based on the language recognition loss, the initial language recognition model is converged to obtain the language recognition model.

14. The method according to claim 13, It is characterized in that The method of performing adversarial training on the feature extraction network and the channel classification network based on the difference between the predicted channel category and the real channel category to obtain the adversarially trained feature extraction network includes: Determining a channel classification loss based on a difference between the predicted channel category and the actual channel category, wherein the channel classification loss is used to train the channel classification network in a direction in which the channel classification accuracy is greater than a first preset channel classification accuracy; Determine a comprehensive loss based on a target channel classification loss after gradient inversion of the channel classification loss, wherein the target channel classification loss is used to train in a direction in which a channel classification accuracy of channel classification based on speech sample features extracted by the feature extraction network is less than a second preset classification accuracy; The feature extraction network is converged based on the comprehensive loss to obtain an adversarially trained feature extraction network.

15. The method according to claim 14, It is characterized in that The first speech samples include a plurality of samples, and determining a comprehensive loss based on a target channel classification loss after gradient inversion of the channel classification loss includes: Determine the comprehensive loss based on the cumulative sum of the contrastive learning loss and the target channel classification loss, or determine the comprehensive loss based on the cumulative sum of the contrastive learning loss, the target channel classification loss and the feature distribution loss; The feature distribution loss is obtained based on the difference between the feature distribution of speech samples corresponding to each of a plurality of real channel categories and the feature distribution of comprehensive speech samples under the plurality of real channel categories.

16. A language recognition device, It is characterized in that include: A language recognition unit, used to perform language recognition on the speech data to be recognized, and obtain an initial language recognition result corresponding to the speech data, wherein the initial language recognition result includes a frame-level language recognition result corresponding to each speech frame of the speech data; A determination unit, configured to determine an intermediate language recognition result corresponding to the speech data based on the initial language recognition result, wherein the intermediate language recognition result includes each language segment in the speech data; The merging unit is used to merge the language segments in the intermediate language recognition result based on the frame-level language recognition results corresponding to the language segments, so as to obtain the language recognition result corresponding to the speech data.

17. An electronic device, It is characterized in that including memory and processor; The memory is connected to the processor and is used to store programs; The processor is configured to implement the method according to any one of claims 1 to 15 by running the program in the memory.

18. A storage medium, It is characterized in that The storage medium stores a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 15 is implemented.

19. A computer program product, It is characterized in that The method comprises computer program instructions, which, when executed by a processor, cause the processor to perform: the method according to any one of claims 1 to 15.

Citation Information

Cited By

  • Streaming audio language identification method and system

    CN119811383A

  • Speech recognition method and device, electronic equipment and storage medium

    CN121393448A