Audio recognition method and apparatus, readable medium, and electronic device

By using sample datasets and multiple loss functions to generate a target audio recognition model in an end-to-end speech recognition model, the problem of repeated decoding is solved, recognition accuracy is improved, and the reading experience is enhanced.

CN116110377BActive Publication Date: 2026-06-05BEIJING YOUZHUJU NETWORK TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING YOUZHUJU NETWORK TECH CO LTD
Filing Date
2023-03-02
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

End-to-end speech recognition models suffer from repeated decoding issues, leading to insufficient recognition accuracy and impacting the reading experience.

Method used

A target audio recognition model is generated using a sample dataset, a first loss function, and a second loss function. By dividing the sample audio into first sample audio and second sample audio, and constraining their text prediction accuracy respectively, the probability of repeated decoding is reduced.

Benefits of technology

It improves the accuracy of audio recognition, reduces repeated decoding, and enhances the recognition effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116110377B_ABST
    Figure CN116110377B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to an audio recognition method and device, readable medium and electronic equipment. The method comprises: obtaining a target audio to be recognized; inputting the target audio into a pre-generated target audio recognition model to obtain a target text output by the target audio recognition model. The target audio recognition model can be a model pre-generated according to a sample data set, a first loss function and a second loss function. The sample data set can include a plurality of target sample audios and a target sample text corresponding to each target sample audio. The target sample audio can include a first sample audio and a second sample audio. The first loss function can be used to determine the text prediction accuracy of the first sample audio. The second loss function can be used to determine the text prediction accuracy of the second sample audio.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to an audio recognition method, apparatus, readable medium, and electronic device. Background Technology

[0002] With the advancement of computer technology, Automatic Speech Recognition (ASR) technology is being applied in an increasing number of scenarios. ASR can convert audio into text and has been widely used in intelligent customer service systems, smartphone assistants, automatic video captioning, automatic speech-to-text conversion in instant messaging software, and online voice interaction. Traditional speech recognition models divide speech recognition into multiple sub-tasks, such as using acoustic models and language models to recognize speech. This results in complex model structures and relatively low efficiency in both training and application. End-to-end speech recognition models, on the other hand, can use end-to-end neural networks, which reduces the model structure while significantly improving the efficiency of speech recognition. However, the recognition accuracy of end-to-end speech recognition models still needs improvement. Summary of the Invention

[0003] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] According to a first aspect of the present disclosure, an audio recognition method is provided, the method comprising:

[0005] Obtain the target audio to be identified;

[0006] The target audio is input into a pre-generated target audio recognition model to obtain the target text output by the target audio recognition model;

[0007] The target audio recognition model is a model pre-generated based on a sample dataset, a first loss function, and a second loss function. The sample dataset includes multiple target sample audios and target sample text corresponding to each target sample audio. The target sample audios include a first sample audio and a second sample audio. The first loss function is used to determine the text prediction accuracy of the first sample audio, and the second loss function is used to determine the text prediction accuracy of the second sample audio.

[0008] According to a second aspect of the present disclosure, an audio recognition device is provided, the device comprising:

[0009] The audio acquisition module is used to acquire the target audio to be identified.

[0010] The audio recognition module is used to input the target audio into a pre-generated target audio recognition model to obtain the target text output by the target audio recognition model;

[0011] The target audio recognition model is a model pre-generated based on a sample dataset, a first loss function, and a second loss function. The sample dataset includes multiple target sample audios and target sample text corresponding to each target sample audio. The target sample audios include a first sample audio and a second sample audio. The first loss function is used to determine the text prediction accuracy of the first sample audio, and the second loss function is used to determine the text prediction accuracy of the second sample audio.

[0012] According to a third aspect of the present disclosure, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect of the present disclosure.

[0013] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising:

[0014] A storage device on which computer programs are stored;

[0015] A processing device for executing the computer program in the storage device to implement the steps of the method described in the first aspect of this disclosure.

