Speech recognition method and device, electronic equipment and computer readable medium

By using sparse weight matrix attention calculation and feature fusion technology in the intelligent outbound call system, the most relevant text content of the speech is selected and the speech features are integrated, which solves the problem of inaccurate speech recognition in the intelligent outbound call system and improves the recognition accuracy. sex.

CN118711575APending Publication Date: 2024-09-27JINGDONG CITY BEIJING DIGITS TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410871657.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

In the existing intelligent outbound call system, the speech recognition effect is poor, leading to the problem of inaccurate recognition.

Method used

An attention calculation method based on a sparse weight matrix is ​​used to select the text content most relevant to the semantics of the speech to be recognized from the previous intelligent robot text, and fuse the speech features with the text content to generate fusion features for speech recognition.

Benefits of technology

It improves the speech recognition accuracy of the intelligent outbound call system, overcomes the semantic interference when the previous text is used as input, and improves the accuracy of the recognition results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118711575A
    Figure CN118711575A
Patent Text Reader

Abstract

The invention discloses a voice recognition method and device, electronic equipment and a computer readable medium, and relates to the technical field of computers, and a specific implementation mode comprises the steps that in response to a voice recognition request, a to-be-recognized voice and a corresponding preamble intelligent robot text are acquired; based on an attention calculation mode of a sparse weight matrix, text content most related to semantics of the to-be-recognized voice is selected from the text of the intelligent robot; extracting voice features of the to-be-recognized voice, and fusing the voice features and the text content to generate fused features; and performing voice recognition based on the fused features to obtain voice recognition result data. The voice recognition accuracy of an outbound system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a speech recognition method, device, electronic device and computer-readable medium. Background Art

[0002] At present, smart outbound calling is a method of automated calling using artificial intelligence technology. It combines technologies such as speech processing, natural language processing, and machine learning to automatically make calls, recognize voices, interact with users, and perform specific tasks. The development of smart outbound calling can be traced back to traditional automatic outbound calling systems, which make calls and deliver information based on pre-recorded voice messages. The purpose of smart outbound calling is to solve the problem of high labor costs for manual customer service and telephone sales in various companies. With the advancement of artificial intelligence technology, smart outbound calling systems have gradually introduced speech recognition and speech synthesis technologies, allowing the system to communicate with users more naturally.

[0003] As a very important part of the intelligent outbound call system, speech recognition quality will directly affect the intention judgment and process direction of the entire conversation process. The basic process of the existing speech recognition system is to directly transcribe the speech fragments received by the automatic speech recognition system (ASR). This often leads to poor recognition results and inaccurate speech recognition due to various factors such as noise interference, dialect accents, and speech speed. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a speech recognition method, device, electronic device and computer-readable medium, which can solve the technical problems of poor speech recognition effect and inaccurate speech recognition during the entire conversation process with the user during existing intelligent outbound calls.

[0005] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present application, a speech recognition method is provided, comprising: in response to a speech recognition request, obtaining a speech to be recognized and a corresponding previous intelligent robot text; selecting text content that is most relevant to the semantics of the speech to be recognized from the previous intelligent robot text based on an attention calculation method of a sparse weight matrix; extracting speech features of the speech to be recognized, fusing the speech features and the text content to generate fused features; performing speech recognition based on the fused features to obtain speech recognition result data.

[0006] Optionally, an attention calculation method based on a sparse weight matrix selects text content that is most relevant to the semantics of the speech to be recognized from the previous intelligent robot text, including: dividing the speech to be recognized into audio units, and dividing the previous intelligent robot text into word units; converting each audio unit into each audio unit vector, and converting each word unit into each word unit vector; generating a weight matrix based on each audio unit vector and each word unit vector; adding all the weights of each column in the weight matrix to obtain a sparse weight matrix; based on the sparse weight matrix, determining the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized.

[0007] Optionally, generating a weight matrix includes: converting each audio element vector into a column matrix based on a time series, and converting each word element vector into a row matrix based on a context relationship; and multiplying the column matrix and the row matrix to generate a weight matrix.

[0008] Optionally, based on the sparse weight matrix, the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized is determined, including: in response to the weight in the sparse weight matrix being greater than a preset threshold, the corresponding word element is determined as the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized.

[0009] Optionally, in response to the weight in the sparse weight matrix being greater than a preset threshold, before determining the corresponding word as the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized, the speech recognition method also includes: determining the text length of the previous intelligent robot text; calculating the ratio of the text length to a preset length threshold, and rounding the ratio to obtain the preset threshold.

[0010] Optionally, the speech feature and the text content are fused to generate a fused feature, including: summing a speech feature vector corresponding to the speech feature and a text content vector corresponding to the text content to obtain a fused feature vector, and determining a feature corresponding to the fused feature vector as the fused feature.

