Speech representation model pre-training method and device, electronic equipment and storage medium

Vector mapping and discretization of speech are performed through randomly initialized mapping matrices and codebook sets, which solves the problems of slow pre-training speed and poor stability of the speech representation model, and achieves efficient and stable pre-training of the speech representation model.

CN118737129AActive Publication Date: 2024-10-01BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410947093.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-10-01
Estimated Expiration
2044-07-15

AI Technical Summary

Technical Problem

The pre-training methods of speech representation models in the existing technology have problems such as slow training speed, difficulty in convergence, and poor stability.

Method used

The mapping matrix and codebook set are generated through random initialization, vector mapping is performed on the sample speech, the matching target codebook vector is searched for as a discretization label, and the masked audio frame sequence is input into the model to be trained for speech representation processing, and the model parameters are adjusted. until the preset conditions are met.

Benefits of technology

It improves the pre-training speed, convergence and stability of the speech representation model, and achieves efficient and stable speech pre-training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118737129A_ABST
    Figure CN118737129A_ABST
Patent Text Reader

Abstract

The invention relates to a voice representation model pre-training method and device, electronic equipment and a storage medium, and the method comprises the steps: randomly initializing a mapping matrix and a codebook set, and carrying out the vector mapping of each audio frame in an audio frame sequence of a sample voice based on the mapping matrix, and obtaining a mapping vector of each audio frame; searching a target codebook vector matched with each mapping vector from a codebook set, and taking a target index of the target codebook vector as a reference discretization label of the corresponding audio frame; inputting the shielded audio frame sequence into a to-be-trained voice representation model for voice representation processing to obtain a voice representation result; discretization label prediction is carried out on representation results corresponding to the shielded positions in the voice representation results; and based on the difference between the prediction discretization label corresponding to each shielded position and the corresponding reference discretization label, adjusting model parameters of the to-be-trained voice representation model to obtain a pre-trained voice representation model. According to the invention, the pre-training speed and stability of the voice representation model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a speech representation model pre-training method, device, electronic device and storage medium. Background Art

[0002] With the development of machine learning technology, in order to get rid of the dependence of speech recognition models on a large amount of speech annotation data, unlabeled speech data is usually used to pre-train speech representation models. Based on the pre-trained speech representation model, a speech recognition model that meets downstream tasks can be obtained in combination with a small amount of speech annotation data. Moreover, since the pre-training process of the speech representation model is independent of downstream tasks, the pre-trained speech representation model can be quickly adapted to a variety of different downstream tasks, achieving the effect of reuse.

[0003] However, the pre-training method for speech representation models in related technologies has problems such as slow training speed, difficult convergence and poor stability. Summary of the invention

[0004] The present disclosure provides a speech representation model pre-training method, device, electronic device and storage medium to at least solve the problems of slow training speed, difficult convergence and poor stability in the pre-training method of speech representation model in the related art. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, a speech representation model pre-training method is provided, comprising:

[0006] Generate a mapping matrix and a codebook set by random initialization; the codebook set represents the corresponding relationship between the codebook vector and the index;

[0007] Based on the mapping matrix, respectively perform vector mapping processing on each audio frame in the audio frame sequence corresponding to the sample speech to obtain a mapping vector of each audio frame;

[0008] Searching for a target codebook vector matching each of the mapping vectors from the codebook set, and using a target index corresponding to the target codebook vector matching each of the mapping vectors as a reference discretization label of the audio frame corresponding to each of the mapping vectors;

[0009] Inputting the masked audio frame sequence into the speech representation model to be trained for speech representation processing to obtain a speech representation result; the masked audio frame sequence is obtained based on masking multiple positions in the audio frame sequence;

[0010] For the representation results corresponding to each masked position in the speech representation results, respectively, discretized label prediction is performed to obtain a predicted discretized label corresponding to each masked position;

[0011] Based on the difference between the predicted discretized label corresponding to each of the masked positions and the reference discretized label of the audio frame of the masked position, the model parameters of the speech representation model to be trained are adjusted until the preset training end condition is met to obtain a pre-trained speech representation model.

[0012] In some exemplary embodiments, based on the mapping matrix, performing vector mapping processing on each audio frame in the audio frame sequence corresponding to the sample speech to obtain the mapping vector of each audio frame includes:

[0013] Extracting frequency domain features of each audio frame in the audio frame sequence to obtain a frame feature sequence corresponding to the audio frame sequence;

[0014] Performing global standardization processing on the frame feature sequence to obtain a standardized frame feature sequence;

[0015] The product between the mapping matrix and each standardized frame feature in the standardized frame feature sequence is determined to obtain a mapping vector for each audio frame in the audio frame sequence.

[0016] In some exemplary embodiments, performing global normalization on the frame feature sequence to obtain a standardized frame feature sequence includes:

[0017] Splicing each preset number of consecutive frame features in the frame feature sequence to obtain a spliced ​​frame feature sequence;

[0018] The spliced ​​frame feature sequence is globally standardized to obtain a standardized frame feature sequence.

[0019] In some exemplary embodiments, the step of inputting the masked audio frame sequence into a speech representation model to be trained for speech representation processing to obtain a speech representation result includes:

[0020] Downsampling the frame feature sequence for a preset number of times to obtain a downsampled frame feature sequence; the time length of each downsampled frame feature in the downsampled frame feature sequence is the same as the time length of the spliced ​​frame feature at the corresponding position in the spliced ​​frame feature sequence;

[0021] Replacing a plurality of down-sampled frame features in the down-sampled frame feature sequence with a preset masking identifier to obtain a masked down-sampled frame feature sequence;

[0022] The masked downsampled frame feature sequence is input into the speech representation model to be trained for speech representation processing to obtain a speech representation result.

[0023] In some exemplary embodiments, the characterization results corresponding to each masked position in the speech characterization result are respectively predicted with a discretized label to obtain a predicted discretized label corresponding to each masked position, which includes:

[0024] Obtaining a representation result corresponding to each masked position in the speech representation result;

[0025] For each characterization result corresponding to the obscured position, the probability that the characterization result belongs to each reference discretization label is predicted, and the reference discretization label corresponding to the maximum probability is determined as the predicted discretization label corresponding to the obscured position.

[0026] In some exemplary embodiments, the step of using the target index corresponding to the target codebook vector matching each of the mapping vectors as a reference discretization label of the audio frame corresponding to each of the mapping vectors includes:

[0027] Performing information entropy calculation on a target index sequence to obtain information entropy of a current sequence; the target index sequence is composed of target indexes corresponding to target codebook vectors matching each of the mapping vectors;

[0028] When the current sequence information entropy exceeds a preset sequence information entropy range, adjusting the codebook set to obtain an adjusted codebook set;

[0029] Using the adjusted codebook set as the codebook set, performing the steps of searching for a target codebook vector matching each of the mapping vectors from the codebook set, and calculating information entropy on a target index sequence to obtain information entropy of a current sequence, until the information entropy of the current sequence does not exceed the preset sequence information entropy range;

