A method to improve Chongqing dialect speech recognition through transfer learning

CN116416967BActive Publication Date: 2024-09-24CHONGQING UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111651840.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2024-09-24
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

BERT等模型在文本生成任务中由于其双向attention机制,在NLG任务中效果有限

Benefits of technology

[0054]There is no doubt about the technical effect of the present invention. The present invention replaces the language model in ASR technology from a statistical model to a pre-training model based on large-scale predictions, which can capture semantic level information more comprehensively, and through the pipeline design model, The acoustic model and language model in ASR are independent, which enhances the diversity of ASR model selection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116416967B
    Figure CN116416967B
Patent Text Reader

Abstract

The present invention discloses a method for improving Chongqing dialect speech recognition through transfer learning, the steps are: 1) obtaining speech data; 2) obtaining a speech spectrogram; 3) vectorizing the speech spectrogram to obtain a vector V; 4) obtaining an input X of a transformer model; 5) inputting parameters Q, K, and V into an encoder of the transformer model to obtain encoder output Y1 and encoder output Y2; 6) inputting encoder output Y1 and encoder output Y2 into a decoder of the transformer model to obtain speech recognition text; 8) determining an input x of a pinyin BERT model; 9) inputting input x into the pinyin BERT model to obtain a speech recognition result. The present invention uses a pipeline design pattern to separate the acoustic model and the language model in ASR, thereby enhancing the diversity of ASR model selection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a field, and in particular to a method for improving Chongqing dialect speech recognition through transfer learning. Background Art

[0002] Speech recognition technology started in the 1950s and has achieved good results today. Similarly, natural language processing technology has gradually evolved from statistical models to deep semantic models along with the development of deep learning technology. It has been widely used in some classic NLP scenarios, such as NLG tasks and named entity recognition tasks.

[0003] Artificial intelligence products are widely used in various IT fields. ASR technology is an important part of artificial intelligence, which enables computers to "understand" human voices. The development of ASR technology helps people communicate with more artificial intelligence products and realize "human-computer interaction", so that people can enjoy the convenience and efficiency brought to life by technological development.

[0004] The implementation of ASR can be divided into pipeline or end2end ideas, among which the main difference lies in the recognition unit of the acoustic model. The size of the model recognition unit (word pronunciation model, character pronunciation model, semi-syllable model or phoneme model) has a great influence on the amount of speech training data, speech recognition rate, and flexibility. For speech recognition systems with medium vocabulary or above, the smaller the recognition unit, the smaller the amount of calculation, the smaller the required model storage, and the relatively smaller the amount of training data required. However, the problem is that it is difficult to locate and segment the corresponding speech segments, as well as more complex recognition model rules. Generally, large recognition units are easy to include co-articulation in the model, which is conducive to improving the recognition rate of the system, but the required training data is relatively increased.

[0005] In summary, language models based on statistics are limited in effect due to the expected size, and statistical information has limited expressive power at the semantic level. Existing technologies do not incorporate language models into acoustic models, and most deep learning-based acoustic models use CNN or RNN-like structures, which have limited computational efficiency. Models such as BERT have limited effects in NLG tasks due to their bidirectional attention mechanism in text generation tasks. Summary of the invention

[0006] The object of the present invention is to provide a method for improving Chongqing dialect speech recognition by transfer learning, comprising the following steps:

[0007] 1) Acquire voice data, wherein the voice data includes a dialect.

[0008] 2) Perform Fourier transform on the speech data to obtain a speech spectrogram.

[0009] 3) Use the VGG network to vectorize the speech spectrogram and obtain the vector v.

[0010] The vector v looks like this:

[0011] v=VGG(DFT(A)) (1)

[0012] Where A is the voice data.

[0013] 4) Obtain the input X of the transformer model. The transformer model includes encoder encoder1, encoder encoder2 and decoder decoder.

[0014] The input X of the transformer looks like this:

[0015] X=PE(DFT(A))+Fbank(v) (2)

[0016] Where PE is the position encoding function.

[0017] 5) Transform the input X to obtain parameters Q, K, and V.

[0018] Q=XW Q ,K=XW K ,V=XW V (3)

[0019] 6) Input the parameters Q, K, and V into the encoders encoder1 and encoder2 of the transformer model to obtain encoder output Y1 and encoder output Y2 respectively.

[0020] Parameters Q, K, and V are as follows:

[0021] The encoder includes a multi-head attention layer and a forward propagation layer.

[0022] The output of the multi-head attention layer MultiHead(Q,K,V) is as follows:

[0023] MultiHead(Q,K,V)=Concat(head1,...,head h )W O (4)