[0016] Using the above technical solution, the target audio to be identified is obtained; the target audio is then input into a pre-generated target audio recognition model to obtain the target text output by the model. The target audio recognition model can be a pre-generated model based on a sample dataset, a first loss function, and a second loss function. The sample dataset can include multiple target sample audios and the target sample text corresponding to each target sample audio. The target sample audios can include first sample audios and second sample audios. The first loss function is used to determine the text prediction accuracy of the first sample audios, and the second loss function is used to determine the text prediction accuracy of the second sample audios. In this way, the target sample audios are divided into first sample audios and second sample audios, and the first and second loss functions can respectively constrain the text prediction accuracy of the first and second sample audios. This allows the generated target audio recognition model to accurately identify the first and second sample audios in the target sample audio dataset, reducing the probability of repeated decoding and improving audio recognition accuracy.

[0017] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0018] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings:

[0019] Figure 1 This is a flowchart illustrating an audio recognition method according to an exemplary embodiment.

[0020] Figure 2 This is a flowchart illustrating a method for generating a target audio recognition model according to an exemplary embodiment.

[0021] Figure 3 This is a block diagram illustrating an audio recognition device according to an exemplary embodiment.

[0022] Figure 4 This is a block diagram illustrating another audio recognition device according to an exemplary embodiment.

[0023] Figure 5 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0024] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0025] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0026] The term "comprising" and its variations as used in this disclosure are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the description below.

[0027] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0028] It should be noted that the terms "one" and "multiple" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that they should be understood as "one or more" unless explicitly stated in the context. In the description of this disclosure, unless otherwise stated, "multiple" means two or more, and other quantifiers are similar; "at least one," "one or more," or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one 'a' can represent any number of 'a's; as another example, one or more of a, b, and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple; "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. The character " / " indicates that the objects before and after it are in an "or" relationship. The singular forms "a," "a kind," "an item," "the," and "the" are also intended to include the plural forms unless the context clearly indicates otherwise.

[0029] Although operations or steps are described in a specific order in the accompanying drawings in the embodiments of this disclosure, it should not be construed as requiring these operations or steps to be performed in the specific order or serial order shown, or requiring all of the shown operations or steps to be performed to obtain the desired result. In the embodiments of this disclosure, these operations or steps may be performed serially; they may be performed in parallel; or a portion of these operations or steps may be performed.

[0030] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0031] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0032] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0033] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0034] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0035] Meanwhile, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0036] First, the application scenarios of this disclosure are explained. This disclosure can be applied to speech recognition scenarios, especially those using end-to-end speech recognition models. In related technologies, end-to-end speech recognition models suffer from the problem of repeated decoding. For example, the actual audio content may be "ABCD", but the text content recognized by the model may be "ABCDBCDBCDBCD", where "BCD" is repeated content. Repeated decoding can cause insertion errors and affect the reading experience.

[0037] To address the aforementioned problems, this disclosure provides an audio recognition method that pre-generates a target audio recognition model based on a sample dataset, a first loss function, and a second loss function. The sample dataset includes multiple target sample audios and target sample text corresponding to each target sample audio. The target sample audios include first sample audios and second sample audios. The first loss function is used to determine the text prediction accuracy of the first sample audios, and the second loss function is used to determine the text prediction accuracy of the second sample audios.

[0038] The present disclosure will now be described in conjunction with specific embodiments.

[0039] Figure 1This is a flowchart illustrating an audio recognition method according to an exemplary embodiment. The method can be applied to electronic devices, which may include terminal devices such as smartphones, smart wearable devices, smart speakers, smart tablets, PDAs (Personal Digital Assistants), CPEs (Customer Premise Equipment), personal computers, in-vehicle terminals, etc.; the electronic device may also include a server, such as a local server or a cloud server. Figure 1 As shown, the method may include:

[0040] S101. Obtain the target audio to be identified.

[0041] S102. Input the target audio into the pre-generated target audio recognition model to obtain the target text output by the target audio recognition model.

[0042] The target audio recognition model can be a model pre-generated based on a sample dataset, a first loss function, and a second loss function. The sample dataset can include multiple target sample audios and target sample text corresponding to each target sample audio. The target sample audios can include first sample audios and second sample audios. The first loss function can be used to determine the text prediction accuracy of the first sample audios, and the second loss function can be used to determine the text prediction accuracy of the second sample audios.