[0011] Optionally, the speech recognition method also includes: updating the weight matrix based on the text content most relevant to the semantics of the speech to be recognized, updating the sparse weight matrix based on the updated weight matrix, and updating the text content most relevant to the semantics of the speech to be recognized until the text content most relevant to the semantics of the speech to be recognized no longer changes.

[0012] In addition, the present application also provides a speech recognition device, including: an acquisition unit, configured to obtain the speech to be recognized and the corresponding previous intelligent robot text in response to a speech recognition request; a feature selection unit, configured to select text content that is most relevant to the semantics of the speech to be recognized from the previous intelligent robot text based on an attention calculation method of a sparse weight matrix; a feature fusion unit, configured to extract speech features of the speech to be recognized, and fuse the speech features and text content to generate fused features; a speech recognition unit, configured to perform speech recognition based on the fused features to obtain speech recognition result data.

[0013] Optionally, the feature selection unit is further configured to: segment the speech to be recognized into audio units, and segment the previous intelligent robot text into word units; convert each audio unit into each audio unit vector, and convert each word unit into each word unit vector; generate a weight matrix based on each audio unit vector and each word unit vector; add all the weights of each column in the weight matrix to obtain a sparse weight matrix; based on the sparse weight matrix, determine the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized.

[0014] Optionally, the feature selection unit is further configured to: convert each audio element vector into a column matrix based on the time series, and convert each word element vector into a row matrix based on the context relationship; multiply the column matrix and the row matrix to generate a weight matrix.

[0015] Optionally, the feature selection unit is further configured to: in response to the weight in the sparse weight matrix being greater than a preset threshold, determine the corresponding word as the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized.

[0016] Optionally, the speech recognition device also includes a preset threshold determination unit, which is configured to: determine the text length of the previous intelligent robot text; calculate the ratio of the text length to a preset length threshold, and round the ratio to obtain the preset threshold.

[0017] Optionally, the feature fusion unit is further configured to: sum the speech feature vector corresponding to the speech feature and the text content vector corresponding to the text content to obtain a fused feature vector, and determine the feature corresponding to the fused feature vector as the fused feature.

[0018] Optionally, the speech recognition device also includes a weight matrix updating unit, which is configured to: update the weight matrix based on the text content most relevant to the semantics of the speech to be recognized, update the sparse weight matrix based on the updated weight matrix, and update the text content most relevant to the semantics of the speech to be recognized until the text content most relevant to the semantics of the speech to be recognized no longer changes.

[0019] In addition, the present application also provides a speech recognition electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the one or more processors implement the speech recognition method as described above.

[0020] In addition, the present application also provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the speech recognition method as described above is implemented.

[0021] One embodiment of the above invention has the following advantages or beneficial effects: the present application obtains the speech to be recognized and the corresponding previous intelligent robot text in response to the speech recognition request; selects the text content that is most relevant to the semantics of the speech to be recognized from the previous intelligent robot text based on the attention calculation method of the sparse weight matrix; extracts the speech features of the speech to be recognized, fuses the speech features and the text content to generate fusion features; performs speech recognition based on the fusion features to obtain speech recognition result data. The text content of the previous text is used as a semantic supplement or semantic prompt. At the same time, in order to overcome the semantic interference caused by directly using the entire text of the previous text as input, the text content that is most relevant to the current sentence speech is screened from the text of the previous text by means of a sparse weight matrix and input into the recognition of the current sentence user speech. At the same time, the attention mechanism is used to fuse the text content and the speech features together and input into the decoder of the speech recognition system to improve the speech recognition accuracy of the outbound call system.

[0022] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings are used to better understand the present application and do not constitute an improper limitation on the present application.

[0024] Figure 1 is a schematic diagram of the main process of a speech recognition method provided according to an embodiment of the present application;

[0025] Figure 2 is a schematic diagram of the main process of a speech recognition method provided according to an embodiment of the present application;

[0026] Figure 3 It is a schematic diagram of a speech recognition system framework integrating contextual semantic features according to a speech recognition method provided by an embodiment of the present application;

[0027] Figure 4 It is a schematic diagram of a sparse weight matrix calculation process of a speech recognition method provided according to an embodiment of the present application;

[0028] Figure 5is a schematic diagram of main units of a speech recognition device according to an embodiment of the present application;

[0029] Figure 6 is an exemplary system architecture diagram to which the embodiments of the present application can be applied;

[0030] Figure 7 It is a structural diagram of a computer system of a terminal device or server suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION

[0031] The following is an explanation of the exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the technical solution of the present disclosure, the collection, collection, update, analysis, processing, use, transmission, storage and other aspects of user personal information involved are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Take necessary measures for user personal information to prevent illegal access to user personal information data and maintain user personal information security, network security and national security.