[0030] Each target index in the target index sequence corresponding to the current sequence information entropy that does not exceed the preset sequence information entropy range is used as a reference discretization label of the corresponding audio frame.

[0031] In some exemplary embodiments, the preset sequence information entropy range includes a preset sequence information entropy upper limit and a preset sequence information entropy lower limit; and the adjusting the codebook set to obtain the adjusted codebook set includes:

[0032] When the current sequence information entropy is less than the preset sequence information entropy lower limit, increasing the size of the codebook set, and using the codebook set after the size increase as the adjusted codebook set;

[0033] When the current sequence information entropy is greater than the preset sequence information entropy upper limit, the size of the codebook set is reduced, and the codebook set after the size reduction is used as the adjusted codebook set.

[0034] In some exemplary embodiments, generating a mapping matrix and a codebook set by random initialization includes:

[0035] The mapping matrix is ​​obtained by randomly initializing weights through uniform distribution;

[0036] The codebook set is obtained by randomly initializing the codebook vector through standard normal distribution.

[0037] In some exemplary embodiments, the codebook set includes a plurality of sub-codebook sets; and searching the codebook set for a target codebook vector matching each of the mapping vectors includes:

[0038] For each of the audio frames, a target subcodebook vector that is most similar to the mapping vector of the audio frame is searched from each of the subcodebook sets; wherein the target subcodebook vectors in each of the subcodebook sets constitute a target codebook vector that matches the mapping vector of the audio frame.

[0039] According to a second aspect of an embodiment of the present disclosure, a speech representation model pre-training device is provided, comprising:

[0040] A random initialization unit, configured to generate a mapping matrix and a codebook set by random initialization; the codebook set represents a corresponding relationship between a codebook vector and an index;

[0041] An audio frame mapping unit is configured to perform vector mapping processing on each audio frame in the audio frame sequence corresponding to the sample speech based on the mapping matrix to obtain a mapping vector of each audio frame;

[0042] a discretization label determination unit, configured to search for a target codebook vector matching each of the mapping vectors from the codebook set, and use a target index corresponding to the target codebook vector matching each of the mapping vectors as a reference discretization label of the audio frame corresponding to each of the mapping vectors;

[0043] A speech characterization unit is configured to input the masked audio frame sequence into a speech characterization model to be trained for speech characterization processing to obtain a speech characterization result; the masked audio frame sequence is obtained based on masking processing of multiple positions in the audio frame sequence;

[0044] A label prediction unit is configured to perform discretized label prediction on the representation results corresponding to each masked position in the speech representation results, respectively, to obtain a predicted discretized label corresponding to each masked position;

[0045] The model parameter adjustment unit is configured to adjust the model parameters of the speech representation model to be trained based on the difference between the predicted discretized labels corresponding to each of the masked positions and the reference discretized labels of the audio frames of the masked positions until the preset training end conditions are met, so as to obtain the pre-trained speech representation model.

[0046] In some exemplary embodiments, the audio frame mapping unit includes:

[0047] A frequency domain feature extraction unit is configured to extract frequency domain features of each audio frame in the audio frame sequence to obtain a frame feature sequence corresponding to the audio frame sequence;

[0048] A global standardization unit is configured to perform global standardization processing on the frame feature sequence to obtain a standardized frame feature sequence;

[0049] The mapping unit is configured to determine the product between the mapping matrix and each standardized frame feature in the standardized frame feature sequence to obtain a mapping vector of each audio frame in the audio frame sequence.

[0050] In some exemplary embodiments, the global normalization unit includes:

[0051] A frame feature splicing unit is configured to execute splicing of each consecutive preset number of frame features in the frame feature sequence to obtain a spliced ​​frame feature sequence;

[0052] The global standardization subunit is configured to perform global standardization processing on the spliced ​​frame feature sequence to obtain a standardized frame feature sequence.

[0053] In some exemplary embodiments, the speech representation unit includes:

[0054] A downsampling unit is configured to perform downsampling processing on the frame feature sequence for a preset number of times to obtain a downsampled frame feature sequence; the time length of each downsampled frame feature in the downsampled frame feature sequence is the same as the time length of the spliced ​​frame feature at the corresponding position in the spliced ​​frame feature sequence;

[0055] A replacement unit is configured to replace a plurality of down-sampled frame features in the down-sampled frame feature sequence with a preset masking identifier to obtain a masked down-sampled frame feature sequence;

[0056] The speech characterization subunit is configured to input the masked down-sampled frame feature sequence into the speech characterization model to be trained to perform speech characterization processing to obtain a speech characterization result.

[0057] In some exemplary embodiments, the label prediction unit includes:

[0058] A characterization result acquisition unit, configured to execute acquisition of a characterization result corresponding to each masked position in the speech characterization result;

[0059] The prediction subunit is configured to execute, for each characterization result corresponding to the obscured position, predict the probability that the characterization result belongs to each reference discretization label, and determine the reference discretization label corresponding to the maximum probability as the predicted discretization label corresponding to the obscured position.

[0060] In some exemplary embodiments, the discretization label determination unit includes:

[0061] An information entropy calculation unit is configured to perform information entropy calculation on a target index sequence to obtain information entropy of a current sequence; the target index sequence is composed of target indices corresponding to target codebook vectors matching each of the mapping vectors;

[0062] A codebook set adjustment unit, configured to adjust the codebook set to obtain an adjusted codebook set when the current sequence information entropy exceeds a preset sequence information entropy range;

[0063] a repeating execution unit configured to execute the steps of using the adjusted codebook set as the codebook set, searching for a target codebook vector matching each of the mapping vectors from the codebook set, and calculating information entropy on the target index sequence to obtain current sequence information entropy, until the current sequence information entropy does not exceed the preset sequence information entropy range;

[0064] The determination subunit is configured to execute the current sequence information entropy that does not exceed the preset sequence information entropy range, and each target index in the corresponding target index sequence is used as a reference discretization label of the corresponding audio frame.

[0065] In some exemplary embodiments, the preset sequence information entropy range includes a preset sequence information entropy upper limit and a preset sequence information entropy lower limit; and the codebook set adjustment unit includes:

[0066] A first codebook adjustment unit is configured to increase the size of the codebook set when the current sequence information entropy is less than the preset sequence information entropy lower limit, and use the codebook set after the size increase as the adjusted codebook set;

[0067] The second codebook adjustment unit is configured to reduce the size of the codebook set when the current sequence information entropy is greater than the preset sequence information entropy upper limit, and use the codebook set after the size reduction as the adjusted codebook set.

[0068] In some exemplary embodiments, the random initialization unit includes:

[0069] A first random initialization unit is configured to perform random initialization of weights through uniform distribution to obtain the mapping matrix;

[0070] The second random initialization unit is configured to perform random initialization of the codebook vector through standard normal distribution to obtain the codebook set.