[0043] In some embodiments, the first sample audio can be manually acquired raw audio, which may include human speech (e.g., Chinese, English, or other languages), and the second sample audio can be filler audio. For example, the raw audio and filler audio can be combined to form the target sample audio. The filler audio can be after or before the raw audio.

[0044] In one implementation, the first sample audio can also be a mixture of human and non-human speech, for example, human speech and background noise (such as the sound of flowing water, vehicle sounds, etc.).

[0045] In one implementation, the second sample audio can be a pre-formatted filler audio, for example, the second sample audio can be an audio terminator; the second sample audio can also be specific background noise.

[0046] In some embodiments, the target sample text corresponding to the target sample audio may also include the first sample text corresponding to the first sample audio and the second sample text corresponding to the second sample audio. For example, if the first sample audio includes human speech, the first sample text may be the text corresponding to the human speech; if the second sample audio is an audio terminator, the second sample text may be a text terminator corresponding to the audio terminator, which can be used to indicate the end of the audio.

[0047] It should be noted that the aforementioned target audio recognition model can be an end-to-end audio recognition model, or other types of audio recognition models in related technologies, and this disclosure does not limit it. In some embodiments, the target audio recognition model may include any one or more of CTC (Connectionist Temporal Classification), RNN-T (Recurrent Neural Network-Transducer), Transformer, and Conformer.

[0048] Using the above method, the target audio to be identified is obtained; this target audio is then input into a pre-generated target audio recognition model to obtain the target text output by the model. The target audio recognition model can be a pre-generated model based on a sample dataset, a first loss function, and a second loss function. The sample dataset can include multiple target sample audios and the target sample text corresponding to each. The target sample audios can include first sample audios and second sample audios. The first loss function is used to determine the text prediction accuracy of the first sample audios, and the second loss function is used to determine the text prediction accuracy of the second sample audios. In this way, the target sample audios are divided into first sample audios and second sample audios, and the first and second loss functions can respectively constrain the text prediction accuracy of the first and second sample audios. This allows the generated target audio recognition model to accurately identify the first and second sample audios, reducing the probability of repeated decoding and improving audio recognition accuracy.

[0049] Figure 2 This is a flowchart illustrating a method for generating a target audio recognition model according to an exemplary embodiment. Figure 2 As shown, the method may include:

[0050] S201. Obtain the sample dataset.

[0051] The sample dataset may include multiple target sample audios and target sample text corresponding to each target sample audio. The target sample audios may include first sample audio and second sample audio.

[0052] In this step, the sample dataset can be obtained in the following ways:

[0053] First, obtain multiple undetermined sample audios and the corresponding undetermined sample text for each undetermined sample audio.

[0054] The audio sample to be determined can be audio including human speech, or audio including both human and non-human speech. The text sample to be determined can be text obtained by manually tagging the audio sample. The text sample to be determined has the same semantics as the audio sample.

[0055] In some embodiments, the audio sample to be determined may include Chinese speech, English speech, or speech in other languages, wherein the Chinese speech may be Mandarin or a dialect.

[0056] Secondly, the target length is determined based on the audio lengths of multiple undetermined sample audios.

[0057] In some embodiments, the audio length of each undetermined sample audio can be obtained, and the maximum value among multiple audio lengths can be used as the target length.

[0058] In other embodiments, a preset length can be used as the target length, which can be any length set based on empirical values. In one implementation, audio samples of the unknown length that are longer than the preset length can be truncated to the preset length.

[0059] In other embodiments, there can be multiple target lengths. For example, N target lengths can be pre-defined in ascending order, where N can be any positive integer greater than or equal to 1. For instance, the N target lengths could include a first target length (e.g., 1 second or 2 seconds), a second target length (e.g., 4 seconds or 8 seconds), a third target length, ..., the Nth target length. Based on the target lengths and the audio length of each undetermined sample audio, the undetermined sample audio can be categorized into N undetermined sample sets. Each undetermined sample set corresponds to a target length, and the audio lengths of the undetermined sample audio in each undetermined sample set are all less than or equal to the target length corresponding to that undetermined sample set. For example, undetermined sample audio with an audio length less than or equal to the first target length can be included in the first undetermined sample set; undetermined audio with an audio length greater than the first target length and less than or equal to the second target length can be included in the second undetermined sample set; undetermined audio with an audio length greater than the second target length and less than or equal to the third target length can be included in the third undetermined sample set, and so on.