[0032] Figure 1 is a schematic diagram of the main process of the speech recognition method provided according to an embodiment of the present application, such as Figure 1 As shown, the speech recognition method includes:

[0033] Step S101, in response to a speech recognition request, obtain the speech to be recognized and the corresponding previous intelligent robot text.

[0034] In this embodiment, the execution subject of the speech recognition method (for example, it can be a server) can detect whether there is a speech recognition request by means of a wired connection or a wireless connection. The speech recognition request can be a request for the execution subject to recognize the speech of the user who is talking to the robot. When the execution subject detects that there is a voice input, it determines that the speech recognition request has been received. After receiving the speech recognition request, the execution subject can obtain the speech to be recognized carried in the request and the previous intelligent robot text output by the robot that is talking to the user. For example, in an outbound call scenario, the speech to be recognized spoken by the user can be "What is a certain egg, I haven't bought it before", and the corresponding previous intelligent robot text can be "You have bought a certain egg before, do you still remember it?".

[0035] Step S102, selecting the text content most relevant to the semantics of the speech to be recognized from the previous intelligent robot text based on the attention calculation method of the sparse weight matrix.

[0036] Specifically, the text content most relevant to the semantics of the speech to be recognized selected from the previous intelligent robot text may include text features, which may be information extracted from the previous intelligent robot text, used to describe a certain property or pattern of the text. The text feature converts the text content most relevant to the semantics of the speech to be recognized into a numerical or structured form, so that it can be used by a machine learning or deep learning model.

[0037] Specifically, the preceding intelligent robot text may be segmented to obtain individual word units. Based on the attention calculation method of the sparse weight matrix, the obtained word units are matched with the speech to be recognized to obtain one or more text contents that are most relevant to the semantics of the speech to be recognized. For example, in the preceding intelligent robot text "You have bought eggs from Mou Le before, do you still remember it?", the text contents that are most relevant to the semantics of the speech to be recognized obtained by the attention calculation method of the sparse weight matrix may be "Mou Le" and "Eggs".

[0038] Step S103: extracting speech features of the speech to be recognized, and fusing the speech features with the text content to generate fused features.

[0039] Specifically, the speech feature and the text content are fused to generate a fused feature, including: summing a speech feature vector corresponding to the speech feature and a text content vector corresponding to the text content to obtain a fused feature vector, and determining a feature corresponding to the fused feature vector as the fused feature.

[0040] The execution subject can fuse the speech features of the speech to be recognized with the text content in the previous intelligent robot text that is most semantically relevant. Specifically, feature fusion can be performed by vector addition (i.e., vector summation) to obtain corresponding fusion features. Feature fusion can be combined with the relevant semantics of the previous intelligent robot text to achieve accurate recognition of the speech to be recognized.

[0041] Step S104: performing speech recognition based on the fusion features to obtain speech recognition result data.

[0042] The fused features are input into the speech recognition system decoder to output the final speech recognition result data. For example, when the fused features are features fused from the word units "Mou Le" and "Eggs" in the previous intelligent robot text and the features extracted from the speech to be recognized "What Mou Le eggs, I have never bought them", the speech recognition result data output after passing through the speech recognition system decoder can be "I have never bought Mou Le eggs" or "Mou Le eggs have never been bought". The embodiment of the present application does not specifically limit the form of the speech recognition result data.

[0043] This embodiment obtains the speech to be recognized and the corresponding previous intelligent robot text in response to the speech recognition request; selects the text content that is most relevant to the semantics of the speech to be recognized from the previous intelligent robot text based on the attention calculation method of the sparse weight matrix; extracts the speech features of the speech to be recognized, fuses the speech features and the text content to generate fusion features; performs speech recognition based on the fusion features to obtain speech recognition result data. The text content of the previous text is used as a semantic supplement or semantic prompt. At the same time, in order to overcome the semantic interference caused by directly using the entire text of the previous text as input, the text content that is most relevant to the current sentence speech is screened from the text of the previous text through the sparse weight matrix and input into the recognition of the current sentence user speech. At the same time, the attention mechanism is used to fuse the text content and speech features together and input into the decoder of the speech recognition system to improve the speech recognition accuracy of the outbound call system.

[0044] Figure 2 is a schematic diagram of the main flow of a speech recognition method provided according to an embodiment of the present application, such as Figure 2 As shown, the speech recognition method includes:

[0045] Step S201, in response to a speech recognition request, obtain the speech to be recognized and the corresponding previous intelligent robot text.

[0046] Step S202, segment the speech to be recognized into audio units, and segment the previous intelligent robot text into word units.

[0047] The audio unit in the embodiment of the present application is the smallest audio unit that can be obtained by segmenting the speech to be recognized. The word unit is the smallest unit that can be segmented and encoded by the preceding intelligent robot text. A word unit can be a word or a punctuation mark. The embodiment of the present application does not specifically limit the form and content of the audio unit and word unit.