[0024] Among them, the parameter head i As shown below:

[0025] head i =Attention(QW i Q ,KWi K ,VW i V ),i=1,2,...,h (5)

[0026] Where h is the number of attention layers; W i Q , W i K , W i V is the weight of the i-th layer.

[0027] Attention(Q,K,V) is as follows:

[0028]

[0029] In the formula, is the normalization parameter;

[0030] The output FFN(x) of the forward propagation layer is as follows:

[0031] FFN(x)=max(0,xW1+b1)W2+b2 (7)

[0032] The input x of the forward propagation layer is as follows:

[0033] x=norm(X+MultiHead(Q,K,V)) (8)

[0034] The output Y of the encoder is as follows:

[0035] Y=FFN(x) (9)

[0036] 7) Input the encoder output Y1 and encoder output Y2 into the decoder of the transformer model to obtain the speech recognition text.

[0037] 8) Based on the speech recognition text, determine the input x of the Pinyin BERT model.

[0038] The input x of the Pinyin BERT model is as follows:

[0039] x=Concat(CE,GE,PYE)W F +PE (10)

[0040] Where CE represents character embedding. GE represents glyph embedding. PYE represents pinyin embedding. PE represents position embedding. F Represents a fully connected layer. Concat represents vector concatenation.

[0041] The glyph embedding GE is as follows:

[0042] GE=Concat(flatten(I1),flatten(I2),flatten(I3))W G (11)

[0043] Where I1, I2, and I3 represent the glyph images. G Represents a fully connected layer. Flatten represents converting a two-dimensional image into a one-dimensional vector.

[0044] Pinyin is embedded in PYE as follows:

[0045] PYE=max-pooling(CNN(S)) (12)

[0046] In the formula, S represents the pinyin sequence. max-pooling represents the maximum pooling. CNN represents the convolution calculation.

[0047] 9) Input the input x into the Pinyin BERT model to obtain the speech recognition result.

[0048] Speech recognition result p(x1,x2,x3,...,x n ) is as follows:

[0049] p(x1,x2,x3,…,x n )=p(x1)p(x2|x1)p(x3|x1,x2)...p(x n |x1,x2,...,x n-1 )

[0050] =p(x3)p(x1|x3)p(x2|x3,x1)...p(x n |x3,x1,...,x n-1 )...p(x n-1 )

[0051] =...

[0052] =p(x1|x n-1 )p(x n |x n-1 ,x1)...p(x2|x n-1 ,x1,...,x3) (13)

[0053] Where p(x2|x1) represents the probability distribution of speech recognition text.

[0054] The technical effect of the present invention is unquestionable. The present invention replaces the language model in ASR technology from a statistical model to a pre-trained model based on large-scale expectations, which can capture semantic level information more comprehensively. Through the pipeline design pattern, the acoustic model and language model in ASR are separated, thereby enhancing the diversity of ASR model selection.

[0055] The present invention places the embedding of the position in the acoustic model, so that the acoustic model has certain capabilities of a language model, and at the same time enhances the effectiveness of the acoustic model in extracting acoustic information and completing decoding.

[0056] The present invention captures language information in an all-round way by introducing embeddings such as pinyin and glyphs, which matches some difficulties of ASR in Chinese, such as the same initial consonants, the same finals, and the same pronunciation, and also improves the accuracy of the language model in the decoding process.

[0057] The present invention applies the UniLM model to the ASR scenario and improves the accuracy of ASR decoding by leveraging the effectiveness of the UniLM algorithm in text generation tasks.

[0058] In view of the excellent performance of NLP technology using pre-training methods in a large number of NLP tasks in recent years, the present invention proposes to use transformer as an acoustic model to obtain preliminary ASR results, and then use the pre-trained model (UniLM) obtained by combining its pinyin pre-training as a language model according to the expectations of the language scene, and finally obtain the ASR result output. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 For the speech recognition process;

[0060] Figure 2 It is the speech feature processing flow;

[0061] Figure 3 It is the transformer structure diagram;

[0062] Figure 4 Arrange for input;

[0063] Figure 5 To integrate the input information;

[0064] Figure 6 For pinyin embedding. DETAILED DESCRIPTION

[0065] The present invention is further described below in conjunction with the embodiments, but it should not be understood that the above subject matter of the present invention is limited to the following embodiments. Without departing from the above technical ideas of the present invention, various substitutions and changes are made according to the common technical knowledge and customary means in the art, which should all be included in the protection scope of the present invention.

[0066] Embodiment 1:

[0067] See also Figure 1 , Figure 2 , Figure 3 , Figure 4 , Figure 5 , Figure 6 , a method for improving Chongqing dialect speech recognition through transfer learning, comprising the following steps:

[0068] 1) Acquire voice data, wherein the voice data includes a dialect.

[0069] 2) Perform Fourier transform on the speech data to obtain a speech spectrogram.

[0070] 3) Use the VGG network to vectorize the speech spectrogram and obtain the vector v.

[0071] The vector v looks like this:

[0072] v=VGG(DFT(A)) (1)

[0073] Where A is the voice data.

[0074] 4) Obtain the input X of the transformer model. The transformer model includes encoder encoder1, encoder encoder2 and decoder decoder.

[0075] The input X of the transformer looks like this:

[0076] X=PE(DFT(A))+Fbank(v) (2)

[0077] Where PE is the position encoding function. Fbank() represents the speech feature extraction operation.

[0078] 5) Transform the input X to obtain parameters Q, K, and V.

[0079] Q=XW Q ,K=XW K ,V=XW V (3)

[0080] 6) Input the parameters Q, K, and V into the encoders encoder1 and encoder2 of the transformer model to obtain encoder output Y1 and encoder output Y2 respectively.

[0081] Parameters Q, K, and V are as follows:

[0082] The encoder includes a multi-head attention layer and a forward propagation layer.

[0083] The output of the multi-head attention layer MultiHead(Q,K,V) is as follows:

[0084] MultiHead(Q,K,V)=Concat(head1,...,head h )W O (4)

[0085] Among them, the parameter head i As shown below:

[0086] head i =Attention(QW i Q ,KW i K ,VW i V ),i=1,2,...,h (5)

[0087] Where h is the number of attention layers; W i Q , W i K , W i V is the weight of the i-th layer.

[0088] Attention(Q,K,V) is as follows:

[0089]

[0090] In the formula, is the normalization parameter;

[0091] The output FFN(x) of the forward propagation layer is as follows:

[0092] FFN(x)=max(0,xW1+b1)W2+b2 (7)

[0093] The input x of the forward propagation layer is as follows:

[0094] x=norm(X+MultiHead(Q,K,V)) (8)

[0095] The output Y of the encoder is as follows:

[0096] Y=FFN(x) (9)

[0097] 7) Input the encoder output Y1 and encoder output Y2 into the decoder of the transformer model to obtain the speech recognition text.

[0098] 8) Based on the speech recognition text, determine the input x of the Pinyin BERT model.

[0099] The input x of the Pinyin BERT model is as follows:

[0100] x=Concat(CE,GE,PYE)W F +PE (10)

[0101] Where CE represents character embedding. GE represents glyph embedding. PYE represents pinyin embedding. PE represents position embedding. F Represents a fully connected layer. Concat represents vector concatenation.

[0102] The glyph embedding GE is as follows:

[0103] GE=Concat(flatten(I1),flatten(I2),flatten(I3))W G (11)

[0104] Where I represents the glyph image. G Represents a fully connected layer. Flatten represents converting a two-dimensional image into a one-dimensional vector.

[0105] Pinyin is embedded in PYE as follows:

[0106] PYE=max-pooling(CNN(S)) (12)

[0107] In the formula, S represents the pinyin sequence. max-pooling represents the maximum pooling. CNN represents the convolution calculation.

[0108] 9) Input the input x into the Pinyin BERT model to obtain the speech recognition result.

[0109] Speech recognition result p(x1,x2,x3,...,x n ) is as follows:

[0110] p(x1,x2,x3,...,x n )=p(x1)p(x2|x1)p(x3|x1,x2)...p(x n|x1,x2,...,x n-1 )

[0111] =p(x3)p(x1|x3)p(x2|x3,x1)…p(x n |x3,x1,...,x n-1 )...p(x n-1 )

[0112] =...

[0113] =p(x1|x n-1 )p(x n |x n-1 ,x1)...p(x2|x n-1 ,x1,...,x3) (13)

[0114] Where p(x2|x1) represents the probability distribution of speech recognition text.

[0115] Embodiment 2:

[0116] A method for improving Chongqing dialect speech recognition through transfer learning, comprising the following steps:

[0117] 1) Based on the audio, signal processing technology and Fourier transform are used to obtain the spectrum of a single audio file, and the vector expression of the entire structure graph is extracted through the VGG network structure.

[0118] The formula can be expressed as:

[0119] V=VGG(DFT(A))

[0120] A: audio file; DFT: discrete Fourier transform; VGG: VGG network; V: vector representation of VGG output