[0060] In one implementation, the aforementioned N target lengths may include any one or more of 2 seconds, 4 seconds, 8 seconds, 16 seconds, 32 seconds, 64 seconds, 128 seconds, and 256 seconds, and N may be any value from 1 to 8.

[0061] Next, for each undetermined sample audio, if the audio length of the undetermined sample audio is less than the target length, determine the fill sample audio to fill the undetermined sample audio.

[0062] For example, the length of the filler sample audio can be the difference between the target length and the audio length of the audio to be determined, and the filler sample audio can consist entirely of audio terminators or non-human speech.

[0063] Finally, the undetermined sample audio is used as the first sample audio, and the filled sample audio is used as the second sample audio, thus obtaining the sample dataset.

[0064] In some embodiments, the target sample text can also be obtained based on the target sample text corresponding to each target sample audio and the padding sample audio. For example, the target sample text can be the padding text ending with the target sample text, and the length of the target sample text is the same as the length of the target sample audio.

[0065] In some embodiments, the sample dataset may include multiple sets of undetermined samples, each set of undetermined samples having a different target length. For example, the N sets of undetermined samples determined based on the N target lengths may be used as the sample dataset.

[0066] S202. Based on the sample dataset, the first loss function, and the second loss function, train the audio recognition model to be determined to obtain the target audio recognition model.

[0067] For example, the model training steps can be executed repeatedly until the trained undetermined audio recognition model meets the preset stopping iteration condition, and the trained undetermined audio recognition model is used as the target audio recognition model.

[0068] The model training steps may include:

[0069] S1. Input the target sample audio from the sample dataset into the audio recognition model to obtain the predicted text output by the audio recognition model.

[0070] S2. Determine the audio mask of the target sample audio based on the relative positions of the first and second sample audios in the target sample audio.

[0071] For example, this audio mask can be used to distinguish between the first sample audio and the second sample audio.

[0072] In some embodiments, the audio mask can be in matrix form, wherein the value of the matrix position corresponding to the first sample audio is 1, and the value of the matrix position corresponding to the second sample audio is 0.

[0073] In some embodiments, the first sample audio is the original audio, and the second sample audio is the filler audio. The original audio and the filler audio can be distinguished by this audio mask.

[0074] S3. Determine the target loss value based on the audio mask, predicted text, first loss function, and second loss function.

[0075] The target loss value is used to characterize the difference between the predicted text and the target sample text.

[0076] In some embodiments, a first loss value corresponding to a first sample audio of the target sample audio can be determined based on an audio mask, predicted text, and a first loss function; a second loss value corresponding to a second sample audio of the target sample audio can be determined based on an audio mask, predicted text, and a second loss function; and a target loss value can be determined based on the first loss value and the second loss value.

[0077] The first loss value can be used to characterize the text prediction accuracy of the first sample audio, and the second loss value can be used to characterize the text prediction accuracy of the second sample audio.

[0078] In one implementation, the first loss value can be calculated using the following formula (1):