[0048] Step S203, converting each audio unit into each audio unit vector, and converting each word unit into each word unit vector.

[0049] Call wav2vec, specifically wav2vec2.0, to convert each audio unit into each audio unit vector by embedding. Use word embedding word2vec to convert each word unit into each word unit vector.

[0050] Step S204: Generate a weight matrix based on each audio element vector and each word element vector.

[0051] In some embodiments, generating a weight matrix includes: converting each audio element vector into a column matrix based on a time series, and converting each word element vector into a row matrix based on a contextual relationship; adding the audio element vectors and word element vectors corresponding to the same row and column in the column matrix and the row matrix to generate a weight matrix. Each matrix element in the weight matrix represents the vector sum of an audio element vector and a word element vector located in the same row and column. The larger the vector sum, the closer the semantics corresponding to the audio element vector and the word element vector are. Based on the generated weight matrix, speech recognition processing can be accurately performed.

[0052] In some embodiments, generating a weight matrix includes: converting each audio element vector into a column matrix based on a time series, converting each word element vector into a row matrix based on a context relationship; and multiplying the column matrix and the row matrix to generate a weight matrix.

[0053] The vector corresponding to the speech to be recognized is selected as the Q vector, and the vector corresponding to the previous intelligent robot text is selected as the K vector (it can also be the V vector. In the embodiment of the present application, the K vector and the V vector are the same). The execution subject can convert each video element vector corresponding to the audio to be recognized into a column matrix based on the time series corresponding to the audio to be recognized, such as Figure 4 As shown, the column matrix contains the video element vectors q1, q2, ..., q i , recorded as Q vector. The row matrix contains each word element vector k1, k2, ..., k j , recorded as K vector.

[0054] Based on the product of the Q vector of the column matrix and the K vector of the row matrix, each weight w is obtained 11 、w 12 ,…,w 1j 、w 21 、w 22 ,…,w 2j 、w i1 、w i2 ,…,w ij For example, the weight matrix is ​​calculated based on the attention calculation method Softmax of the sparse weight matrix, the Q vector of the column matrix and the K vector of the row matrix. The specific calculation method can be:

[0055]

[0056] The results of the above calculations are: 11 、w 12 ,…,w 1j 、w 21 、w 22 ,…,w 2j 、w i1 、w i2 ,…,w ij .

[0057] Among them, d Q is the dimension of the Q vector, W is the weight matrix, q i represents the i-th audio element vector in the Q vector, k j Represents the jth word vector in the K vector.

[0058] The weights w obtained 11 、w 12 ,…,w 1j 、w 21 、w 22 ,…,w 2j 、w i1 、w i2 ,…,w ij Get as Figure 4 The weight matrix W is shown.

[0059] Specifically, the speech recognition method also includes: updating the weight matrix based on the text content most relevant to the semantics of the speech to be recognized, updating the sparse weight matrix based on the updated weight matrix, and updating the text content most relevant to the semantics of the speech to be recognized until the text content most relevant to the semantics of the speech to be recognized no longer changes.