[0121] 2) According to the spectrum graph, the position information of each spectrum unit in the original image is obtained, and after its embedding is vectorized, it is input into the transformer together with Fbank.

[0122] Encoder calculation process and formula:

[0123] The transformer input X consists of two parts: position encoding and Fbank. PE is the position encoding function:

[0124] X=PE(DFT(A))+Fbank(V)

[0125] Convert input X to Q, K, V:

[0126] Q=XW Q ,K=XW K,V=XW V

[0127] Attention calculation formula:

[0128]

[0129] Multi-head attention layer:

[0130] MultiHead(Q,K,V)=Concat(head1,...,head h )W O

[0131] in:

[0132] head i =Attention(QW i Q ,KW i K ,VW i V ),i=1,2,...,h

[0133] Forward propagation layer:

[0134] FFN(x)=max(0,xW1+b1)W2+b2

[0135] in:

[0136] x = norm(X + MultiHead(Q,K,V))

[0137] The output of the encoder is:

[0138] Y=FFN(x)

[0139] The calculation process of decoder is similar to that of encoder. For details, refer to Figure 3 , I will not go into details.

[0140] 3) There are two major characteristics of Chinese characters: one is the glyph, and the other is the pinyin. Chinese characters are a typical logographic-phonetic character. From its origin, its glyph itself contains a part of the semantic meaning. For example, "rivers and lakes" all have the radical "三点水", which indicates that they are all related to water. From the perspective of pronunciation, the pinyin of Chinese characters can also reflect the semantic meaning of a Chinese character to a certain extent and play a role in differentiating word meanings. For example, the character "乐" has two pronunciations, yuè and lè. The former represents "music", which is a noun; the latter represents "happy", which is an adjective. For a polyphonic character, just inputting a single "乐", the model cannot know whether it should represent "music" or "happiness". At this time, additional pronunciation information is needed to eliminate bias. Starting from these two major characteristics of Chinese characters themselves, the glyph and pinyin information of Chinese characters are incorporated into the pre-training process of Chinese corpora. The glyph vector of a Chinese character is formed by multiple different fonts, while the pinyin vector is obtained from the corresponding romanized pinyin character sequence. The two are fused with the word vector to obtain the final fused vector, which is used as the input of the pre-training model. The model is trained using two strategies: Whole Word Masking and Character Masking, enabling the model to more comprehensively establish the connection between Chinese characters, glyphs, pronunciations, and contexts.

[0141] X = Concat(CE, GE, PYE)W F +PE

[0142] CE: Character Embedding, GE: Glyph Embedding, PYE: Pinyin Embedding, PE: Position Embedding, WF: Fully Connected Layer, X: Input of BERT, Concat: Vector Concatenation.

[0143] The underlying Fusion Layer fuses the Glyph Embedding and Pinyin Embedding except for the Character Embedding to obtain the Fusion Embedding, and then adds it to the Position Embedding to form the input of the model. The Glyph Embedding is obtained using Chinese character images of different fonts. Each image is of size 24*24. The images of the three fonts, FangSong, XingKai, and LiShu, are vectorized, concatenated, and then passed through a fully connected layer W G to obtain the Glyph Embedding of Chinese characters.

[0144] This process is as Figure 5 shown:

[0145] GE = Concat(flatten(I1), flatten(I2), flatten(I3))W G

[0146] I-shaped image, WG: fully connected layer, GE: glyph embedding, flatten: convert a two-dimensional image into a one-dimensional vector.

[0147] For pinyin embedding, pypinyin is first used to convert the pinyin of each Chinese character into a character sequence of romanized characters, which also includes tones. For example, for the Chinese character "猫" (cat), its pinyin character sequence is "mao1". For polyphonic characters such as "乐" (happy), pypinyin can accurately identify the correct pinyin in the current context.

[0148] This process is as Figure 6 shown below:

[0149] PYE = max - pooling(CNN(S))

[0150] S: pinyin sequence, max - pooling: max pooling, CNN: convolutional calculation, PYE: pinyin embedding.

[0151] 4) Combine the pre - trained model UniLM to generate the final ASR recognition result. Compared with the generation model based on the language model, since BERT's bidirectional decoding cannot meet the requirements of the language model, but by manually controlling the decoding direction through Mask attention, it can be changed from bidirectional to unidirectional:

[0152] p(x1,x2,x3,…,x n ) = p(x1)p(x2|x1)p(x3|x1,x2)…p(x n |x1,x2,...,x n-1 )

[0153] = p(x3)p(x1|x3)p(x2|x3,x1)…p(x n |x3,x1,...,x n-1 )…p(x n-1 )