[0071] In some exemplary embodiments, the codebook set includes multiple sub-codebook sets; when the discretization label determination unit searches for a target codebook vector matching each of the mapping vectors from the codebook set, it is specifically configured to perform a search for a target sub-codebook vector that is most similar to the mapping vector of the audio frame from each of the sub-codebook sets for each of the audio frames; wherein the target sub-codebook vectors in each of the sub-codebook sets constitute a target codebook vector matching the mapping vector of the audio frame.

[0072] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0073] processor;

[0074] a memory for storing instructions executable by the processor;

[0075] Among them, the processor is configured to execute the instructions to implement the speech representation model pre-training method of the first aspect above.

[0076] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the speech representation model pre-training method of the first aspect mentioned above.

[0077] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer program product, comprising a computer program, which, when executed by a processor, implements the speech representation model pre-training method of the first aspect described above.

[0078] The disclosed embodiment generates a mapping matrix and a codebook set by random initialization, and then performs vector mapping processing on each audio frame in the audio frame sequence corresponding to the sample speech based on the mapping matrix to obtain a mapping vector for each audio frame, searches for a target codebook vector matching each audio frame from the codebook set based on the mapping vector of each audio frame, uses a target index corresponding to the target codebook vector matching each audio frame as a reference discretized label for each audio frame, and inputs the masked audio frame sequence into the speech representation model to be trained for speech representation processing to obtain a speech representation result, performs discretized label prediction on the representation results corresponding to each masked position in the speech representation result to obtain a predicted discretized label corresponding to each masked position, and then adjusts the model parameters of the speech representation model to be trained based on the difference between the predicted discretized label corresponding to each masked position and the reference discretized label of the audio frame at the masked position until a preset training end condition is met to obtain a pre-trained speech representation model. In the above technical solution, the randomly initialized mapping matrix and codebook set are fixed throughout the pre-training process, so that the same input audio frame in the entire pre-training process always corresponds to a uniquely determined discrete label. There is no need to discretize the sample speech data in advance. Efficient and stable speech pre-training can be carried out by preparing the sample speech data, thereby improving the pre-training speed, convergence and stability of the speech representation model.

[0079] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0081] Figure 1 is a schematic diagram of an application environment of a speech representation model pre-training method according to an exemplary embodiment;

[0082] Figure 2 is a flowchart of a speech representation model pre-training method according to an exemplary embodiment;

[0083] Figure 3 is a flowchart of another speech representation model pre-training method according to an exemplary embodiment;

[0084] Figure 4 is a flowchart of another speech representation model pre-training method according to an exemplary embodiment;

[0085] Figure 5is a structural block diagram of a speech representation model pre-training device according to an exemplary embodiment;

[0086] Figure 6 It is a structural block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0087] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0088] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0089] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0090] Since speech is a continuous modal information, there are usually a lot of noise fluctuations. Therefore, when pre-training the speech representation model, it is usually necessary to discretize the speech. A reasonable discretization method can eliminate this data fluctuation to a certain extent, thereby helping the speech representation model to model the essential information of the speech data. For speech, its essential information is a limited sequence of pronunciation units. In addition, after discretization, speech can be equivalent to text information, so mature deep learning models and algorithms in the text field can be used directly.

[0091] One speech pre-training method in the related technology is to use a machine learning algorithm to simultaneously train a speech discretization network and a speech representation model. During the training process, the parameters of the speech discretization network and the speech representation model are updated. Since the speech discretization network is inaccurate at the beginning of training, the model requires a long period of time to learn a good discretization mapping, resulting in slow training speed, difficult convergence and poor stability.

[0092] Another speech pre-training method in the related technology is to cluster a large amount of speech data and then train the speech representation model using the cluster center number as the discretized label. The clustering process usually requires hundreds of GB of running memory and the clustering takes a long time. In addition, since the discretization of clustering speech information is not stable enough, more iterative pre-training is usually required to obtain better speech representation results, resulting in slow training speed and poor stability.

[0093] In view of this, the present disclosure provides a speech representation model pre-training method, which pre-trains the speech representation model by extracting speech discretization labels simply, quickly and stably, thereby improving the pre-training speed and stability of the speech representation model. The speech representation model pre-training method of the present disclosure embodiment is described in detail below in conjunction with the accompanying drawings.

[0094] See also Figure 1 , which is a schematic diagram of an application environment according to an exemplary embodiment, the application environment may include a terminal 110 and a server 120, and the terminal 110 and the server 120 may be connected via a wired network or a wireless network.

[0095] The terminal 110 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The terminal 110 may be installed with client software such as an application (Application, referred to as App) that provides a voice recognition function. The application may be an independent application or a subprogram in the application. The user of the terminal 110 may log in to the application using pre-registered user information, which may include an account number and a password. Exemplarily, the application may include a social application, a live broadcast application, a video application, etc.

[0096] The server 120 may be a server that provides background services for the application in the terminal 110, and the background services may be speech recognition, etc. The server 120 may store a speech recognition model, and the speech recognition model may be obtained by the server 120 fine-tuning a pre-trained speech representation model based on a preset speech recognition task, wherein the pre-trained speech representation model may be obtained by the server 120 pre-training a speech representation model to be trained based on unlabeled sample speech, and the speech representation model to be trained may be an encoding network based on a Transformer structure.

[0097] In the disclosed embodiments, server 120 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, an edge computing node, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0098] Figure 2 is a flowchart of a speech representation model pre-training method according to an exemplary embodiment. Figure 2 As shown, the following steps are included:

[0099] In step S201, a mapping matrix and a codebook set are generated by random initialization.

[0100] The codebook set represents the corresponding relationship between the codebook vector and the index.

[0101] Specifically, the mapping matrix is ​​used to map the input into a vector that matches the dimension of the codebook vector, and the size of the mapping matrix can be set based on actual needs. The codebook set includes multiple codebook vectors, each codebook vector corresponds to a unique index, and the index can be represented by a serial number. The scale of the codebook set can be characterized by the number of codebook vectors in the codebook set. The specific scale can be set based on actual needs, for example, it can be set to include 100 codebook vectors, and the index can be a serial number of 1 to 100.

[0102] It should be noted that the mapping matrix and codebook set generated by random initialization in the embodiment of the present disclosure are fixed during the model parameter adjustment process of the speech representation model, that is, they are not learnable or updateable during this process.

[0103] Exemplarily, generating a mapping matrix and a codebook set by initialization at any time may include: randomly initializing weights by uniform distribution to obtain the mapping matrix; and randomly initializing codebook vectors by standard normal distribution to obtain the codebook set.

[0104] In the specific implementation, uniformly distributed random initialization weights can be realized through the nn.init.xavier_uniform() function, which can calculate a reasonable initialization range according to the input and output dimensions, and then use uniformly distributed random initialization weights within this range, and then obtain the mapping matrix generated by random initialization.