[0060] In the embodiment of the present application, for the entire preceding intelligent robot text sample, a preset number of samples (eg Figure 4 The Top K in Top K, where K in Top K represents the number, select the words with the largest weight and value, and retain their attention weights, while resetting the attention weights of other words to zero. Specifically, the execution subject can determine which words to retain by marking the retention flags, for example, the attention weights of the words marked with the retention flag as 1 can be retained, and the attention weights of the words marked with the retention flag as 0 can be reset to 0. Then, as Figure 4 As shown, the updated weight matrix (for example, Figure 4 As shown in , the updated weight matrix that retains the attention weights contains: 0, 0, …, 0, w 12 、w 22 ,…,w i2, 0, 0, ..., 0, 0, 0, ..., 0) and the V vector (i.e. v1, v2, ..., v j ) matrix multiplication, output Attn, where Attn is the output of the attention mechanism to continue to automatically select text words with more relevant semantic features. Among them, the V vector (including each word element vector v1, v2, ..., v j ) and K vectors (including each word element vector k1, k2, ..., k j ) are the same, representing the same row matrix composed of word element vectors.

[0061] By continuously determining and updating the text that is most semantically relevant to the speech to be recognized, and thereby updating the corresponding weight matrix and the corresponding sparse weight matrix, until the text that is finally determined to be most semantically relevant to the speech to be recognized no longer changes or the number of updates reaches a preset threshold, it means that the text that has been determined is the text with the highest degree of semantic relevance to the speech to be recognized. The text with the highest degree of relevance can better assist the recognition of the speech to be recognized, thereby further improving the accuracy of speech recognition.

[0062] Step S205, adding all the weights of each column in the weight matrix to obtain a sparse weight matrix.

[0063] like Figure 4 As shown, add all the values ​​of each column in the weight matrix. For example, execute the SUM command, the first column w of the weight matrix 11 +w 21 +…+w i1 Get s1, the second column w 12 +w 22 +…+w i2 Get s2, ..., the third column w 1j +w 2j +…+w ij Get j , consisting of s1, s2, …, s j Form a sparse weight matrix.

[0064] Step S206, based on the sparse weight matrix, determine the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized.

[0065] In some embodiments, the weights in the sparse weight matrix can be sorted in descending order, and the word units corresponding to the first Z weights after sorting are determined as the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized. Wherein, Z is a positive integer, and the embodiment of the present application does not specifically limit the value of Z. By limiting the number of weights selected after sorting, it is possible to achieve quantitative control of the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized, reflecting the personalization of speech recognition.

[0066] In some embodiments, based on a sparse weight matrix, the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized is determined, including: in response to the weight in the sparse weight matrix being greater than a preset threshold, the corresponding word element is determined as the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized.

[0067] Specifically, in response to the weight in the sparse weight matrix being greater than a preset threshold, before determining the corresponding word as the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized, the speech recognition method also includes: determining the text length of the previous intelligent robot text; calculating the ratio of the text length to a preset length threshold, and rounding the ratio to obtain the preset threshold.

[0068] The sum of the weights s1, s2, ..., s in the sparse weight matrix j The word element corresponding to the word element greater than the preset threshold is compared with the preset threshold and is determined as the text content most relevant to the semantics of the speech to be recognized.

[0069] Step S207: extracting speech features of the speech to be recognized, and fusing the speech features with the text content to generate fused features.

[0070] Step S208, performing speech recognition based on the fusion features to obtain speech recognition result data.

[0071] The embodiment of the present application uses the text content of the previous text as a semantic supplement or semantic hint. At the same time, in order to overcome the semantic interference caused by directly taking the entire text of the previous text as input, the text content most relevant to the current sentence voice is screened out from the text of the previous text through a sparse weight matrix and input into the recognition of the user voice of the current sentence. At the same time, the attention mechanism is used to fuse the text content and voice features together and input them into the decoder of the voice recognition system, thereby improving the voice recognition accuracy of the outbound call system.

[0072] Figure 3 1 is a schematic diagram of a speech recognition system framework that integrates contextual semantic features according to a speech recognition method provided by an embodiment of the present application. Figure 3As shown, wav2vec 2.0 is an open source speech representation learning method based on self-supervised learning, which can convert the original audio signal into a high-quality speech feature representation. Specifically, the original audio is converted into a vector containing speech features. Softmax is a commonly used activation function in neural networks, which is used to convert a set of real numbers into a probability distribution. It maps the input real number vector to a probability distribution, in which the value range of each element is between 0 and 1, and the sum of all elements is equal to 1. Its function is to normalize a set of input vectors so that the sum of all elements is equal to 1. It is used for the final probabilistic classification in the classification model. In order to make full use of the semantic features spoken by the AI ​​robot in the intelligent outbound call system, the embodiment of the present application introduces text content into the speech decoding process through the attention mechanism in an end-to-end speech recognition system with a typical encoder-decoder structure, thereby improving the recognition accuracy of the user's speech in the current sentence. For text content, the embodiment of the present application adopts the open source language model BERT for text content extraction, and for acoustic features, the open source self-supervised speech model wav2vec2.0 is selected for audio feature extraction; at the same time, in order to obtain text with a higher degree of semantic matching for the current sentence recognition, the embodiment of the present application combines a sparse weight matrix calculation method under the basic framework of the traditional transformer, uses the audio features of the current sentence to automatically select text content that is closer to its semantic relationship, and finally uses the attention mechanism (Attention) to perform feature interaction between text and speech modalities. The overall framework is as follows: Figure 3 shown. Figure 3 In the above, the intelligent robot text is input into the open source language model BERT to extract each word unit. The speech to be recognized is input into the open source self-supervised speech model wav2vec2.0 to recognize each audio unit. The obtained word units and audio units are subjected to the sparse attention mechanism to screen the text content most relevant to the semantics of the speech to be recognized. The attention mechanism is used to finally obtain the fusion features of the text content most relevant to the semantics of the speech to be recognized and the audio features of each audio unit. The fusion features are input into the decoder decoder to obtain the output result of the decoder. The output result is converted by Softmax to output the final recognition result of the current sentence (that is, the current audio to be recognized).

[0073] For example, A: Data preparation: This embodiment of the application uses text speech to train the data model, denoted as S = {S1, S2, ..., S M}, where M represents the number of samples, and each sample S i It contains the current user's voice and the previous intelligent robot's speech text, recorded as Where n represents the current voice a iSelect the total number of previous intelligent robot speeches, t i Indicates the label text of the current speech; all audio features in the embodiment of the present application are 80-dimensional Mel spectrum features, where the duration of each frame is 25ms and the step length is 10ms.

[0074] B: Speech encoder: The speech encoder of the embodiment of the present application consists of a pre-trained speech representation model wav2vec2.0 and a linear layer. The pre-trained model uses the same architecture as wav2vec2.0 and is trained on the open source Chinese dataset WenetSpeech, which contains more than 10,000 hours of annotated Mandarin speech. The linear layer is to ensure that the outputs of the speech encoder and the text encoder have the same dimension.

[0075] B-1: Speech encoder pre-training:

[0076] In the standard wav2vec2.0 framework, the contrast loss function for each mask time step t is calculated as:

[0077]

[0078] Among them, c t ∈C,q t ∈Q t , sim(m,n)=m T n / ||m||||n|| is the cosine similarity between the calculated context representation and the quantized representation, and k represents the hyperparameter temperature coefficient.

[0079] C: Sparse weight matrix:

[0080] The Transformer attention is calculated as follows:

[0081]

[0082] att = W × V, where d Q is the dimension of vector Q, W is the weight matrix, att (i.e. Figure 4 Attn) in is the output of the attention mechanism. For the multi-head attention mechanism, the outputs of all attention heads are merged together.

[0083] The present embodiment uses a sparse weight matrix to find semantic features that are more relevant to the text of the speech to be recognized. Assuming that the number of Query vectors (i.e., Q vectors) is i and the number of Key vectors (i.e., K vectors) is j, the sparse weight matrix can be expressed as follows: Figure 4As shown, note that here, like the traditional Transformer, the K vector and the V vector are the same. Wherein the weight matrix W is obtained by multiplying the Q vector and the K vector, and each row in W represents the attention weight assigned to each word in V. All the attention weights of the same word in the K vector (which can also be the V vector) are added together, and the sum represents the importance of the word in the entire sample. Intuitively, when the importance of a word is very high, other words give the word a larger attention weight during the attention mechanism calculation process, so that its sum weight becomes larger. On the contrary, if for a word with low importance, other words will only give it a very small attention weight when calculating attention, and its sum value will also become smaller accordingly. Therefore, in the embodiment of the present application, for the entire previous intelligent robot text sample, K (here refers to the number) words with the maximum weight and value are selected each time, and their attention weights are retained, and the attention weights of other words are reset to zero, and then the weight and V value vectors are matrix multiplied to automatically select text words with more relevant semantic features. Specifically, the speech features of the current sentence are used to select the importance of each word in the historical conversation text content. The speech to be recognized is selected as the Q vector, and the previous intelligent robot text is selected as the K and V vectors. Therefore, each weight in the weight matrix represents the similarity between the speech features of the row and the text word in the column. Finally, all weights of each column are added together to represent the importance of the text word in the column in the entire speech feature. This operation changes the weight matrix from dense to sparse and reduces redundancy, which is called a sparse weight matrix. The vector selection of Top-K is calculated by the following formula:

[0084]

[0085] Among them, the threshold selection is the Kth largest sum weight, z∈[1,j].

[0086] Specifically, the hidden feature representation obtained after the recorded audio passes through the speech encoder (composed of the pre-trained speech representation model Wav2vec2.0 and the linear layer) is: The hidden layer representation of the previous intelligent robot text after passing through the text content encoder BERT is The sparse weighted attention mechanism is denoted as Sparse_Attention, and the hidden layer features obtained by the attention mechanism containing the previous features are represented as H c =Sparse_Attention(W Q H a , W K H t , W V H t ), and then combined with the audio feature H of the current sentence a Perform the sum operation to get Ha+c =H a +H c , input to the speech recognition decoder, and then pass softmax to output the final recognition result. For the training of the speech recognition system decoder, the commonly used end-to-end speech recognition loss function is based on the hybrid loss of the attention method (Attention) and the connection temporal classification (CTC) L = λL ctc +(1-λ)L att , where L ctc is the loss of connection temporal classification (CTC), L att is the loss based on the attention method (Attention), and λ is the loss weight. During the training process, the back propagation algorithm is used to train the neural network model until convergence. Specifically, the existing adaptive momentum random optimization algorithm (ADAM) is used, wherein ADAM adopts a warm-up strategy, and its learning rate peak is 0.001, and the warm-up strategy step is 15000 steps. In the embodiment of the present application, the loss weight λ is set to 0.5, and the total number of intelligent robot speeches in the previous text is selected as n=1, wherein the selection of K in the semantic feature Top-K is determined according to the text length selected in the previous text, and is obtained by rounding the length and 2. Assuming that the text length is L, then K in Top-K is L / 2. In the intelligent outbound call system, the text of the previous AI robot is introduced as a semantic supplement to the current sentence speech recognition, and the semantic features most relevant to the audio semantics of the current sentence are selected from the text of the previous text through a sparse weight matrix attention calculation method, and the attention mechanism is used to fuse the audio features of the current sentence into the speech recognition system decoder to output the final result.

[0087] The embodiment of the present application uses the text content of the previous intelligent robot text as a semantic supplement or semantic hint. At the same time, in order to overcome the semantic interference caused by directly taking the entire text of the previous text as input, a sparse weight matrix is ​​used to screen out the text content most relevant to the speech to be recognized in the current sentence from the previous intelligent robot text and input it into the speech recognition system decoder that processes the speech to be recognized by the user in the current sentence. At the same time, the attention mechanism is used to merge the most relevant text content and speech features and input them into the speech recognition system decoder, thereby improving the speech recognition accuracy of the outbound call system.

[0088] Figure 5 Schematic diagram of the main units of the speech recognition device according to the embodiment of the present application. Figure 5 As shown, the speech recognition device 500 includes an acquisition unit 501, a feature selection unit 502, a feature fusion unit 503 and a speech recognition unit 504.

[0089] The acquisition unit 501 is configured to acquire the speech to be recognized and the corresponding previous intelligent robot text in response to the speech recognition request.

[0090] The feature selection unit 502 is configured to select text content that is most relevant to the semantics of the speech to be recognized from the previous intelligent robot text based on an attention calculation method of a sparse weight matrix.

[0091] The feature fusion unit 503 is configured to extract speech features of the speech to be recognized, and fuse the speech features with the text content to generate fused features.

[0092] The speech recognition unit 504 is configured to perform speech recognition based on the fusion features to obtain speech recognition result data.

[0093] In some embodiments, the feature selection unit 502 is further configured to: segment the speech to be recognized into audio units, and segment the previous intelligent robot text into word units; convert each audio unit into each audio unit vector, and convert each word unit into each word unit vector; generate a weight matrix based on each audio unit vector and each word unit vector; add all the weights of each column in the weight matrix to obtain a sparse weight matrix; based on the sparse weight matrix, determine the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized.

[0094] In some embodiments, the feature selection unit 502 is further configured to: convert each audio element vector into a column matrix based on the time series, and convert each word element vector into a row matrix based on the context relationship; multiply the column matrix and the row matrix to generate a weight matrix.

[0095] In some embodiments, the feature selection unit 502 is further configured to: in response to the weight in the sparse weight matrix being greater than a preset threshold, determine the corresponding word as the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized.

[0096] In some embodiments, the speech recognition device further includes Figure 5 The preset threshold determination unit not shown in the figure is configured to: determine the text length of the previous intelligent robot text; calculate the ratio of the text length to the preset length threshold, and round the ratio to obtain the preset threshold.

[0097] In some embodiments, the feature fusion unit 503 is further configured to: sum the speech feature vector corresponding to the speech feature and the text content vector corresponding to the text content to obtain a fused feature vector, and determine the feature corresponding to the fused feature vector as the fused feature.

[0098] In some embodiments, the speech recognition device further includes Figure 5The weight matrix update unit not shown in the figure is configured to: update the weight matrix based on the text content most relevant to the semantics of the speech to be recognized, update the sparse weight matrix based on the updated weight matrix, and update the text content most relevant to the semantics of the speech to be recognized until the text content most relevant to the semantics of the speech to be recognized no longer changes.

[0099] It should be noted that the speech recognition method and speech recognition device of the present application have a corresponding relationship in terms of specific implementation contents, so the repeated contents will not be described again.

[0100] Figure 6 An exemplary system architecture 600 is shown to which the speech recognition method or speech recognition device according to the embodiments of the present application can be applied.

[0101] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0102] Users can use terminal devices 601, 602, and 603 to interact with server 605 through network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).