[0154] = …

[0155] = p(x1|x n-1 )p(x n |x n-1 ,x1)…p(x2|x n-1 ,x1,...,x3)

[0156] x1,x2,…,x nAny "order of appearance" is possible. In principle, each order corresponds to a model, so in principle there are n! language models. Implementing a language model of order is equivalent to disrupting the original lower triangular form of the mask in some way. Because Attention provides such an n×n Attention matrix, the present invention has enough degrees of freedom to mask this matrix in different ways, thereby achieving diversified effects. Thus, the requirements of the language model are met.

Claims

1. A method for improving Chongqing dialect speech recognition through transfer learning, characterized in that: The following steps are involved: 1) Obtain voice data; 2) Perform Fourier transform on the speech data to obtain a speech spectrogram; 3) Use the VGG network to vectorize the speech spectrogram to obtain the vector v; 4) Obtaining an input X of a transformer model; the transformer model includes an encoder encoder1, an encoder encoder2, and a decoder decoder; 5) Transform the input X to obtain parameters Q, K, and V; 6) Input the parameters Q, K and V into the encoders encoder1 and encoder2 of the transformer model to obtain encoder output Y1 and encoder output Y2 respectively; 7) Input the encoder output Y1 and the encoder output Y2 into the decoder of the transformer model to obtain the speech recognition text; 8) Based on the speech recognition text, determine the input x of the Pinyin BERT model; 9) Input the input x into the Pinyin BERT model to obtain the speech recognition result; The vector v looks like this: v=VGG(DFT(A)) (1) In the formula, A is the voice data; The input X of the transformer looks like this: X=PE(DFT(A))+Fbank(v) (2) Where PE is the position encoding function; Parameters Q, K, and V are as follows: Q=XW Q ,K=XW K ,V=XW V (3)。 2. The method for improving Chongqing dialect speech recognition through transfer learning according to claim 1, characterized in that: The speech data includes a dialect.

3. The method for improving Chongqing dialect speech recognition through transfer learning according to claim 1, characterized in that: The encoder includes a multi-head attention layer and a forward propagation layer; The output of the multi-head attention layer MultiHead(Q,K,V) is as follows: MultiHead(Q,K,V)=Concat(head1,...,head h )W O (4) Among them, the parameter head i As shown below: head i =Attention(QW i Q ,KW i K ,VW i V ),i=1,2,...,h (5) Where h is the number of attention layers; W i Q , W i K , W i V is the weight of the i-th layer; Attention(Q,K,V) is as follows: In the formula, is the normalization parameter; The output FFN(x') of the forward propagation layer is as follows: FFN(x')=max(0,x'W1+b1)W2+b2 (7) The input x' to the forward propagation layer is as follows: x'=norm(X+MultiHead(Q,K,V)) (8) The output Y of the encoder is as follows: Y = FFN(x') (9).

4. The method for improving Chongqing dialect speech recognition through transfer learning according to claim 1, characterized in that: The input x of the Pinyin BERT model is as follows: x=Concat(CE,GE,PYE)W F +PE' (10) Where CE represents character embedding; GE represents glyph embedding; PYE represents pinyin embedding; PE' represents position embedding; W F Represents a fully connected layer; Concat represents vector concatenation.

5. The method for improving Chongqing dialect speech recognition through transfer learning according to claim 4, characterized in that: The glyph embedding GE is as follows: GE=Concat(flatten(I1),flatten(I2),flatten(I3))W G (11) Where I1, I2, I3 represent the glyph images; W G represents a fully connected layer; flatten represents converting a two-dimensional image into a one-dimensional vector.

6. The method for improving Chongqing dialect speech recognition through transfer learning according to claim 4, characterized in that: Pinyin is embedded in PYE as follows: PYE=max-pooling(CNN(S)) (12) In the formula, S represents the pinyin sequence; max-pooling represents maximum pooling; CNN represents convolution calculation.

7. The method for improving Chongqing dialect speech recognition through transfer learning according to claim 1, characterized in that: Speech recognition result p(x1,x2,x3,…,x n ) is as follows: p(x1,x2,x3,…,x n )=p(x1)p(x2|x1)p(x3|x1,x2)…p(x n |x1,x2,…,x n-1 ) =p(x3)p(x1|x3)p(x2|x3,x1)…p(x n |x3,x1,…,x n-1 )...p(x n-1 ) =... =p(x1|x n-1 )p(x n |x n-1 ,x1)…p(x2|x n-1 ,x1,...,x3) (13) Where p(x2|x1) represents the probability distribution of speech recognition text.