[0079] ce_loss = ce(y,y') * target_weights (1)

[0080] Where ce_loss represents the first loss value, y represents the target sample text corresponding to the target sample audio, y' represents the predicted text corresponding to the target sample audio, ce represents the cross-entropy loss function, and target_weights represents the audio mask.

[0081] In one implementation, the second loss value can be calculated using the following formula (2):

[0082] padding_loss = ce(y,y') * (1-target_weights) (2)

[0083] Where padding_loss represents the second loss value, y represents the target sample text corresponding to the target sample audio, y' represents the predicted text corresponding to the target sample audio, ce represents the cross-entropy loss function, and target_weights represents the audio mask.

[0084] In some embodiments, formula (1) above can be used as the first loss function and formula (2) above can be used as the second loss function.

[0085] Furthermore, the first weight corresponding to the first loss value and the second weight corresponding to the second loss value can be determined; and the target loss value can be calculated based on the first loss value, the first weight, the second loss value and the second weight.

[0086] The first weight and the second weight can both be any pre-set weight values. For example, the first weight can be 0.8 and the second weight can be 0.2; or the first weight can be 70% and the second weight can be 30%. This disclosure does not limit the weight values.

[0087] For example, the target loss value can be calculated using the following formula (3):

[0088] loss=beta1*ce_loss+beta2*padding_loss(3)

[0089] Where loss represents the target loss value, ce_loss represents the first loss value, padding_loss represents the second loss value, beta1 represents the first weight, and beta2 represents the second weight.

[0090] Thus, the target loss value can be calculated using the above formula.

[0091] S4. If the target loss value determines that the undetermined audio recognition model does not meet the preset stopping iteration condition, update the parameters of the undetermined audio recognition model according to the target loss value to obtain the trained undetermined audio recognition model, and use the trained undetermined audio recognition model as the new undetermined audio recognition model.

[0092] The preset stopping iteration condition may include the target loss value being less than or equal to a preset loss threshold, or the change in the target loss value within a certain number of iterations being less than a preset change threshold. It may also be a stopping iteration condition commonly used in related technologies, and this disclosure does not limit it to any particular condition. The aforementioned preset loss threshold or preset change threshold can be any pre-set value.

[0093] In addition, if the target loss value determines that the audio recognition model to be determined meets the preset stopping iteration condition, then the model training step can be stopped.

[0094] Thus, the target audio recognition model can be obtained through the above training method.

[0095] To facilitate understanding of the above technical solutions by those skilled in the art, the following examples are provided:

[0096] Assume the target sample text corresponding to the target sample audio is: 1 2 3 4

[0097] The first sample audio corresponds to the text 1 2 3 4, and the second sample audio corresponds to the text , where the second sample audio is the filler audio. The audio mask (target_weights) is: 1 1 1 1 1 0 0 0 0 0. The predicted text obtained after inputting the target sample audio into the audio recognition model (assuming the target length is limited to 10) is: 1 2 3 4 2 3 4 2 3 4

[0098] In other words, the predicted text did not stop at the actual 5th position, and subsequent decoding occurred repeatedly. Due to the limitations of the audio mask (target_weights), the first loss value (ce_loss) calculated by the first loss function is very small, and this first loss value is insufficient to reflect the impact of repeated decoding. However, in the above embodiment of this disclosure, the second loss value (padding_loss) calculated by the second loss function fully considers the impact of the aforementioned repeated decoding. Thus, by combining the first loss value and the second loss value, the recognition accuracy of the target audio recognition model obtained after training can be improved.

[0099] The target audio recognition model generated using the above method, when tested on a general Chinese test set, shows that the character error rate (CER) remains basically unchanged. However, when tested on a bad case set with repeated decoding, it can solve 85% of the repeated decoding problem, and the repeated decoding phenomenon is significantly improved.

[0100] Figure 3 This is a block diagram illustrating an audio recognition device 1100 according to an exemplary embodiment, such as... Figure 3 As shown, the device 1100 may include:

[0101] The audio acquisition module 1101 is used to acquire the target audio to be identified;

[0102] The audio recognition module 1102 is used to input the target audio into a pre-generated target audio recognition model to obtain the target text output by the target audio recognition model;

[0103] The target audio recognition model is a model pre-generated based on a sample dataset, a first loss function, and a second loss function. The sample dataset includes multiple target sample audios and target sample text corresponding to each target sample audio. The target sample audios include a first sample audio and a second sample audio. The first loss function is used to determine the text prediction accuracy of the first sample audio, and the second loss function is used to determine the text prediction accuracy of the second sample audio.

[0104] Figure 4 This is a block diagram illustrating another audio recognition device 1100 according to an exemplary embodiment, such as... Figure 4 As shown, the device 1100 may further include:

[0105] The model generation module 1103 is used to acquire the sample dataset; and to train the target audio recognition model based on the sample dataset, the first loss function and the second loss function to obtain the target audio recognition model.

[0106] According to one or more embodiments of this disclosure, the model generation module 1103 is used to repeatedly execute the model training steps until the trained pending audio recognition model meets the preset stopping iteration condition, and the trained pending audio recognition model is used as the target audio recognition model.

[0107] The model training steps include:

[0108] Input the target sample audio from the sample dataset into the audio recognition model to obtain the predicted text output by the audio recognition model;

[0109] The audio mask of the target sample audio is determined based on the relative positions of the first and second sample audio samples in the target sample audio.

[0110] A target loss value is determined based on the audio mask, the predicted text, the first loss function, and the second loss function; the target loss value is used to characterize the difference between the predicted text and the target sample text.

[0111] If the undetermined audio recognition model does not meet the preset stopping iteration condition based on the target loss value, the parameters of the undetermined audio recognition model are updated according to the target loss value to obtain the trained undetermined audio recognition model, and the trained undetermined audio recognition model is used as a new undetermined audio recognition model.

[0112] According to one or more embodiments of this disclosure, the model generation module 1103 is configured to determine a first loss value corresponding to a first sample audio of the target sample audio based on the audio mask, the predicted text, and the first loss function; determine a second loss value corresponding to a second sample audio of the target sample audio based on the audio mask, the predicted text, and the second loss function; and determine the target loss value based on the first loss value and the second loss value.

[0113] According to one or more embodiments of this disclosure, the model generation module 1103 is used to determine a first weight corresponding to the first loss value and a second weight corresponding to the second loss value; and to calculate the target loss value based on the first loss value, the first weight, the second loss value and the second weight.

[0114] According to one or more embodiments of this disclosure, the model generation module 1103 is configured to acquire a plurality of undetermined sample audios and undetermined sample text corresponding to each undetermined sample audio; determine a target length based on the audio lengths of the plurality of undetermined sample audios; for each undetermined sample audio, if the audio length of the undetermined sample audio is less than the target length, determine a padding sample audio to pad the undetermined sample audio; use the undetermined sample audio as the first sample audio and the padding sample audio as the second sample audio to obtain the sample dataset.

[0115] According to one or more embodiments of this disclosure, the second sample audio is a pre-formatted filled audio.

[0116] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0117] The following is for reference. Figure 5 This document illustrates a structural diagram of an electronic device 2000 (e.g., a terminal device or a server) suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. The server in the embodiments of the present disclosure may include, but is not limited to, local servers, cloud servers, single servers, and distributed servers. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0118] like Figure 5 As shown, electronic device 2000 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 2001, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 2002 or a program loaded from storage device 2008 into random access memory (RAM) 2003. RAM 2003 also stores various programs and data required for the operation of electronic device 2000. Processing device 2001, ROM 2002, and RAM 2003 are interconnected via bus 2004. Input / output (I / O) interface 2005 is also connected to bus 2004.

