Audio processing method and device, computer device, medium and program product
By performing spectral segmentation and feature transformation on audio, and combining audio description information with multimodal data alignment, the problems of feature dimensionality and accuracy in variable-length audio recognition tasks are solved, achieving efficient audio recognition results.
Patent Information
- Application Number
- CN202311215392.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-19
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-09-19
AI Technical Summary
Existing technologies, when processing variable-length audio, suffer from poor performance in audio recognition tasks due to fixed-length feature processing, failing to balance the requirements of feature dimensions and recognition accuracy for different audio lengths.
After extracting spectral features from the audio, image segmentation is performed to obtain spectral blocks that are positively correlated with the audio length. These blocks are then converted into audio embedding sequences with the same feature dimensions. Multimodal data alignment is performed in conjunction with audio description information, and the data is then input into a large language model for recognition.
It improves the depth and accuracy of audio feature extraction, meets the feature dimension requirements of audio recognition tasks, and achieves efficient recognition of variable-length audio.
Smart Images

Figure CN117392998B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of audio processing technology, and more specifically, to audio processing methods, apparatus, computer equipment, media, and program products in the field of audio processing technology. Background Technology
[0002] With the development of neural network models, they can be used in more and more scenarios, such as audio recognition and image recognition.
[0003] Currently, when training large language models, the input to these models is fixed-length features. However, in audio recognition scenarios, audio lengths can vary significantly. If processed using fixed-length features, the performance of audio recognition tasks will obviously be poor. Summary of the Invention
[0004] This application provides an audio processing method, apparatus, computer device, medium, and program product. The method is capable of processing variable-length audio and ensures the accuracy of processing different variable-length audio.
[0005] On the one hand, an audio processing method is provided, the method comprising:
[0006] Spectral features are extracted from the target audio to obtain the target spectrogram corresponding to the target audio;
[0007] The target spectrogram is segmented to obtain at least two target spectrogram blocks, and the number of target spectrogram blocks is positively correlated with the target audio length of the target audio.
[0008] Audio features are extracted from each of the target spectral blocks to obtain the first audio embedding sequence corresponding to the target audio. The feature dimensions of the first audio embedding sequence corresponding to the target audio with different target audio lengths are the same.
[0009] Audio recognition is performed based on the first audio embedding sequence to obtain the target audio recognition result corresponding to the target audio.
[0010] On the one hand, an audio processing method is provided, the method comprising:
[0011] Spectral features are extracted from the sample audio to obtain the sample spectrum map corresponding to the sample audio;
[0012] The sample spectrogram is segmented to obtain at least two sample spectrogram blocks, and the number of sample spectrogram blocks is positively correlated with the sample audio length of the sample audio.
[0013] Audio features are extracted from each of the sample spectral blocks to obtain the first sample audio embedding sequence corresponding to the sample audio. The feature dimensions of the first sample audio embedding sequence corresponding to sample audios of different lengths are the same.
[0014] The first sample audio embedding sequence is input into the large language model to obtain the sample audio recognition result output by the large language model;
[0015] The large language model is trained based on the sample audio recognition results and the standard audio recognition results.
[0016] On one hand, an audio processing apparatus is provided, the apparatus comprising:
[0017] The spectrum extraction module is used to extract the spectrum features of the target audio to obtain the target spectrum map corresponding to the target audio.
[0018] An image segmentation module is used to segment the target spectrogram to obtain at least two target spectral blocks, wherein the number of target spectral blocks is positively correlated with the target audio length of the target audio.
[0019] The feature extraction module is used to extract audio features from each of the target spectral blocks to obtain a first audio embedding sequence corresponding to the target audio. The feature dimensions of the first audio embedding sequence corresponding to the target audio of different lengths are the same.
[0020] An audio recognition module is used to perform audio recognition based on the first audio embedding sequence to obtain the target audio recognition result corresponding to the target audio.
[0021] On one hand, an audio processing apparatus is provided, the apparatus comprising:
[0022] The spectrum extraction module is used to extract spectral features from the sample audio to obtain the sample spectrum map corresponding to the sample audio.
[0023] The image segmentation module is used to segment the sample spectrogram to obtain at least two sample spectrum blocks, wherein the number of sample spectrum blocks is positively correlated with the sample audio length of the sample audio.
[0024] The feature extraction module is used to extract audio features from each of the sample spectral blocks to obtain the first sample audio embedding sequence corresponding to the sample audio. The feature dimensions of the first sample audio embedding sequence corresponding to sample audios of different lengths are the same.
[0025] An audio recognition module is used to input the first sample audio embedding sequence into a large language model to obtain the sample audio recognition result output by the large language model;
[0026] The training module is used to train the large language model based on the sample audio recognition results and the standard audio recognition results.
[0027] On one hand, a computer device is provided, the computer device including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the computer device performs the audio processing method described in any of the preceding aspects.
[0028] On one hand, a computer-readable storage medium is provided that stores instructions which, when executed on a computer or processor, cause the computer or processor to perform the audio processing method described in any of the preceding aspects.
[0029] On one hand, a computer program product or computer program is provided, which includes program code stored in a computer-readable storage medium, wherein a processor of a computer device reads the program code from the computer-readable storage medium and executes the program code, causing the computer device to perform the audio processing method described in any of the preceding aspects.
[0030] The technical solution provided in this application can bring the following beneficial effects:
[0031] This application provides a method for processing variable-length audio: by segmenting the target spectrogram corresponding to the target audio, multiple spectrogram blocks are obtained, and the number of target spectrogram blocks is set to be positively correlated with the target audio length, so that the target spectrograms corresponding to different target audio lengths can be segmented into spectrogram blocks of similar granularity, and more detailed features are extracted from the target spectrogram, thereby improving the depth and accuracy of audio feature extraction; moreover, when extracting audio features from multiple spectrograms, not only can more detailed features on the target spectrogram be focused on, but different numbers of spectrogram blocks can also be converted into audio embedding sequences with the same feature dimension to meet the feature dimension requirements of audio recognition tasks, thereby achieving the goal of balancing the audio recognition accuracy requirements of variable-length audio and the feature dimension requirements of audio recognition tasks. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1This is a schematic flowchart of an audio processing method provided in an embodiment of this application;
[0034] Figure 2 This is a schematic diagram of an audio recognition process provided in an embodiment of this application;
[0035] Figure 3 This is a schematic flowchart of another audio processing method provided in the embodiments of this application;
[0036] Figure 4 This is a schematic diagram of another audio recognition process provided in an embodiment of this application;
[0037] Figure 5 This is a schematic flowchart of another audio processing method provided in the embodiments of this application;
[0038] Figure 6 This is a schematic diagram of another audio recognition process provided in an embodiment of this application;
[0039] Figure 7 This is a schematic flowchart of another audio processing method provided in the embodiments of this application;
[0040] Figure 8 This is a schematic flowchart of another audio processing method provided in the embodiments of this application;
[0041] Figure 9 This is a schematic diagram illustrating the processing procedure of an audio recognition task provided in an embodiment of this application;
[0042] Figure 10 This is a schematic diagram of the structure of an audio processing device provided in an embodiment of this application;
[0043] Figure 11 This is a schematic diagram of another audio processing device provided in an embodiment of this application;
[0044] Figure 12 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0045] The technical solutions of this application will now be described clearly and in detail with reference to the accompanying drawings. In the description of the embodiments of this application, "multiple" refers to two or more. The terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0046] Figure 1This is a schematic flowchart illustrating an audio processing method provided in an embodiment of this application. The embodiment of this application uses the application of this method to a computer device as an example for explanation.
[0047] like Figure 1 As shown, the method 100 includes:
[0048] Step 101: Extract spectral features from the target audio to obtain the target spectrum map corresponding to the target audio.
[0049] In this context, the target audio is the object of recognition in the audio recognition task. For example, the target audio can be speech, recordings, music, etc., and the audio recognition task can be an audio transcription task (e.g., converting audio containing text in one language into text in another language), an audio content recognition task (e.g., summarizing the content of the text contained in the audio), a dialogue task (e.g., outputting the corresponding answer based on the output audio), etc. This embodiment does not specifically limit the type of target audio or the audio recognition task.
[0050] To better capture the audio information contained in the target audio, spectral feature extraction can be performed on the target audio before performing the audio recognition task, so as to more intuitively represent the audio features such as loudness, amplitude, and pitch. In one possible implementation, the computer device performs spectral feature extraction on the target audio to obtain a target spectrogram. This target spectrogram can characterize the spectral distribution features of the target audio.
[0051] For example, spectral feature extraction of the target audio can convert the target audio into Fbank or MFCC spectral features.
[0052] Alternatively, computer devices can also use HuBERT, W2V-BERT, or ImageBind, ChatBridge, etc., to extract features.
[0053] Step 102: Perform image segmentation on the target spectrogram to obtain at least two target spectrogram blocks. The number of target spectrogram blocks is positively correlated with the target audio length.
[0054] When processing target audio using a large language model, there are specific requirements for the feature dimensions of the input audio features. However, in actual audio recognition tasks, the target audio length is not fixed; for example, the length of different speech inputs from a speaker can vary. Reducing the feature dimensions extracted from longer speech may affect the accuracy of audio recognition for that longer audio. Therefore, to balance the requirements for feature dimensions and audio recognition accuracy, this embodiment does not directly extract audio features from the complete target spectrogram corresponding to the target audio. Instead, the computer device first performs image segmentation on the target spectrogram to obtain multiple target spectrogram blocks, and then performs audio feature conversion on these blocks. Furthermore, by setting the number of target spectrogram blocks to be positively correlated with the target audio length—that is, the longer the target audio length, the longer the target spectrogram, and the more target spectrogram blocks can be segmented—target spectrograms corresponding to different target audio lengths can be segmented into spectrogram blocks of similar granularity, allowing for the extraction of more detailed features from the target spectrogram, thereby improving the depth and accuracy of audio feature extraction.
[0055] For example, if the target audio length is 5 seconds, its corresponding target spectrogram can be divided into 64*64 spectrogram blocks; if the target audio length is 30 seconds, its corresponding target spectrogram can be divided into 64*128 spectrogram blocks.
[0056] Step 103: Extract audio features from each target spectral block to obtain the first audio embedding sequence corresponding to the target audio. The feature dimensions of the first audio embedding sequence corresponding to target audios of different lengths are the same.
[0057] To ensure that high-dimensional audio features can be extracted from target audio of different lengths to improve the accuracy of subsequent audio recognition, target audio of different lengths is divided into different numbers of spectral blocks. To ensure both accuracy and that the audio features used for recognition meet the input dimension of a large language model, in one possible implementation, the computer device extracts audio features from each target spectral block to output a first audio embedding sequence corresponding to the target audio. This audio feature extraction converts different numbers of spectral blocks into a first audio embedding sequence of the same dimension, thus meeting the feature dimension requirements for subsequent audio recognition.
[0058] Step 104: Perform audio recognition based on the first audio embedding sequence to obtain the target audio recognition result corresponding to the target audio.
[0059] Furthermore, after the computer device obtains the first audio embedding sequence, it can input the first audio embedding sequence into the Large Language Model (LLM), and the Large Language Model can perform audio recognition based on the first audio embedding sequence to obtain the target audio recognition result corresponding to the target audio.
[0060] Figure 2 This is a schematic diagram illustrating an audio recognition process provided in an embodiment of this application. Figure 2 As shown, in the audio recognition task, the computer device first extracts the spectral features of the target audio 201 to obtain the target spectrogram 202 corresponding to the target audio 201, and performs image segmentation on the target spectrogram 202 to obtain multiple target spectral blocks 203 (the longer the audio length, the more target spectral blocks there are); further, it extracts audio features from the multiple target spectral blocks 203 to obtain the first audio embedding sequence 204 corresponding to the target audio 201, and performs audio recognition based on the first audio embedding sequence 204 to obtain the target audio recognition result 205 of the target audio 201.
[0061] In summary, this application provides a method for processing variable-length audio: by segmenting the target spectrogram corresponding to the target audio, multiple spectrogram blocks are obtained, and the number of target spectrogram blocks is set to be positively correlated with the target audio length, so that target spectrograms corresponding to different target audio lengths can be segmented into spectrogram blocks of similar granularity, and more detailed features can be extracted from the target spectrogram, thereby improving the depth and accuracy of audio feature extraction; moreover, when extracting audio features from multiple spectrograms, not only can more detailed features on the target spectrogram be focused on, but different numbers of spectrogram blocks can also be converted into audio embedding sequences with the same feature dimension to meet the feature dimension requirements of audio recognition tasks, thus achieving the goal of balancing the audio recognition accuracy requirements of variable-length audio and the feature dimension requirements of audio recognition tasks.
[0062] Since the main difference between audio lengths is in the duration, the resulting spectrograms also differ in length. Therefore, when segmenting the target spectrogram, the main difference between the target spectrograms for audio of variable length is the number of columns divided.
[0063] Figure 3 This is a schematic flowchart illustrating another audio processing method provided in an embodiment of this application. This embodiment uses the application of this method to a computer device as an example for explanation.
[0064] For example, such as Figure 3 As shown, the method 300 includes:
[0065] Step 301: Extract spectral features from the target audio to obtain the target spectrum map corresponding to the target audio.
[0066] The implementation method of step 301 can refer to step 101, and will not be repeated here in this embodiment.
[0067] Step 302: Based on the target audio length corresponding to the target audio, determine the image segmentation parameters corresponding to the target spectrogram. The image segmentation parameters include the number of target columns and the number of target rows. The number of target columns is positively correlated with the target audio length.
[0068] Due to the temporal differences in audio frequencies of varying lengths, to divide these frequencies into spectral blocks of similar granularity, the number of columns in the spectrograms corresponding to audio frequencies of different lengths can be differentiated. In one possible implementation, before segmenting the target spectrogram, the computer device can determine image segmentation parameters based on the target audio length. These parameters may include the target number of columns and rows, with the target number of columns set to be positively correlated with the target audio length; that is, the target spectrogram is segmented into the target number of columns and rows to obtain several spectral blocks.
[0069] For example, if the target audio length is 5 seconds, the corresponding image segmentation parameters can be 64 target rows and 64 target columns; if the target audio length is 30 seconds, the corresponding image segmentation parameters can be 64 target rows and 128 target columns. It can be seen that the longer the target audio length, the more target columns the target spectrogram can be segmented into.
[0070] Step 303: Perform image segmentation on the target spectrogram based on image segmentation parameters to obtain at least two target spectrogram blocks.
[0071] Once the computer device obtains the image segmentation parameters corresponding to the target spectrogram, it can segment the target spectrogram according to the target row number and target column number indicated by the image segmentation parameters, thereby obtaining several target spectrogram blocks. The number of target spectrogram blocks is the value corresponding to the target row number multiplied by the target column number.
[0072] For example, if the target number of rows and the target number of columns in the image segmentation parameters are 64, then the number of target spectral blocks obtained can be 64*64=4096 blocks.
[0073] Step 304: Input each target spectral block into the audio conversion network to obtain the first audio feature matrix output by the audio conversion network. The number of columns in the first audio feature matrix is positively correlated with the target audio length.
[0074] In this implementation, the computer device uses an audio conversion network to convert the spectral features of the target spectral blocks into audio features. For example, the audio conversion network can be an Audio Transformer network. In one possible implementation, the computer device can input each target spectral block into the audio conversion network, which then converts the spectral features into audio features to obtain a first audio feature matrix output by the audio conversion network. This first audio feature matrix can include multiple audio embedding features, and the number of columns in the first audio feature matrix is positively correlated with the target audio length. That is, the longer the target audio length, the longer the target spectral map, the more target spectral blocks obtained from image segmentation, and the more audio embedding features are correspondingly generated after audio feature conversion.
[0075] For example, if the target audio length is 5 seconds, the first audio feature matrix extracted may include 64*64 audio embedding features; if the target audio length is 30 seconds, the first audio feature matrix extracted may include 64*128 audio embedding features.
[0076] Step 305: The first audio feature matrix is downsampled to obtain the second audio feature matrix. The downsampling factor of the target audio is different for different target audio lengths, and the number of columns of the second audio feature matrix is the same for target audio of different lengths after downsampling.
[0077] Since the number of audio embedding features in the first audio feature matrix extracted from target audios of different target audio lengths varies, and the feature dimension of the audio embedding features used for audio recognition tasks should be the same, in order to meet this feature dimension requirement, in one possible implementation, the computer device can perform downsampling processing on the first audio feature matrix and set different downsampling factors for the target audios corresponding to different target audio lengths to obtain the second audio feature matrix, and make the number of columns of the second audio feature matrix corresponding to the target audios of different target audio lengths the same after downsampling processing.
[0078] For example, if the target audio length is 5 seconds, the first audio feature matrix extracted contains 64*64 audio embedding features, and the downsampling factor can be set to 1 / 2; if the target audio length is 30 seconds, the first audio feature matrix extracted contains 64*128 audio embedding features, and the downsampling factor can be set to 1 / 4.
[0079] Step 306: Merge the second audio feature matrix in chronological order to obtain the first audio embedding sequence.
[0080] Optionally, after obtaining the second audio feature matrix, it can be merged in chronological order to obtain the first audio embedding sequence. For example, taking a second audio feature matrix consisting of m rows and n columns, the audio embedding features corresponding to each column are merged to obtain 1 row and n columns of audio embedding features, which is the first audio embedding sequence generated in chronological order.
[0081] Step 307: Perform audio recognition based on the first audio embedding sequence to obtain the target audio recognition result corresponding to the target audio.
[0082] Figure 4 This is a schematic diagram of another audio recognition process provided in an embodiment of this application. Figure 4 As shown, in the audio recognition task, the computer device first extracts the spectral features of the target audio 401 to obtain the target spectrogram 402 corresponding to the target audio 401, and performs image segmentation on the target spectrogram 402 to obtain multiple target spectral blocks 403 (the longer the audio length, the more target spectral blocks there are); in the audio feature extraction stage, the computer device inputs the multiple target spectral blocks 403 into the audio transformation network (Audio Transformer 404), outputs the first audio feature matrix 405, and downsamples the first audio feature matrix 405 to obtain the second audio feature matrix 406, and merges the second audio feature matrix 406 in chronological order to obtain the first audio embedding sequence 407; in the audio recognition stage, audio recognition is performed based on the first audio embedding sequence 407 to obtain the target audio recognition result 408 of the target audio 401.
[0083] The implementation method of step 307 can refer to step 104, and will not be repeated here in this embodiment.
[0084] In this embodiment, considering that variable-length audio mainly affects the length of the spectrogram, when performing image segmentation on the target spectrogram, different audio lengths are divided into different numbers of columns to extract high-dimensional features of the target spectrogram corresponding to variable-length audio. In addition, by setting different downsampling factors, it can be ensured that different numbers of spectral blocks can be converted into audio features of the same feature dimension to meet the feature dimension requirements of the audio recognition task.
[0085] To further enrich and improve the recognition performance of audio recognition tasks, additional audio description information in the text modality can be added during the audio recognition process. This provides the large language model with audio information in the text modality, thereby improving the audio recognition performance of the large language model.
[0086] Figure 5This is a schematic flowchart illustrating another audio processing method provided in an embodiment of this application. This embodiment uses the application of this method to a computer device as an example for explanation.
[0087] For example, such as Figure 5 As shown, the method 500 includes:
[0088] Step 501: Extract spectral features from the target audio to obtain the target spectrum map corresponding to the target audio.
[0089] Step 502: Perform image segmentation on the target spectrogram to obtain at least two target spectrogram blocks. The number of target spectrogram blocks is positively correlated with the target audio length.
[0090] Step 503: Extract audio features from each target spectral block to obtain the first audio embedding sequence corresponding to the target audio. The feature dimensions of the first audio embedding sequence corresponding to target audios of different lengths are the same.
[0091] The implementation methods for steps 501 to 503 can be referred to the above embodiments, and will not be repeated here.
[0092] Step 504: Obtain audio description information corresponding to the target audio. The audio description information includes at least one of the following: language type information, audio event information, audio speaker scene information, and audio speaker information.
[0093] To improve the performance of audio recognition tasks, in addition to introducing the audio feature information of the target audio itself, an additional text feature, the audio description information corresponding to the target audio, is added. In one possible implementation, the computer device, while acquiring the target audio, can also acquire audio description information related to the target audio. This audio description information can be language information (e.g., whether the voice in the audio is a dialect, Mandarin, English, or a combination of Chinese and English), audio event information (e.g., information about special events involved in the audio), audio speaker scene information (e.g., whether the speaker in the audio is in a chat scene or a meeting scene), or audio speaker information (e.g., whether the speaker in the audio is a teacher, student, parent, or friend). This application does not limit the specific audio description information.
[0094] Step 505: Perform word segmentation and text feature extraction on the audio description information to obtain the first text feature sequence corresponding to the audio description information.
[0095] In order to incorporate audio description information into subsequent audio recognition tasks, feature extraction of the audio description information is also required to obtain the text features of the input large language model. In one possible implementation, the computer device segments the input audio description information into words and extracts text features from the segmented words to obtain the first text feature sequence corresponding to the audio description information.
[0096] Step 506: Perform multimodal data alignment on the first text feature sequence and the first audio embedding sequence to obtain the aligned second audio embedding sequence and the second text feature sequence.
[0097] Since the first text feature sequence corresponds to features in the text modality, and the first audio embedding sequence corresponds to features in the audio modality, the text and audio modalities need to be aligned to the same space before inputting these two modalities into the large language model. In one possible implementation, the computer device performs multimodal data alignment on the first text feature sequence and the first audio embedding sequence to obtain a second audio embedding sequence and a second text feature sequence aligned to the same space.
[0098] For example, the first text feature sequence and the first audio embedding sequence can be input into the LLM EmbeddingAlignment module, and the Attention method can be used to align the text modality data and the audio modality data into the same space.
[0099] Step 507: Perform audio recognition based on the second audio embedding sequence and the second text feature sequence to obtain the target audio recognition result corresponding to the target audio.
[0100] Furthermore, after aligning to the same space, audio recognition can be performed based on the second audio embedding sequence and the second text feature sequence to obtain the target audio recognition result corresponding to the target audio.
[0101] Optionally, since the large language model may possess multiple audio recognition functions, when performing audio recognition on the second audio embedding sequence and the second text feature sequence, a target instruction word can be input to indicate the audio recognition function to be performed, so that the large language model clearly understands the audio recognition function to be executed. In an exemplary example, step 507 may also include steps 507A to 507C.
[0102] Step 507A: Obtain the target instruction word, which is used to instruct the recognition function for audio recognition of the target audio.
[0103] The target instruction word is used to indicate the recognition function or purpose of audio recognition of the target audio. For example, the target instruction word can be an audio transcription instruction, and the corresponding large language model can output the audio transcription result based on the input information; if the target instruction word is an audio dialogue instruction, the corresponding large language model can output the audio dialogue result based on the input information, and so on.
[0104] Step 507B: Perform text space alignment on the second audio embedding sequence, the second text feature sequence, and the target instruction word to obtain the aligned third audio embedding sequence, the third text feature sequence, and the target instruction text feature.
[0105] Since the large language model corresponds to the text space, these three types of information need to be aligned to the text space before inputting the second audio embedding sequence, the second text feature sequence, and the target instruction word into the large language model. In one possible implementation, the computer device first performs text space alignment on the second audio embedding sequence, the second text feature sequence, and the target instruction word to obtain a third audio embedding sequence, a third text feature sequence, and the target instruction text feature aligned to the text space, which are then input into the large language model for audio recognition tasks.
[0106] For example, the second audio embedding sequence, the second text feature sequence, and the target instruction word can be input into the Linear module, which will align the three types of information into the LLM space to obtain the aligned third audio embedding sequence, the third text feature sequence, and the target instruction text feature.
[0107] Step 507C: Input the third audio embedding sequence, the third text feature sequence, and the target instruction text features into the large language model to obtain the target audio recognition result output by the large language model. The target audio recognition result is obtained after performing audio recognition on the target audio according to the recognition function.
[0108] Furthermore, in audio recognition tasks, computer devices can input the third audio embedding sequence, the third text feature sequence, and the target instruction text features into a large language model to obtain the target audio recognition result corresponding to the target instruction word indication recognition function output by the large language model.
[0109] Figure 6 This is a schematic diagram of another audio recognition process provided in an embodiment of this application. Figure 6As shown. In the audio recognition task, the computer device first extracts the spectral features of the target audio 601 to obtain the target spectrogram 602 corresponding to the target audio 601, and performs image segmentation on the target spectrogram 602 to obtain multiple target spectral blocks 603 (the longer the audio length, the more target spectral blocks there are); in the audio feature extraction stage, the computer device inputs multiple target spectral blocks 603 into the audio transformation network (Audio Transformer 604), outputs the first audio feature matrix 605, and downsamples the first audio feature matrix 605 to obtain the second audio feature matrix 606, and merges the second audio feature matrix 606 in chronological order to obtain the first audio embedding sequence 607; at the same time, in another branch, the audio description information 608 corresponding to the target audio 601 is also introduced, and the audio description information 608 is segmented and text features extracted to obtain the first text feature sequence 609; considering that the input is data of different modalities, before inputting into the large language model 617, LLM is first used. EmbeddingAlignment aligns the first text feature sequence 609 and the first audio embedding sequence 607 into the same space to obtain the aligned second text feature sequence 612 and the second audio embedding sequence 611. Then, the second audio embedding sequence 611, the second text feature sequence 612, and the target instruction word 613 are input into Linear 614 and aligned into the text space to obtain the aligned third audio embedding sequence 614, the third text feature sequence 615, and the target instruction text feature 616. In the audio recognition stage, the third audio embedding sequence 614, the third text feature sequence 615, and the target instruction text feature 616 are input into the large language model 617 for audio recognition to output the target audio recognition result 618 corresponding to the target audio 601.
[0110] In this embodiment, by introducing audio description information of the target audio and improving the data processing flow, the large language model analyzes the multimodal data to achieve the audio recognition task, which can improve the accuracy of the audio recognition task and further enhance the audio recognition capability of the large language model.
[0111] The above embodiments mainly describe the audio processing process during model application. In order for the large language model to have the audio recognition capabilities shown in the above embodiments, it is necessary to train the large language model before applying the model.
[0112] Figure 7 This is a schematic flowchart illustrating another audio processing method provided in an embodiment of this application. This embodiment uses the application of this method to a computer device as an example for explanation.
[0113] For example, such as Figure 7 As shown, the method 700 includes:
[0114] Step 701: Extract spectral features from the sample audio to obtain the sample spectrum corresponding to the sample audio.
[0115] Similar to the model application process, during model training, computer equipment also needs to extract spectral features from the sample audio to obtain the sample spectrum map corresponding to the sample audio.
[0116] Step 702: Perform image segmentation on the sample spectrogram to obtain at least two sample spectrogram blocks. The number of sample spectrogram blocks is positively correlated with the sample audio length of the sample audio.
[0117] Referring to the processing procedure of the target spectrogram in the above embodiment, during the model training process, it is also necessary to perform image segmentation on the sample spectrogram to obtain multiple sample spectrogram blocks. The number of sample spectrogram blocks is set to be positively correlated with the sample audio length, so that the large language model can process convertible audio.
[0118] Step 703: Extract audio features from each sample spectral block to obtain the first sample audio embedding sequence corresponding to the sample audio. The feature dimensions of the first sample audio embedding sequence corresponding to sample audios of different lengths are the same.
[0119] To meet the requirements of the input feature dimension of the large language model, the computer device also needs to extract audio features from each sample spectrum block to obtain the first sample audio embedding sequence corresponding to the sample audio. After audio feature processing, the feature dimension of the first sample audio embedding sequence corresponding to sample audios of different sample audio lengths can be the same.
[0120] Step 704: Input the first sample audio embedding sequence into the large language model to obtain the sample audio recognition result output by the large language model.
[0121] By inputting the first sample audio embedding sequence into the large language model, the sample audio recognition result output by the large language model can be obtained.
[0122] Step 705: Train a large language model based on the sample audio recognition results and the standard audio recognition results.
[0123] During model training, to improve the audio recognition accuracy of the large language model, it is necessary to adjust the model parameters based on the difference between the sample audio recognition results and the standard audio recognition results. The standard audio recognition result is the accurate audio recognition result corresponding to the sample audio. That is, the training samples of the large language model include several training sample pairs, each pair containing the sample audio and its corresponding standard audio recognition result.
[0124] In summary, the embodiments of this application provide a training process for a large language model, enabling the large language model to process variable-length target audio, extracting high-dimensional audio information corresponding to different audio lengths while also meeting the feature dimension requirements of the large language model.
[0125] The process of processing the sample spectrogram during model training is similar to the process of processing the target spectrogram during model application. The number of sample columns in the sample spectrogram corresponding to sample audio with different sample audio lengths varies.
[0126] Figure 8 This is a schematic flowchart illustrating another audio processing method provided in an embodiment of this application. This embodiment uses the application of this method to a computer device as an example for explanation.
[0127] For example, such as Figure 8 As shown, the method 800 includes:
[0128] Step 801: Extract spectral features from the sample audio to obtain the sample spectrum corresponding to the sample audio.
[0129] Step 802: Based on the sample audio length corresponding to the sample audio, determine the sample segmentation parameters corresponding to the sample spectrogram. The sample segmentation parameters include the number of sample columns and the number of sample rows. The number of sample columns is positively correlated with the sample audio length.
[0130] Step 803: Perform image segmentation on the sample spectrogram based on the sample segmentation parameters to obtain at least two sample spectrogram blocks.
[0131] Step 804: Input each sample spectrum block into the audio conversion network to obtain the first sample audio feature matrix output by the audio conversion network. The number of columns in the first sample audio feature matrix is positively correlated with the sample audio length.
[0132] Step 805: Downsample the first sample audio feature matrix to obtain the second sample audio feature matrix. Different sample audio lengths correspond to different downsampling factors for the sample audio, and after downsampling, the number of columns in the second sample audio feature matrix is the same for sample audio of different lengths.
[0133] Step 806: Merge the second sample audio feature matrix in chronological order to obtain the first sample audio embedding sequence.
[0134] It should be noted that the process of obtaining the first sample audio embedding sequence corresponding to the sample audio in this embodiment is similar to the process of obtaining the first audio embedding sequence corresponding to the target audio in the above embodiment. The process of obtaining the first sample audio embedding sequence corresponding to the sample audio can refer to the process of obtaining the first audio embedding sequence corresponding to the target audio in the above embodiment. This embodiment will not repeat the process here.
[0135] Step 807: Obtain the sample description information corresponding to the sample audio. The sample description information includes at least one of the following: audio type information, audio scene information, audio event information, and audio speaker scene information.
[0136] Step 808: Segment the sample description information into words and extract text features to obtain the first sample text feature sequence corresponding to the sample description information.
[0137] The process of obtaining the first sample text feature sequence in this embodiment can also refer to the process of obtaining the first text feature sequence in the above embodiment, and will not be repeated here.
[0138] Step 809: Perform multimodal data alignment on the first sample text feature sequence and the first sample audio embedding sequence to obtain the aligned second sample audio embedding sequence and the second sample text feature sequence.
[0139] After the computer device obtains the first sample text feature sequence and the first sample audio embedding sequence, it first performs multimodal data alignment on the first sample text feature sequence and the first sample audio embedding sequence to the same space, and obtains the aligned second sample audio embedding sequence and the second sample text feature sequence.
[0140] Step 810: Input the second sample audio embedding sequence and the second sample text feature sequence into the large language model to obtain the sample audio recognition result output by the large language model.
[0141] In an exemplary example, step 810 may also include steps 810A to 810C.
[0142] Step 810A: Obtain sample instruction words. Sample instruction words are used to instruct the recognition function for audio recognition of sample audio.
[0143] Step 810B: Perform text space alignment on the second sample audio embedding sequence, the second sample text feature sequence, and the sample instruction words to obtain the aligned third sample audio embedding sequence, the third sample text feature sequence, and the sample instruction text features.
[0144] Step 810C: Input the third sample audio embedding sequence, the third sample text feature sequence, and the sample instruction text features into the large language model to obtain the sample audio recognition result output by the large language model. The sample audio recognition result is obtained after performing audio recognition on the sample audio according to the recognition function.
[0145] Optionally, the process of inputting sample audio recognition results into the large language model can refer to the process of outputting target audio recognition results into the large language model in the above embodiment.
[0146] Step 811: Train a large language model based on the sample audio recognition results and the standard audio recognition results.
[0147] Optionally, the computer device can train a large language model and an audio conversion network based on the differences between the sample audio recognition results and the standard audio recognition results.
[0148] Figure 9 This is a schematic diagram illustrating the processing procedure of an audio recognition task provided in an embodiment of this application. For example... Figure 9 As shown. The input includes audio and audio description text (speaker, sound events, dialect type, etc.). The instruction words can be: transcribe / summarize audio content / analyze audio sound. After processing by the audio conversion network and the large language model, the output can include: background: a scene of two people talking, conversational tone; there are cicada sounds, Sichuan dialect; Chinese and English languages; instruction transcription: yes, the weather is very hot today, etc.
[0149] In this embodiment, by introducing sample audio description information and improving the data processing flow, the large language model analyzes multimodal data to achieve the audio recognition task, which can improve the accuracy of the audio recognition task and further enhance the audio recognition capability of the large language model.
[0150] Figure 10 This is a schematic diagram of the structure of an audio processing device provided in an embodiment of this application.
[0151] For example, such as Figure 10 As shown, the device 1000 includes:
[0152] The spectrum extraction module 1001 is used to extract the spectrum features of the target audio to obtain the target spectrum map corresponding to the target audio.
[0153] The image segmentation module 1002 is used to segment the target spectrogram to obtain at least two target spectrogram blocks, wherein the number of target spectrogram blocks is positively correlated with the target audio length of the target audio.
[0154] The feature extraction module 1003 is used to extract audio features from each of the target spectral blocks to obtain a first audio embedding sequence corresponding to the target audio. The feature dimensions of the first audio embedding sequence corresponding to the target audio of different lengths are the same.
[0155] The audio recognition module 1004 is used to perform audio recognition based on the first audio embedding sequence to obtain the target audio recognition result corresponding to the target audio.
[0156] Optionally, the image segmentation module 1002 is further configured to:
[0157] Based on the target audio length corresponding to the target audio, image segmentation parameters corresponding to the target spectrogram are determined. The image segmentation parameters include the number of target columns and the number of target rows. The number of target columns is positively correlated with the target audio length.
[0158] The target spectrogram is segmented based on the image segmentation parameters to obtain at least two target spectrogram blocks.
[0159] Optionally, the feature extraction module 1003 is further configured to:
[0160] Each of the target spectral blocks is input into an audio conversion network to obtain a first audio feature matrix output by the audio conversion network. The number of columns in the first audio feature matrix is positively correlated with the length of the target audio.
[0161] The first audio feature matrix is downsampled to obtain the second audio feature matrix. Different target audio lengths correspond to different downsampling factors for the target audio, and after downsampling, the number of columns in the second audio feature matrix is the same for target audio of different lengths.
[0162] The second audio feature matrix is merged in chronological order to obtain the first audio embedding sequence.
[0163] Optionally, the device further includes:
[0164] The acquisition module is used to acquire audio description information corresponding to the target audio, wherein the audio description information includes at least one of the following: language type information, audio event information, audio speaker scene information, and audio speaker information corresponding to the target audio;
[0165] The text processing module is used to perform word segmentation and text feature extraction on the audio description information to obtain the first text feature sequence corresponding to the audio description information;
[0166] The alignment processing module is used to perform multimodal data alignment on the first text feature sequence and the first audio embedding sequence to obtain the aligned second audio embedding sequence and the second text feature sequence.
[0167] The audio recognition module 1004 is also used for:
[0168] Audio recognition is performed based on the second audio embedding sequence and the second text feature sequence to obtain the target audio recognition result corresponding to the target audio.
[0169] Optionally, the audio recognition module 1004 is further configured to:
[0170] Obtain the target instruction word, which is used to instruct the recognition function to perform audio recognition on the target audio;
[0171] The second audio embedding sequence, the second text feature sequence, and the target instruction word are aligned in text space to obtain the aligned third audio embedding sequence, the third text feature sequence, and the target instruction text feature;
[0172] The third audio embedding sequence, the third text feature sequence, and the target instruction text feature are input into a large language model to obtain the target audio recognition result output by the large language model. The target audio recognition result is obtained by performing audio recognition on the target audio according to the recognition function.
[0173] In summary, this application provides a method for processing variable-length audio: by segmenting the target spectrogram corresponding to the target audio, multiple spectrogram blocks are obtained, and the number of target spectrogram blocks is set to be positively correlated with the target audio length, so that target spectrograms corresponding to different target audio lengths can be segmented into spectrogram blocks of similar granularity, and more detailed features can be extracted from the target spectrogram, thereby improving the depth and accuracy of audio feature extraction; moreover, when extracting audio features from multiple spectrograms, not only can more detailed features on the target spectrogram be focused on, but different numbers of spectrogram blocks can also be converted into audio embedding sequences with the same feature dimension to meet the feature dimension requirements of audio recognition tasks, thus achieving the goal of balancing the audio recognition accuracy requirements of variable-length audio and the feature dimension requirements of audio recognition tasks.
[0174] Figure 11 This is a schematic diagram of another audio processing device provided in the embodiments of this application.
[0175] For example, such as Figure 11 As shown, the device 1100 includes:
[0176] The spectrum extraction module 1101 is used to extract spectral features from the sample audio to obtain the sample spectrum map corresponding to the sample audio.
[0177] The image segmentation module 1102 is used to segment the sample spectrogram to obtain at least two sample spectrogram blocks, wherein the number of sample spectrogram blocks is positively correlated with the sample audio length of the sample audio.
[0178] Feature extraction module 1103 is used to extract audio features from each of the sample spectrum blocks to obtain the first sample audio embedding sequence corresponding to the sample audio. The feature dimensions of the first sample audio embedding sequence corresponding to sample audios of different sample audio lengths are the same.
[0179] The audio recognition module 1104 is used to input the first sample audio embedding sequence into the large language model to obtain the sample audio recognition result output by the large language model;
[0180] Training module 1105 is used to train the large language model based on the sample audio recognition results and the standard audio recognition results.
[0181] Optionally, the image segmentation module 1102 is further configured to:
[0182] Based on the length of the sample audio corresponding to the sample audio, the sample segmentation parameters corresponding to the sample spectrogram are determined. The sample segmentation parameters include the number of sample columns and the number of sample rows. The number of sample columns is positively correlated with the length of the sample audio.
[0183] Based on the sample segmentation parameters, the sample spectrogram is segmented to obtain at least two sample spectrogram blocks.
[0184] Optionally, the feature extraction module 1103 is further configured to:
[0185] Each of the sample spectrum blocks is input into the audio conversion network to obtain the first sample audio feature matrix output by the audio conversion network. The number of columns in the first sample audio feature matrix is positively correlated with the sample audio length.
[0186] The first sample audio feature matrix is downsampled to obtain the second sample audio feature matrix. Different sample audio lengths correspond to different downsampling factors of the sample audio, and after downsampling, the sample audio of different sample audio lengths corresponds to the same number of columns in the second sample audio feature matrix.
[0187] The second sample audio feature matrix is merged in chronological order to obtain the first sample audio embedding sequence.
[0188] Optionally, the device further includes:
[0189] The acquisition module is used to acquire sample description information corresponding to the sample audio, wherein the sample description information includes at least one of audio type information, audio scene information, audio event information, and audio speaker scene information corresponding to the sample audio;
[0190] The text processing module is used to perform word segmentation and text feature extraction on the sample description information to obtain the first sample text feature sequence corresponding to the sample description information;
[0191] The alignment processing module is used to perform multimodal data alignment on the first sample text feature sequence and the first sample audio embedding sequence to obtain the aligned second sample audio embedding sequence and the second sample text feature sequence.
[0192] The audio recognition module 1104 is also used for:
[0193] The second sample audio embedding sequence and the second sample text feature sequence are input into the large language model to obtain the sample audio recognition result output by the large language model.
[0194] Optionally, the audio recognition module 1104 is further configured to:
[0195] Obtain sample instruction words, which are used to instruct the recognition function to perform audio recognition on the sample audio;
[0196] The second sample audio embedding sequence, the second sample text feature sequence, and the sample instruction words are aligned in text space to obtain the aligned third sample audio embedding sequence, the third sample text feature sequence, and the sample instruction text features.
[0197] The third sample audio embedding sequence, the third sample text feature sequence, and the sample instruction text feature are input into the large language model to obtain the sample audio recognition result output by the large language model. The sample audio recognition result is obtained after performing audio recognition on the sample audio according to the recognition function.
[0198] In summary, the embodiments of this application provide a training process for a large language model, enabling the large language model to process variable-length target audio, extracting high-dimensional audio information corresponding to different audio lengths while also meeting the feature dimension requirements of the large language model.
[0199] Figure 12 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application.
[0200] For example, such as Figure 12 As shown, the computer device 1200 in this application may include one or more of the following components: processor 1210 and memory 1220.
[0201] Processor 1210 may include one or more processing cores. Processor 1210 connects to various parts within the computer device 1200 using various interfaces and lines, and performs various functions and processes data of the computer device 1200 by running or executing instructions, programs, code sets, or instruction sets stored in memory 1220, and by calling data stored in memory 1220. Optionally, processor 1210 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 1210 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display on the screen; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 1210 and may be implemented separately using a baseband chip.
[0202] The memory 1220 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 1220 may include a non-transitory computer-readable storage medium. The memory 1220 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 1220 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), instructions for implementing the various method embodiments described above, etc. The operating system may be an Android system (including systems deeply developed based on the Android system), an iOS system developed by Apple Inc. (including systems deeply developed based on the iOS system), or other systems. The data storage area may also store data created by the computer device 1200 during use (such as phone books, audio and video data, chat log data, etc.).
[0203] In addition, those skilled in the art will understand that the structure of the computer device 1200 shown in the above figures does not constitute a limitation on the computer device 1200. The computer device may include more or fewer components than shown, or combine certain components, or have different component arrangements. For example, the computer device 1200 also includes radio frequency circuits, imaging components, sensors, audio circuits, Wireless Fidelity (WiFi) components, power supplies, Bluetooth components, etc., which will not be described in detail here.
[0204] The computer device provided in the embodiments of this application may specifically be a chip, component or module. The computer device may include a connected processor and a memory. The memory is used to store instructions. When the computer device is running, the processor may call and execute the instructions to cause the chip to perform any of the audio processing methods described above.
[0205] This embodiment provides a computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform any of the aforementioned audio processing methods.
[0206] This embodiment also provides a computer program product containing instructions. When the computer program product is run on a computer or processor, it causes the computer or processor to perform the aforementioned related steps to implement any of the audio processing methods described above.
[0207] In this embodiment, the computer device, computer-readable storage medium, computer program product containing instructions, or chip are all used to execute the corresponding audio processing method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding method provided above, and will not be repeated here.
[0208] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0209] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0210] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An audio processing method, characterized in that, The method includes: Spectral features are extracted from the target audio to obtain the target spectrogram corresponding to the target audio; The target spectrogram is segmented to obtain at least two target spectrogram blocks, and the number of target spectrogram blocks is positively correlated with the target audio length of the target audio. Audio features are extracted from each of the target spectral blocks to obtain the first audio embedding sequence corresponding to the target audio. The feature dimensions of the first audio embedding sequence corresponding to the target audio with different target audio lengths are the same. Obtain audio description information corresponding to the target audio, wherein the audio description information includes at least one of the following: language type information, audio event information, audio speaker scene information, and audio speaker information corresponding to the target audio; The audio description information is segmented into words and text features are extracted to obtain the first text feature sequence corresponding to the audio description information; Multimodal data alignment is performed on the first text feature sequence and the first audio embedding sequence to obtain the aligned second audio embedding sequence and the second text feature sequence; Audio recognition is performed based on the second audio embedding sequence and the second text feature sequence to obtain the target audio recognition result corresponding to the target audio.
2. The method according to claim 1, characterized in that, The image segmentation of the target spectrogram to obtain at least two target spectrogram blocks includes: Based on the target audio length corresponding to the target audio, image segmentation parameters corresponding to the target spectrogram are determined. The image segmentation parameters include the number of target columns and the number of target rows. The number of target columns is positively correlated with the target audio length. The target spectrogram is segmented based on the image segmentation parameters to obtain at least two target spectrogram blocks.
3. The method according to claim 1, characterized in that, The step of extracting audio features from each of the target spectral blocks to obtain the first audio embedding sequence corresponding to the target audio includes: Each of the target spectral blocks is input into an audio conversion network to obtain a first audio feature matrix output by the audio conversion network. The number of columns in the first audio feature matrix is positively correlated with the length of the target audio. The first audio feature matrix is downsampled to obtain the second audio feature matrix. Different target audio lengths correspond to different downsampling factors for the target audio, and after downsampling, the number of columns in the second audio feature matrix is the same for target audio of different lengths. The second audio feature matrix is merged in chronological order to obtain the first audio embedding sequence.
4. The method according to claim 1, characterized in that, The step of performing audio recognition based on the second audio embedding sequence and the second text feature sequence to obtain the target audio recognition result corresponding to the target audio includes: Obtain the target instruction word, which is used to instruct the recognition function to perform audio recognition on the target audio; The second audio embedding sequence, the second text feature sequence, and the target instruction word are aligned in text space to obtain the aligned third audio embedding sequence, the third text feature sequence, and the target instruction text feature; The third audio embedding sequence, the third text feature sequence, and the target instruction text feature are input into a large language model to obtain the target audio recognition result output by the large language model. The target audio recognition result is obtained by performing audio recognition on the target audio according to the recognition function.
5. An audio processing method, characterized in that, The method includes: Spectral features are extracted from the sample audio to obtain the sample spectrum map corresponding to the sample audio; The sample spectrogram is segmented to obtain at least two sample spectrogram blocks, and the number of sample spectrogram blocks is positively correlated with the sample audio length of the sample audio. Audio features are extracted from each of the sample spectral blocks to obtain the first sample audio embedding sequence corresponding to the sample audio. The feature dimensions of the first sample audio embedding sequence corresponding to sample audios of different lengths are the same. Obtain sample description information corresponding to the sample audio, wherein the sample description information includes at least one of audio type information, audio scene information, audio event information, and audio speaker scene information corresponding to the sample audio; The sample description information is segmented into words and text features are extracted to obtain the first sample text feature sequence corresponding to the sample description information; Multimodal data alignment is performed on the first sample text feature sequence and the first sample audio embedding sequence to obtain the aligned second sample audio embedding sequence and the second sample text feature sequence. The second sample audio embedding sequence and the second sample text feature sequence are input into the large language model to obtain the sample audio recognition result output by the large language model; The large language model is trained based on the sample audio recognition results and the standard audio recognition results.
6. The method according to claim 5, characterized in that, The image segmentation of the sample spectrogram to obtain at least two sample spectrogram blocks includes: Based on the length of the sample audio corresponding to the sample audio, the sample segmentation parameters corresponding to the sample spectrogram are determined. The sample segmentation parameters include the number of sample columns and the number of sample rows. The number of sample columns is positively correlated with the length of the sample audio. Based on the sample segmentation parameters, the sample spectrogram is segmented to obtain at least two sample spectrogram blocks.
7. The method according to claim 5, characterized in that, The step of extracting audio features from each of the sample spectral blocks to obtain the first sample audio embedding sequence corresponding to the sample audio includes: Each of the sample spectrum blocks is input into the audio conversion network to obtain the first sample audio feature matrix output by the audio conversion network. The number of columns in the first sample audio feature matrix is positively correlated with the sample audio length. The first sample audio feature matrix is downsampled to obtain the second sample audio feature matrix. Different sample audio lengths correspond to different downsampling factors of the sample audio, and after downsampling, the sample audio of different sample audio lengths corresponds to the same number of columns in the second sample audio feature matrix. The second sample audio feature matrix is merged in chronological order to obtain the first sample audio embedding sequence.
8. The method according to claim 5, characterized in that, The step of inputting the second sample audio embedding sequence and the second sample text feature sequence into the large language model to obtain the sample audio recognition result output by the large language model includes: Obtain sample instruction words, which are used to instruct the recognition function to perform audio recognition on the sample audio; The second sample audio embedding sequence, the second sample text feature sequence, and the sample instruction words are aligned in text space to obtain the aligned third sample audio embedding sequence, the third sample text feature sequence, and the sample instruction text features. The third sample audio embedding sequence, the third sample text feature sequence, and the sample instruction text feature are input into the large language model to obtain the sample audio recognition result output by the large language model. The sample audio recognition result is obtained after performing audio recognition on the sample audio according to the recognition function.
9. An audio processing device, characterized in that, The device includes: The spectrum extraction module is used to extract the spectrum features of the target audio to obtain the target spectrum map corresponding to the target audio. An image segmentation module is used to segment the target spectrogram to obtain at least two target spectral blocks, wherein the number of target spectral blocks is positively correlated with the target audio length of the target audio. The feature extraction module is used to extract audio features from each of the target spectral blocks to obtain a first audio embedding sequence corresponding to the target audio. The feature dimensions of the first audio embedding sequence corresponding to the target audio of different lengths are the same. The acquisition module is used to acquire audio description information corresponding to the target audio, wherein the audio description information includes at least one of the following: language type information, audio event information, audio speaker scene information, and audio speaker information corresponding to the target audio; The text processing module is used to perform word segmentation and text feature extraction on the audio description information to obtain the first text feature sequence corresponding to the audio description information; The alignment processing module is used to perform multimodal data alignment on the first text feature sequence and the first audio embedding sequence to obtain the aligned second audio embedding sequence and the second text feature sequence. An audio recognition module is used to perform audio recognition based on the second audio embedding sequence and the second text feature sequence to obtain the target audio recognition result corresponding to the target audio.
10. An audio processing apparatus, characterized in that, The device includes: The spectrum extraction module is used to extract spectral features from the sample audio to obtain the sample spectrum map corresponding to the sample audio. The image segmentation module is used to segment the sample spectrogram to obtain at least two sample spectrum blocks, wherein the number of sample spectrum blocks is positively correlated with the sample audio length of the sample audio. The feature extraction module is used to extract audio features from each of the sample spectral blocks to obtain the first sample audio embedding sequence corresponding to the sample audio. The feature dimensions of the first sample audio embedding sequence corresponding to sample audios of different lengths are the same. The acquisition module is used to acquire sample description information corresponding to the sample audio, wherein the sample description information includes at least one of audio type information, audio scene information, audio event information, and audio speaker scene information corresponding to the sample audio; The text processing module is used to perform word segmentation and text feature extraction on the sample description information to obtain the first sample text feature sequence corresponding to the sample description information; The alignment processing module is used to perform multimodal data alignment on the first sample text feature sequence and the first sample audio embedding sequence to obtain the aligned second sample audio embedding sequence and the second sample text feature sequence. An audio recognition module is used to input the second sample audio embedding sequence and the second sample text feature sequence into a large language model to obtain the sample audio recognition result output by the large language model; The training module is used to train the large language model based on the sample audio recognition results and the standard audio recognition results.
11. A computer device, characterized in that, The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the computer device performs the audio processing method as described in any one of claims 1 to 4, or performs the audio processing method as described in any one of claims 5 to 8.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer or processor, cause the computer or processor to perform the audio processing method as described in any one of claims 1 to 4, or the audio processing method as described in any one of claims 5 to 8.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the audio processing method according to any one of claims 1 to 4, or performs the audio processing method according to any one of claims 5 to 8.