[0105] The standard normal distribution can be used to randomly initialize the codebook vector through the F.normalize(torch.randn()) function, where the torch.randn() function can generate a random tensor that obeys the standard normal distribution, and then the F.normalize() function is used to normalize the tensor with the L2 norm. By initializing with random numbers from the standard normal distribution and L2 normalization, the codebook vector can be ensured to have a unit norm.

[0106] In the above implementation, the weights are randomly initialized by uniform distribution to obtain a randomly initialized mapping matrix, and the codebook vectors are randomly initialized by standard normal distribution to obtain a randomly initialized codebook set, so that the reference discretization labels can be determined more quickly and stably based on the mapping matrix and the codebook set, which is beneficial to improving the training speed and stability of the language representation model.

[0107] In step S203, based on the mapping matrix, vector mapping processing is performed on each audio frame in the audio frame sequence corresponding to the sample speech to obtain a mapping vector of each audio frame.

[0108] Specifically, after obtaining the aforementioned randomly initialized mapping matrix and codebook set, the mapping matrix and codebook set can be used to perform speech discretization processing on the sample speech to obtain a reference discretization label for each audio frame in the audio frame sequence corresponding to the sample speech, and the reference discretization label for each audio frame is the target index corresponding to the target codebook vector in the codebook set that matches the audio frame.

[0109] Specifically, for each audio frame in the audio frame sequence corresponding to the sample speech, a vector mapping process may be performed using the mapping matrix generated by the aforementioned random initialization method to map the audio frame into a mapping vector.

[0110] Among them, the audio frame sequence corresponding to the sample speech can be a plurality of audio frames obtained by performing frame processing and windowing processing on the sample speech, and each audio frame has a specified time length, which can be set based on actual needs. For example, the specified time length can be selected within a short time range of 10-30ms, and 10ms can be selected as an example.

[0111] In a specific implementation, the frame processing can be performed in a continuous segmentation manner or in an overlapping segmentation manner. Overlapping segmentation can make the transition between frames smooth and maintain their continuity. The overlapping part of the previous frame and the next frame is called frame shift. The ratio of frame shift to frame length can be 0 to 1 / 2. Windowing processing refers to using a window function to perform function mapping on the audio signal after framing, so that two adjacent audio data frames can transition smoothly, reduce the problem of discontinuous signals at the beginning and end of the data frame, make the global data have higher continuity, avoid the Gibbs effect, and through windowing processing, the audio signal that originally has no periodicity can also present some characteristics of a periodic function, which is conducive to signal analysis and processing. Exemplarily, the window function can be any type of window function such as a Hamming window, a rectangular window, or a Henning window.

[0112] In some exemplary embodiments, the above-mentioned step S203 may include: extracting frequency domain features of each audio frame in the audio frame sequence to obtain a frame feature sequence corresponding to the audio frame sequence; performing global normalization on the frame feature sequence to obtain a standardized frame feature sequence; determining the product between the mapping matrix and each standardized frame feature in the standardized frame feature sequence to obtain a mapping vector for each audio frame in the audio frame sequence.

[0113] Specifically, the frequency domain feature of each audio frame may be a Mel-Frequency Cepstral Coefficient (MFCC) or a Mel filter bank coefficient (FBank). Exemplarily, the frequency domain feature is an 80-dimensional FBank feature.

[0114] Among them, the global normalization process is used to compress the space where the frame features are located to reduce the differences between different frame features. In a specific implementation, when performing global normalization on a frame feature sequence, the mean and standard deviation of the frame features in the frame feature sequence can be calculated first; then for each frame feature, the mean is subtracted from the frame feature and then divided by the standard deviation to obtain the standardized frame feature corresponding to the frame feature, so that the standardized frame features corresponding to each frame feature in the frame feature sequence constitute a standardized frame feature sequence.

[0115] Specifically, for each standardized frame feature, the product between the mapping matrix and the standardized frame feature is calculated, specifically, the dot product, and the product is used as the mapping vector of the audio frame corresponding to the standardized frame feature.

[0116] The above-mentioned implementation method extracts the frequency domain features of each audio frame to obtain a corresponding frame feature sequence, and globally normalizes the frame feature sequence to obtain a standardized frame feature sequence, and then maps the standardized frame feature sequence into a mapping vector through a randomly initialized mapping matrix. This can effectively concentrate the speech vectors, so that the codebook utilization rate after discretization mapping is sufficiently high, thereby improving the accuracy of the mapping vectors of each audio frame, which is beneficial to improving the accuracy of subsequent discretization labels and enhancing the training effect of the speech representation model.

[0117] In step S205, a target codebook vector matching each of the mapping vectors is searched from the codebook set, and a target index corresponding to the target codebook vector matching each of the mapping vectors is used as a reference discretization label of the audio frame corresponding to each of the mapping vectors.

[0118] Specifically, for the mapping vector of each audio frame, the similarity between the mapping vector and each codebook vector in the codebook set is calculated, and the codebook vector corresponding to the maximum similarity is determined as the target codebook vector matching the mapping vector, and then based on the correspondence between the codebook vector and the index, the target index corresponding to the target codebook vector is obtained, and the target index is determined as the reference discretization label of the audio frame corresponding to the mapping vector. Then, the reference discretization labels of each audio frame in the audio frame sequence constitute a reference discretization label sequence.

[0119] In some exemplary embodiments, in order to improve the accuracy of discretized labels and make the discretization diverse, that is, speech signals with different meanings should be discretized into different labels, thereby improving the effect of speech pre-training, the aforementioned randomly initialized codebook set may include multiple sub-codebook sets, and then the above step S205 searches for the target codebook vector that matches each of the mapping vectors from the codebook set. For each audio frame, the target sub-codebook vector that is most similar to the mapping vector of the audio frame can be searched from each sub-codebook set, and then the target sub-codebook vectors in each sub-codebook set constitute the target codebook vector that matches the mapping vector of the audio frame. Then, the target index corresponding to the target codebook vector includes the target sub-index corresponding to each target sub-codebook vector. By using a combination of multiple sub-codebook sets, while ensuring the diversity of discretization, the number of codebook vectors required can be significantly reduced, thereby improving the speed of pre-training.

[0120] In step S207, the masked audio frame sequence is input into the speech representation model to be trained for speech representation processing to obtain a speech representation result.

[0121] The masked audio frame sequence is obtained based on masking multiple positions in the audio frame sequence, and the masking process may specifically be replacing the audio frames of each masked position in the audio frame sequence with a preset masking identifier, for example, the preset masking identifier may be [MASK]. In a specific implementation, multiple positions may be randomly selected from the audio frame sequence for masking, and the masked multiple positions may account for 15% of the total number of positions in the audio frame sequence.