[0119] Typically, the following devices can be connected to the input / output interface 2005: input devices 2006 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 2007 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 2008 including, for example, magnetic tapes, hard disks, etc.; and communication devices 2009. Communication device 2009 allows electronic device 2000 to communicate wirelessly or wiredly with other devices to exchange data. Although... Figure 5 An electronic device 2000 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0120] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 2009, or installed from storage device 2008, or installed from ROM 2002. When the computer program is executed by processing device 2001, it performs the functions defined in the methods of embodiments of this disclosure.

[0121] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0122] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0123] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0124] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire target audio to be recognized; input the target audio into a pre-generated target audio recognition model to obtain target text output by the target audio recognition model; wherein the target audio recognition model is a model pre-generated based on a sample dataset, a first loss function, and a second loss function; the sample dataset includes multiple target sample audios and target sample text corresponding to each target sample audio, the target sample audios include a first sample audio and a second sample audio, the first loss function is used to determine the text prediction accuracy of the first sample audio, and the second loss function is used to determine the text prediction accuracy of the second sample audio.

[0125] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0126] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0127] The modules described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a module does not necessarily limit the module itself; for example, an audio acquisition module can also be described as "a module for acquiring target audio to be identified".

[0128] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0129] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0130] According to one or more embodiments of this disclosure, Example 1 provides an audio recognition method, the method comprising:

[0131] Obtain the target audio to be identified;