[0103] The terminal devices 601, 602, and 603 may be various electronic devices having a voice recognition processing screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0104] Server 605 can be a server that provides various services, such as a background management server that provides support for speech recognition requests submitted by users using terminal devices 601, 602, and 603 (only as an example). The background management server can respond to the speech recognition request, obtain the speech to be recognized and the corresponding previous intelligent robot text; select the text content that is most relevant to the semantics of the speech to be recognized from the previous intelligent robot text based on the attention calculation method of the sparse weight matrix; extract the speech features of the speech to be recognized, fuse the speech features and text content to generate fusion features; perform speech recognition based on the fusion features to obtain speech recognition result data. The text content of the previous text is used as a semantic supplement or semantic prompt. At the same time, in order to overcome the semantic interference caused by directly using the entire text of the previous text as input, the text content that is most relevant to the current sentence speech is screened from the text of the previous text by means of a sparse weight matrix and input into the recognition of the current sentence user speech. At the same time, the attention mechanism is used to fuse the text content and speech features together and input into the decoder of the speech recognition system to improve the speech recognition accuracy of the outbound call system.

[0105] It should be noted that the speech recognition method provided in the embodiment of the present application is generally executed by the server 605 , and accordingly, the speech recognition device is generally arranged in the server 605 .

[0106] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0107] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device suitable for implementing an embodiment of the present application. Figure 7 The terminal device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0108] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the computer system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0109] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.