[0122] In practical applications, frequency domain features of each audio frame in an audio frame sequence, such as FBank features, can be extracted to obtain a frame feature sequence corresponding to the audio frame sequence, and then multiple positions in the frame feature sequence can be masked to obtain a masked frame feature sequence. The masked frame feature sequence is then input into the speech representation model to be trained for speech representation processing to obtain a speech representation result.

[0123] The speech characterization result includes the characterization results of each position of the corresponding audio frame sequence, specifically including the characterization results corresponding to each masked position and the characterization results of each unmasked position.

[0124] In a specific implementation, the speech representation model to be trained may be an encoder based on a Transformer structure.

[0125] In step S209, discretized labels are predicted for the representation results corresponding to each masked position in the speech representation results, to obtain predicted discretized labels corresponding to each masked position.

[0126] Exemplarily, the representation results corresponding to each masked position in the speech representation results can be obtained; for each representation result corresponding to the masked position, the probability of the representation result belonging to each reference discretized label in the reference discretized label sequence is predicted, and the reference discretized label corresponding to the maximum probability is determined as the predicted discretized label corresponding to the masked position, thereby accurately classifying and predicting each masked position in combination with the reference discretized label sequence. Since the reference discretized label is obtained based on a randomly initialized fixed mapping matrix and codebook set, the classification prediction accuracy is improved while the stability and speed of the classification prediction are improved, which is beneficial to improving the training effect of the language representation model.

[0127] In step S211, based on the difference between the predicted discretized label corresponding to each of the masked positions and the reference discretized label of the audio frame of the masked position, the model parameters of the speech representation model to be trained are adjusted until the preset training end condition is met to obtain a pre-trained speech representation model.

[0128] Specifically, based on the difference between the predicted discretized label corresponding to each masked position and the reference discretized label of the audio frame of the masked position, a preset loss function is used to calculate the loss value, and then the model parameters of the speech representation model to be trained are adjusted in reverse based on the loss value, and the iterative training is continued based on the adjusted speech representation model to be trained until the preset training end condition is met and the training is terminated, and the model corresponding to the model parameters at the end of the training is determined as the pre-trained speech representation model. Among them, the preset training end condition can be that the number of iterations reaches the preset number of iterations, or the loss value reaches the preset loss threshold, or the difference between the loss values ​​of two adjacent iterations reaches the preset difference threshold. Exemplarily, the preset loss function can adopt a classification loss function, such as a cross entropy loss function.

[0129] In a specific implementation, a classifier for classification based on a reference discretized label sequence may be connected after the speech representation model to be trained, and the loss value may be calculated using the classifier.

[0130] It should be noted that in the above step S211, only the model parameters of the speech representation model to be trained are adjusted, and the above mapping matrix and codebook set are not updated.

[0131] The technical solution of the disclosed embodiment adopts a discretization method with random initialization, and the discretization is determined during the entire pre-training process, that is, the same input always corresponds to a uniquely determined discretized label. At the same time, there is no need to discretize the data in advance, and efficient and stable speech pre-training can be carried out as long as the original speech data is prepared, thereby improving the training speed and stability of the speech representation model.

[0132] In some exemplary embodiments, in order to reduce the amount of computation in the pre-training process and further improve the training efficiency, when performing global normalization processing on the frame feature sequence to obtain a standardized frame feature sequence, it can include: splicing each consecutive preset number of frame features in the frame feature sequence to obtain a spliced ​​frame feature sequence; and performing global normalization processing on the spliced ​​frame feature sequence to obtain a standardized frame feature sequence.

[0133] Among them, the preset number can be set based on actual experience. For example, the preset number can be 4. In this case, every 4 consecutive frame features in the frame feature sequence can be spliced ​​into a spliced ​​frame feature to obtain a spliced ​​frame feature sequence. Then, the mean and standard deviation of the spliced ​​frame features in the spliced ​​frame feature sequence are calculated. The mean is subtracted from each spliced ​​frame feature and divided by the standard deviation to obtain a standardized frame feature sequence.

[0134] The above-mentioned implementation method reduces the amount of discretization calculation and improves the discretization speed by splicing each consecutive preset number of frame features in the frame feature sequence to obtain a spliced ​​frame feature sequence, and globally standardizes the spliced ​​frame feature sequence and then performs vector mapping processing based on the mapping matrix, which is beneficial to improving the training efficiency of the speech representation model.

[0135] Based on this, in order to utilize the reference discretized label sequence obtained based on the above frame feature splicing, the aforementioned step S207 may include:

[0136] Downsampling the frame feature sequence for a preset number of times to obtain a downsampled frame feature sequence;

[0137] Replacing a plurality of down-sampled frame features in the down-sampled frame feature sequence with a preset masking identifier to obtain a masked down-sampled frame feature sequence;

[0138] The masked downsampled frame feature sequence is input into the speech representation model to be trained for speech representation processing to obtain a speech representation result.

[0139] Among them, the time length of each downsampled frame feature in the downsampled frame feature sequence is the same as the time length of the spliced ​​frame feature at the corresponding position in the spliced ​​frame feature sequence. In a specific implementation, the downsampling process can be implemented by the convolution process of the convolution layer, and the preset number of downsampling processes can be implemented by sequentially performing convolution processes on a preset number of cascaded convolution layers, and each convolution layer is implemented to perform a downsampling process once. Taking the time length of the frame feature as 10ms, and every 4 consecutive frame features are spliced ​​into a spliced ​​frame feature with a time length of 40ms as an example, two cascaded convolution layers can be used to sequentially perform convolution processes on the frame feature sequence, so as to obtain a downsampled frame feature sequence composed of downsampled frame features with a time length of 40ms.

[0140] A plurality of random downsampled frame features in the downsampled frame feature sequence are replaced with a preset masking mark, such as [MASK], to obtain a masked downsampled frame feature sequence, and then the masked downsampled frame feature sequence can be input into the speech representation model to be trained for speech representation processing to obtain a speech representation result.

[0141] The above-mentioned implementation method downsamples the frame feature sequence a preset number of times, so that the time length of each downsampled frame feature in the downsampled frame feature sequence is the same as the time length of the spliced ​​frame feature at the corresponding position in the spliced ​​frame feature sequence during the discretization process. Furthermore, while utilizing the reference discretized label sequence obtained based on the spliced ​​frame feature sequence, the amount of calculation is greatly reduced and the training efficiency of the speech representation model is improved.

[0142] In some exemplary embodiments, in order to ensure that the reference discretization labels obtained by speech discretization have sufficient diversity, that is, speech signals with different meanings should be discretized into different labels to improve the accuracy of the pre-trained speech representation model, such as Figure 3 As shown, the aforementioned step S205, when implementing the use of the target index corresponding to the target codebook vector matching each of the mapping vectors as the reference discretization label of the audio frame corresponding to each of the mapping vectors, may include:

[0143] In step S301, information entropy is calculated for the target index sequence to obtain information entropy of the current sequence.