[0132] The target audio is input into a pre-generated target audio recognition model to obtain the target text output by the target audio recognition model;

[0133] The target audio recognition model is a model pre-generated based on a sample dataset, a first loss function, and a second loss function. The sample dataset includes multiple target sample audios and target sample text corresponding to each target sample audio. The target sample audios include a first sample audio and a second sample audio. The first loss function is used to determine the text prediction accuracy of the first sample audio, and the second loss function is used to determine the text prediction accuracy of the second sample audio.

[0134] According to one or more embodiments of this disclosure, Example 2 provides the method of Example 1, wherein the target audio recognition model is pre-generated in the following manner:

[0135] Obtain the sample dataset;

[0136] The target audio recognition model is obtained by training the desired audio recognition model based on the sample dataset, the first loss function, and the second loss function.

[0137] According to one or more embodiments of this disclosure, Example 3 provides the method of Example 2, wherein training a given audio recognition model based on the sample dataset, the first loss function, and the second loss function to obtain the target audio recognition model includes:

[0138] The model training steps are executed repeatedly until the trained undetermined audio recognition model meets the preset stopping iteration condition, and the trained undetermined audio recognition model is used as the target audio recognition model.

[0139] The model training steps include:

[0140] Input the target sample audio from the sample dataset into the audio recognition model to obtain the predicted text output by the audio recognition model;

[0141] The audio mask of the target sample audio is determined based on the relative positions of the first and second sample audio samples in the target sample audio.

[0142] A target loss value is determined based on the audio mask, the predicted text, the first loss function, and the second loss function; the target loss value is used to characterize the difference between the predicted text and the target sample text.

[0143] If the undetermined audio recognition model does not meet the preset stopping iteration condition based on the target loss value, the parameters of the undetermined audio recognition model are updated according to the target loss value to obtain the trained undetermined audio recognition model, and the trained undetermined audio recognition model is used as a new undetermined audio recognition model.

[0144] According to one or more embodiments of this disclosure, Example 4 provides the method of Example 3, wherein determining the target loss value based on the audio mask, the predicted text, the first loss function, and the second loss function includes:

[0145] Based on the audio mask, the predicted text, and the first loss function, determine the first loss value corresponding to the first sample audio of the target sample audio;

[0146] Based on the audio mask, the predicted text, and the second loss function, determine the second loss value corresponding to the second sample audio of the target sample audio;

[0147] The target loss value is determined based on the first loss value and the second loss value.

[0148] According to one or more embodiments of this disclosure, Example 5 provides the method of Example 4, wherein determining the target loss value based on the first loss value and the second loss value includes:

[0149] Determine the first weight corresponding to the first loss value and the second weight corresponding to the second loss value;

[0150] The target loss value is calculated based on the first loss value, the first weight, the second loss value, and the second weight.

[0151] According to one or more embodiments of this disclosure, Example 6 provides the method of Example 2, wherein obtaining the sample dataset includes:

[0152] Obtain multiple undetermined sample audios and the undetermined sample text corresponding to each undetermined sample audio;

[0153] The target length is determined based on the audio lengths of the multiple undetermined sample audios;

[0154] For each of the undetermined sample audios, if the audio length of the undetermined sample audio is less than the target length, a fill sample audio is determined to fill the undetermined sample audio.

[0155] The undetermined sample audio is used as the first sample audio, and the filled sample audio is used as the second sample audio to obtain the sample dataset.

[0156] According to one or more embodiments of this disclosure, Example 7 provides the methods of Examples 1 to 6, wherein the second sample audio is a pre-formatted filled audio.

[0157] According to one or more embodiments of this disclosure, Example 8 provides an audio recognition device, the device comprising:

[0158] The audio acquisition module is used to acquire the target audio to be identified.

[0159] The audio recognition module is used to input the target audio into a pre-generated target audio recognition model to obtain the target text output by the target audio recognition model;

[0160] The target audio recognition model is a model pre-generated based on a sample dataset, a first loss function, and a second loss function. The sample dataset includes multiple target sample audios and target sample text corresponding to each target sample audio. The target sample audios include a first sample audio and a second sample audio. The first loss function is used to determine the text prediction accuracy of the first sample audio, and the second loss function is used to determine the text prediction accuracy of the second sample audio.