[0110] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present application are executed.

[0111] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. Computer-readable storage media may include, for example, but are not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0112] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0113] The units involved in the embodiments described in the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes an acquisition unit, a feature selection unit, a feature fusion unit, and a speech recognition unit. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0114] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device responds to a speech recognition request, obtains the speech to be recognized and the corresponding previous intelligent robot text; selects the text content that is most relevant to the semantics of the speech to be recognized from the previous intelligent robot text based on the attention calculation method of the sparse weight matrix; extracts the speech features of the speech to be recognized, and fuses the speech features and the text content to generate fused features; performs speech recognition based on the fused features to obtain speech recognition result data.

[0115] According to the technical solution of the embodiment of the present application, the text content of the previous text is used as a semantic supplement or semantic hint. At the same time, in order to overcome the semantic interference caused by directly taking the entire text of the previous text as input, the text content most relevant to the current sentence voice is screened out from the text of the previous text through a sparse weight matrix and input into the recognition of the user voice of the current sentence. At the same time, the attention mechanism is used to fuse the text content and voice features together and input them into the decoder of the voice recognition system, thereby improving the voice recognition accuracy of the outbound call system.

[0116] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A speech recognition method, characterized in that: include: In response to a speech recognition request, obtaining the speech to be recognized and the corresponding previous intelligent robot text; Selecting the text content most relevant to the semantics of the speech to be recognized from the previous intelligent robot text based on the attention calculation method of the sparse weight matrix; Extracting speech features of the speech to be recognized, and fusing the speech features with the text content to generate fused features; Speech recognition is performed based on the fusion features to obtain speech recognition result data.