[0144] The target index sequence is composed of target indices corresponding to the target codebook vectors matching the mapping vectors. The current sequence information entropy can characterize the diversity of the current target index sequence. Generally, the larger the sequence information entropy, the higher the diversity; conversely, the smaller the sequence information entropy, the lower the diversity.

[0145] In a specific implementation, the information entropy calculation of the target index sequence can be implemented using the following formula (1):

[0146]

[0147] Where H(X) represents the target index sequence X = {x 1, x 2, ……,x n} information entropy; p(x i ) represents the target index x in the target index sequence i The probability of occurrence of ; n represents the sequence length of the target index sequence X. Specifically, p(x i ) can be calculated by the following formula (2):

[0148]

[0149] Among them, f(x i ) represents the target index x i The frequency of occurrence in the target index sequence X can be calculated using the following formula (3):

[0150] f(x i )=N xi / n (3)

[0151] Among them, N xi Represents the target index x i The number of occurrences in the target index sequence X.

[0152] In step S303, when the current sequence information entropy exceeds a preset sequence information entropy range, the codebook set is adjusted to obtain an adjusted codebook set.

[0153] The preset sequence information entropy range may be set based on actual experience. The adjustment of the codebook set may be to regenerate the codebook set by random initialization.

[0154] Specifically, a preset sequence information entropy benchmark value H can be set based on actual experience. base , then set an acceptable variation range Δ relative to the preset sequence information entropy benchmark value, and then set the preset sequence information entropy benchmark value H base Based on ±Δ, the preset sequence information entropy range can be obtained. The specific preset sequence information entropy range can be expressed as (H base -Δ,H base +Δ), where H base -Δ is the lower limit of the information entropy of the preset sequence, H base +Δ is the upper limit of the information entropy of the preset sequence. Exemplarily, the preset sequence information entropy reference value H base Can be set to 8.43.

[0155] Based on this, continue to see Figure 3 , the above-mentioned adjustment of the codebook set to obtain the adjusted codebook set may include:

[0156] In step S3031, when the current sequence information entropy is less than the preset sequence information entropy lower limit, the size of the codebook set is increased, and the codebook set with the increased size is used as the adjusted codebook set.

[0157] In step S3033, when the current sequence information entropy is greater than the preset sequence information entropy upper limit, the size of the codebook set is reduced, and the codebook set after the size reduction is used as the adjusted codebook set.

[0158] Specifically, the current sequence information entropy is less than the preset sequence information entropy lower limit H base -Δ, it indicates that the current discretization diversity is insufficient, the diversity of the target index sequence is insufficient, and speech pre-training may cause mode collapse. At this time, the size of the codebook set can be increased to expand the codebook vector space so that the increased codebook set includes more codebook vectors.

[0159] The current sequence information entropy is greater than the preset sequence information entropy upper limit H base +Δ, it indicates that the current discretization is too dispersed and the diversity of the target index sequence is too high, which will make it difficult for speech pre-training to converge. At this time, the size of the codebook set can be reduced to reduce the codebook vector space so that the reduced-size codebook set includes fewer codebook vectors.

[0160] In the embodiment of the present disclosure, the adjustment of the codebook set may be to re-randomly initialize the codebook vector.

[0161] The above implementation method increases the size of the codebook set when the current sequence information entropy is less than the preset sequence information entropy lower limit, and reduces the size of the codebook set when the current sequence information entropy is greater than the preset sequence information entropy upper limit, thereby controlling the size of the codebook set within an appropriate range, so as to facilitate the effective regulation of discrete diversity.

[0162] In step S305, the adjusted codebook set is used as the codebook set, and the process returns to the aforementioned step S205 of searching the codebook set for a target codebook vector that matches each of the mapping vectors, as well as steps S301 to S303, until the current sequence information entropy does not exceed the preset sequence information entropy range, and then proceeds to the following step S307.

[0163] In step S307, each target index in the target index sequence corresponding to the current sequence information entropy that does not exceed the preset sequence information entropy range is used as a reference discretization label of the corresponding audio frame.

[0164] The above implementation method calculates the information entropy of the target index sequence obtained after discretization to obtain the current sequence information entropy, and then regulates the discretization process based on the current sequence information entropy, thereby ensuring that the final reference discretized label sequence has sufficient diversity, while ensuring the accuracy of the pre-trained speech representation model, improving the convergence speed, pre-training efficiency and stability of pre-training.

[0165] In order to facilitate understanding of the technical solution of the embodiment of the present disclosure, Figure 4 The speech representation model pre-training method of the embodiment of the present disclosure is exemplified.

[0166] like Figure 4As shown in the figure, first, a randomly initialized fully connected mapping matrix and codebook set are created, which are fixed throughout the pre-training process. Secondly, the Fbank features with a time length of 10ms are extracted from the input sample speech to obtain a frame feature sequence with 80 dimensions per frame. Next, the frame feature sequence is globally normalized to compress the spatial distribution of the frame features. After that, each frame feature after global normalization is mapped into a vector through a randomly initialized mapping matrix, and the similarity is calculated in the codebook set to obtain the index of the target codebook vector that is most similar to the vector as the corresponding reference discretization label. Finally, the frame feature sequence is randomly masked and sent to the speech representation model to be trained (Transformer) for speech representation to obtain the output speech representation result. The output speech representation result is used to classify and predict the input masked part (or discretized label prediction). The classified label is the corresponding reference discretized label. The classification loss is calculated by using the difference between the predicted discretized label corresponding to each input masked part and the reference discretized label corresponding to the corresponding input masked part. Based on the classification loss, the model parameters of the speech representation model to be trained (Transformer) are adjusted and iterative training is performed to obtain a pre-trained speech representation model. The above technical solution does not require training of the discretization module. The pre-training process is efficient, easy to converge and stable. There is no tedious and time-consuming discretization label extraction process. The discretization quality is good enough. It has been verified by experiments that it can meet relevant downstream tasks such as speech, songs, and speakers.

[0167] Figure 5 is a structural block diagram of a speech representation model pre-training device according to an exemplary embodiment. Figure 5 , the speech representation model pre-training device 500 comprises:

[0168] A random initialization unit 510 is configured to generate a mapping matrix and a codebook set by random initialization; the codebook set represents a correspondence between a codebook vector and an index;

[0169] The audio frame mapping unit 520 is configured to perform vector mapping processing on each audio frame in the audio frame sequence corresponding to the sample speech based on the mapping matrix to obtain a mapping vector of each audio frame;

[0170] The discretization label determination unit 530 is configured to search for a target codebook vector matching each of the mapping vectors from the codebook set, and use a target index corresponding to the target codebook vector matching each of the mapping vectors as a reference discretization label of the audio frame corresponding to each of the mapping vectors;

[0171] The speech characterization unit 540 is configured to input the masked audio frame sequence into the speech characterization model to be trained for speech characterization processing to obtain a speech characterization result; the masked audio frame sequence is obtained based on masking processing of multiple positions in the audio frame sequence;