[0161] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0162] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0163] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.

Claims

1. An audio recognition method, characterized in that, The method includes: Obtain the target audio to be identified; The target audio is input into a pre-generated target audio recognition model to obtain the target text output by the target audio recognition model; The target audio recognition model is a model pre-generated based on a sample dataset, a first loss function, and a second loss function. The sample dataset includes multiple target sample audios and target sample text corresponding to each target sample audio. The target sample audios include a first sample audio and a second sample audio. The first loss function is used to determine the text prediction accuracy of the first sample audio, and the second loss function is used to determine the text prediction accuracy of the second sample audio. The first sample audio is the original audio, and the second sample audio is the filled audio.

2. The method according to claim 1, characterized in that, The target audio recognition model is pre-generated in the following manner: Obtain the sample dataset; The target audio recognition model is obtained by training the desired audio recognition model based on the sample dataset, the first loss function, and the second loss function.

3. The method according to claim 2, characterized in that, The step of training the audio recognition model to be determined based on the sample dataset, the first loss function, and the second loss function to obtain the target audio recognition model includes: The model training steps are executed repeatedly until the trained undetermined audio recognition model meets the preset stopping iteration condition, and the trained undetermined audio recognition model is used as the target audio recognition model. The model training steps include: Input the target sample audio from the sample dataset into the audio recognition model to obtain the predicted text output by the audio recognition model; The audio mask of the target sample audio is determined based on the relative positions of the first and second sample audio samples in the target sample audio. A target loss value is determined based on the audio mask, the predicted text, the first loss function, and the second loss function; the target loss value is used to characterize the difference between the predicted text and the target sample text. If the undetermined audio recognition model does not meet the preset stopping iteration condition based on the target loss value, the parameters of the undetermined audio recognition model are updated according to the target loss value to obtain the trained undetermined audio recognition model, and the trained undetermined audio recognition model is used as a new undetermined audio recognition model.

4. The method according to claim 3, characterized in that, The step of determining the target loss value based on the audio mask, the predicted text, the first loss function, and the second loss function includes: Based on the audio mask, the predicted text, and the first loss function, determine the first loss value corresponding to the first sample audio of the target sample audio; Based on the audio mask, the predicted text, and the second loss function, determine the second loss value corresponding to the second sample audio of the target sample audio; The target loss value is determined based on the first loss value and the second loss value.

5. The method according to claim 4, characterized in that, Determining the target loss value based on the first loss value and the second loss value includes: Determine the first weight corresponding to the first loss value and the second weight corresponding to the second loss value; The target loss value is calculated based on the first loss value, the first weight, the second loss value, and the second weight.

6. The method according to claim 2, characterized in that, The process of obtaining the sample dataset includes: Obtain multiple undetermined sample audios and the undetermined sample text corresponding to each undetermined sample audio; The target length is determined based on the audio lengths of the multiple undetermined sample audios; For each of the undetermined sample audios, if the audio length of the undetermined sample audio is less than the target length, a fill sample audio is determined to fill the undetermined sample audio. The undetermined sample audio is used as the first sample audio, and the filled sample audio is used as the second sample audio to obtain the sample dataset.

7. The method according to any one of claims 1 to 6, characterized in that, The second sample audio is a pre-formatted filled audio.

8. An audio recognition device, characterized in that, The device includes: The audio acquisition module is used to acquire the target audio to be identified. The audio recognition module is used to input the target audio into a pre-generated target audio recognition model to obtain the target text output by the target audio recognition model; The target audio recognition model is a model pre-generated based on a sample dataset, a first loss function, and a second loss function. The sample dataset includes multiple target sample audios and target sample text corresponding to each target sample audio. The target sample audios include a first sample audio and a second sample audio. The first sample audio is the original audio, and the second sample audio is the filled audio. The first loss function is used to determine the text prediction accuracy of the first sample audio, and the second loss function is used to determine the text prediction accuracy of the second sample audio.

9. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processing device, it implements the steps of the method according to any one of claims 1 to 7.

10. An electronic device, characterized in that, include: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 7.