2. The method according to claim 1, characterized in that The attention calculation method based on the sparse weight matrix selects the text content most relevant to the semantics of the speech to be recognized from the previous intelligent robot text, including: Segment the speech to be recognized into audio units, and segment the preceding intelligent robot text into word units; Convert each of the audio elements into an audio element vector, and convert each word element into a word element vector; Generate a weight matrix based on the respective audio element vectors and the respective word element vectors; Adding all weights of each column in the weight matrix to obtain a sparse weight matrix; Based on the sparse weight matrix, determine the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized.

3. The method according to claim 2, characterized in that The generating weight matrix comprises: Convert each audio element vector into a column matrix based on a time series, and convert each word element vector into a row matrix based on a context relationship; The column matrix is ​​multiplied by the row matrix to generate a weight matrix.

4. The method according to claim 2, characterized in that: The determining, based on the sparse weight matrix, text content in the preceding intelligent robot text that is most semantically relevant to the speech to be recognized comprises: In response to the weight in the sparse weight matrix being greater than a preset threshold, the corresponding word is determined as the text content in the previous intelligent robot text that is most relevant to the semantics of the speech to be recognized.

5. The method according to claim 4, characterized in that Before determining the corresponding word as the text content in the preceding intelligent robot text that is most semantically relevant to the speech to be recognized in response to the weight in the sparse weight matrix being greater than a preset threshold, the method further includes: Determining the text length of the preceding intelligent robot text; The ratio of the text length to a preset length threshold is calculated, and the ratio is rounded to obtain the preset threshold.

6. The method according to claim 1, characterized in that The fusing the speech feature and the text content to generate a fusion feature includes: The speech feature vector corresponding to the speech feature and the text content vector corresponding to the text content are summed to obtain a fused feature vector, and the feature corresponding to the fused feature vector is determined as a fused feature.

7. The method according to claim 2, characterized in that: The method further comprises: The weight matrix is ​​updated based on the text content that is most relevant to the semantics of the speech to be recognized, the sparse weight matrix is ​​updated based on the updated weight matrix, and the text content that is most relevant to the semantics of the speech to be recognized is updated until the text content that is most relevant to the semantics of the speech to be recognized no longer changes.

8. A speech recognition device, characterized in that: include: An acquisition unit, configured to acquire the speech to be recognized and the corresponding preceding intelligent robot text in response to the speech recognition request; A feature selection unit is configured to select text content that is most relevant to the semantics of the speech to be recognized from the previous intelligent robot text based on an attention calculation method of a sparse weight matrix; A feature fusion unit, configured to extract speech features of the speech to be recognized, and fuse the speech features with the text content to generate fusion features; The speech recognition unit is configured to perform speech recognition based on the fusion features to obtain speech recognition result data.

9. A voice recognition electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.