[0172] The label prediction unit 550 is configured to perform discretized label prediction on the representation results corresponding to each masked position in the speech representation results, and obtain a predicted discretized label corresponding to each masked position;

[0173] The model parameter adjustment unit 560 is configured to adjust the model parameters of the speech representation model to be trained based on the difference between the predicted discretized labels corresponding to each of the masked positions and the reference discretized labels of the audio frames of the masked positions until the preset training end conditions are met, thereby obtaining a pre-trained speech representation model.

[0174] In some exemplary embodiments, the audio frame mapping unit 520 includes:

[0175] A frequency domain feature extraction unit is configured to extract frequency domain features of each audio frame in the audio frame sequence to obtain a frame feature sequence corresponding to the audio frame sequence;

[0176] A global standardization unit is configured to perform global standardization processing on the frame feature sequence to obtain a standardized frame feature sequence;

[0177] The mapping unit is configured to determine the product between the mapping matrix and each standardized frame feature in the standardized frame feature sequence to obtain a mapping vector of each audio frame in the audio frame sequence.

[0178] In some exemplary embodiments, the global normalization unit includes:

[0179] A frame feature splicing unit is configured to execute splicing of each consecutive preset number of frame features in the frame feature sequence to obtain a spliced ​​frame feature sequence;

[0180] The global standardization subunit is configured to perform global standardization processing on the spliced ​​frame feature sequence to obtain a standardized frame feature sequence.

[0181] In some exemplary embodiments, the speech representation unit 540 includes:

[0182] A downsampling unit is configured to perform downsampling processing on the frame feature sequence for a preset number of times to obtain a downsampled frame feature sequence; the time length of each downsampled frame feature in the downsampled frame feature sequence is the same as the time length of the spliced ​​frame feature at the corresponding position in the spliced ​​frame feature sequence;

[0183] A replacement unit is configured to replace a plurality of down-sampled frame features in the down-sampled frame feature sequence with a preset masking identifier to obtain a masked down-sampled frame feature sequence;

[0184] The speech characterization subunit is configured to input the masked down-sampled frame feature sequence into the speech characterization model to be trained to perform speech characterization processing to obtain a speech characterization result.

[0185] In some exemplary embodiments, the tag prediction unit 550 includes:

[0186] A characterization result acquisition unit, configured to execute acquisition of a characterization result corresponding to each masked position in the speech characterization result;

[0187] The prediction subunit is configured to execute, for each characterization result corresponding to the obscured position, predict the probability that the characterization result belongs to each reference discretization label, and determine the reference discretization label corresponding to the maximum probability as the predicted discretization label corresponding to the obscured position.

[0188] In some exemplary embodiments, the discretization label determination unit 530 includes:

[0189] An information entropy calculation unit is configured to perform information entropy calculation on a target index sequence to obtain information entropy of a current sequence; the target index sequence is composed of target indices corresponding to target codebook vectors matching each of the mapping vectors;

[0190] A codebook set adjustment unit, configured to adjust the codebook set to obtain an adjusted codebook set when the current sequence information entropy exceeds a preset sequence information entropy range;

[0191] a repeating execution unit configured to execute the steps of using the adjusted codebook set as the codebook set, searching for a target codebook vector matching each of the mapping vectors from the codebook set, and calculating information entropy on the target index sequence to obtain current sequence information entropy, until the current sequence information entropy does not exceed the preset sequence information entropy range;

[0192] The determination subunit is configured to execute the current sequence information entropy that does not exceed the preset sequence information entropy range, and each target index in the corresponding target index sequence is used as a reference discretization label of the corresponding audio frame.

[0193] In some exemplary embodiments, the preset sequence information entropy range includes a preset sequence information entropy upper limit and a preset sequence information entropy lower limit; and the codebook set adjustment unit includes:

[0194] A first codebook adjustment unit is configured to increase the size of the codebook set when the current sequence information entropy is less than the preset sequence information entropy lower limit, and use the codebook set after the size increase as the adjusted codebook set;

[0195] The second codebook adjustment unit is configured to reduce the size of the codebook set when the current sequence information entropy is greater than the preset sequence information entropy upper limit, and use the codebook set after the size reduction as the adjusted codebook set.

[0196] In some exemplary embodiments, the random initialization unit 510 includes:

[0197] A first random initialization unit is configured to perform random initialization of weights through uniform distribution to obtain the mapping matrix;

[0198] The second random initialization unit is configured to perform random initialization of the codebook vector through standard normal distribution to obtain the codebook set.

[0199] In some exemplary embodiments, the codebook set includes multiple sub-codebook sets; when the discretization label determination unit 530 searches for a target codebook vector matching each of the mapping vectors from the codebook set, it is specifically configured to perform a search for a target sub-codebook vector that is most similar to the mapping vector of the audio frame from each of the sub-codebook sets for each of the audio frames; wherein the target sub-codebook vectors in each of the sub-codebook sets constitute a target codebook vector matching the mapping vector of the audio frame.

[0200] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0201] In an exemplary embodiment, an electronic device is also provided, including a processor; a memory for storing instructions executable by the processor; wherein, when the processor is configured to execute the instructions stored in the memory, the speech representation model pre-training method provided in any of the above embodiments is implemented.

[0202] The electronic device may be a terminal, a server or a similar computing device. For example, the electronic device is a server. Figure 6 is a block diagram of an electronic device for running a speech representation model pre-training method according to an exemplary embodiment, such as Figure 6As shown, the server 600 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1010 (the processor 610 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 630 for storing data, and one or more storage media 620 (such as one or more mass storage devices) for storing application programs 623 or data 622. Among them, the memory 630 and the storage medium 620 can be short-term storage or permanent storage. The program stored in the storage medium 620 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 610 can be configured to communicate with the storage medium 620 and execute a series of instruction operations in the storage medium 620 on the server 600. The server 600 may also include one or more power supplies 660, one or more wired or wireless network interfaces 650, one or more input and output interfaces 640, and / or one or more operating systems 621, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0203] The input / output interface 640 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 600. In one example, the input / output interface 640 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 640 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0204] It can be understood by those skilled in the art that Figure 6 The structure shown is for illustration only and does not limit the structure of the above electronic device. Figure 6 More or fewer components as shown, or with Figure 6 Different configurations shown.

[0205] In an exemplary embodiment, a computer-readable storage medium is also provided. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the speech representation model pre-training method provided in any of the above embodiments.

[0206] In an exemplary embodiment, a computer program product is also provided, including a computer program, which, when executed by a processor, implements the speech representation model pre-training method provided in any of the above embodiments.

[0207] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0208] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A speech representation model pre-training method, characterized in that: include: Generate a mapping matrix and a codebook set by random initialization; The codebook set represents the corresponding relationship between the codebook vector and the index; Based on the mapping matrix, respectively perform vector mapping processing on each audio frame in the audio frame sequence corresponding to the sample speech to obtain a mapping vector of each audio frame; Searching for a target codebook vector matching each of the mapping vectors from the codebook set, and using a target index corresponding to the target codebook vector matching each of the mapping vectors as a reference discretization label of the audio frame corresponding to each of the mapping vectors; Inputting the masked audio frame sequence into the speech representation model to be trained for speech representation processing to obtain a speech representation result; the masked audio frame sequence is obtained based on masking multiple positions in the audio frame sequence; For the representation results corresponding to each masked position in the speech representation results, respectively, discretized label prediction is performed to obtain a predicted discretized label corresponding to each masked position; Based on the difference between the predicted discretized label corresponding to each of the masked positions and the reference discretized label of the audio frame of the masked position, the model parameters of the speech representation model to be trained are adjusted until the preset training end condition is met to obtain a pre-trained speech representation model.

2. The method according to claim 1, characterized in that Based on the mapping matrix, vector mapping is performed on each audio frame in the audio frame sequence corresponding to the sample speech to obtain the mapping vector of each audio frame, which includes: Extracting frequency domain features of each audio frame in the audio frame sequence to obtain a frame feature sequence corresponding to the audio frame sequence; Performing global standardization processing on the frame feature sequence to obtain a standardized frame feature sequence; The product between the mapping matrix and each standardized frame feature in the standardized frame feature sequence is determined to obtain a mapping vector for each audio frame in the audio frame sequence.

3. The method according to claim 2, characterized in that The performing global standardization on the frame feature sequence to obtain a standardized frame feature sequence comprises: Splicing each preset number of consecutive frame features in the frame feature sequence to obtain a spliced ​​frame feature sequence; The spliced ​​frame feature sequence is globally standardized to obtain a standardized frame feature sequence.

4. The method according to claim 3, characterized in that The step of inputting the masked audio frame sequence into the speech representation model to be trained for speech representation processing to obtain a speech representation result includes: Downsampling the frame feature sequence for a preset number of times to obtain a downsampled frame feature sequence; the time length of each downsampled frame feature in the downsampled frame feature sequence is the same as the time length of the spliced ​​frame feature at the corresponding position in the spliced ​​frame feature sequence; Replacing a plurality of down-sampled frame features in the down-sampled frame feature sequence with a preset masking identifier to obtain a masked down-sampled frame feature sequence; The masked downsampled frame feature sequence is input into the speech representation model to be trained for speech representation processing to obtain a speech representation result.

5. The method according to claim 1, characterized in that The discretized label prediction is performed on the representation results corresponding to each masked position in the speech representation results to obtain the predicted discretized label corresponding to each masked position, which includes: Obtaining a representation result corresponding to each masked position in the speech representation result; For each characterization result corresponding to the obscured position, the probability that the characterization result belongs to each reference discretization label is predicted, and the reference discretization label corresponding to the maximum probability is determined as the predicted discretization label corresponding to the obscured position.

6. The method according to claim 1, characterized in that The step of using the target index corresponding to the target codebook vector matched with each of the mapping vectors as a reference discretization label of the audio frame corresponding to each of the mapping vectors comprises: Performing information entropy calculation on a target index sequence to obtain information entropy of a current sequence; the target index sequence is composed of target indexes corresponding to target codebook vectors matching each of the mapping vectors; When the current sequence information entropy exceeds a preset sequence information entropy range, adjusting the codebook set to obtain an adjusted codebook set; Using the adjusted codebook set as the codebook set, performing the steps of searching the codebook set for a target codebook vector matching each of the mapping vectors, and calculating information entropy on a target index sequence to obtain information entropy of a current sequence, until the information entropy of the current sequence does not exceed the preset sequence information entropy range; Each target index in the target index sequence corresponding to the current sequence information entropy that does not exceed the preset sequence information entropy range is used as a reference discretization label of the corresponding audio frame.

7. The method according to claim 6, characterized in that The preset sequence information entropy range includes a preset sequence information entropy upper limit and a preset sequence information entropy lower limit; and the codebook set is adjusted to obtain an adjusted codebook set including: When the current sequence information entropy is less than the preset sequence information entropy lower limit, increasing the size of the codebook set, and using the codebook set after the size increase as the adjusted codebook set; When the current sequence information entropy is greater than the preset sequence information entropy upper limit, the size of the codebook set is reduced, and the codebook set after the size reduction is used as the adjusted codebook set.

8. The method according to claim 1, characterized in that The generating of the mapping matrix and the codebook set by random initialization includes: The mapping matrix is ​​obtained by randomly initializing weights through uniform distribution; The codebook set is obtained by randomly initializing the codebook vector through standard normal distribution.

9. The method according to claim 1, characterized in that: The codebook set includes a plurality of sub-codebook sets; and searching the codebook set for a target codebook vector matching each of the mapping vectors includes: For each of the audio frames, a target subcodebook vector that is most similar to the mapping vector of the audio frame is searched from each of the subcodebook sets; wherein the target subcodebook vectors in each of the subcodebook sets constitute a target codebook vector that matches the mapping vector of the audio frame.

10. A speech representation model pre-training device, characterized in that: include: A random initialization unit is configured to generate a mapping matrix and a codebook set by random initialization; The codebook set represents the corresponding relationship between the codebook vector and the index; An audio frame mapping unit is configured to perform vector mapping processing on each audio frame in the audio frame sequence corresponding to the sample speech based on the mapping matrix to obtain a mapping vector of each audio frame; a discretization label determination unit, configured to search for a target codebook vector matching each of the mapping vectors from the codebook set, and use a target index corresponding to the target codebook vector matching each of the mapping vectors as a reference discretization label of the audio frame corresponding to each of the mapping vectors; A speech characterization unit is configured to input the masked audio frame sequence into a speech characterization model to be trained for speech characterization processing to obtain a speech characterization result; the masked audio frame sequence is obtained based on masking processing of multiple positions in the audio frame sequence; A label prediction unit is configured to perform discretized label prediction on the representation results corresponding to each masked position in the speech representation results, respectively, to obtain a predicted discretized label corresponding to each masked position; The model parameter adjustment unit is configured to adjust the model parameters of the speech representation model to be trained based on the difference between the predicted discretized labels corresponding to each of the masked positions and the reference discretized labels of the audio frames of the masked positions until the preset training end conditions are met, so as to obtain the pre-trained speech representation model.

11. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the instructions to implement the speech representation model pre-training method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the speech representation model pre-training method as described in any one of claims 1 to 9.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the speech representation model pre-training method as described in any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Music neural network model pre-training method, electronic equipment and storage medium

    CN113408702A

  • Speech recognition model training method, speech recognition method and device

    CN116092499A

  • Speech neural feature extraction model training method and device, equipment and medium

    CN116778920A

  • Speech recognition model training method, speech recognition method, device and equipment

    CN117711383A

  • Contrast learning and masking modeling for end-to-end self-supervised pre-training

    CN117980915A