CN111128191B - Online end-to-end voice transcription method and system - Google Patents
Online end-to-end voice transcription method and system Download PDFInfo
- Publication number
- CN111128191B CN111128191B CN201911415035.0A CN201911415035A CN111128191B CN 111128191 B CN111128191 B CN 111128191B CN 201911415035 A CN201911415035 A CN 201911415035A CN 111128191 B CN111128191 B CN 111128191B
- Authority
- CN
- China
- Prior art keywords
- layer
- network
- output
- chinese character
- features
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000013518 transcription Methods 0.000 title claims abstract description 31
- 230000035897 transcription Effects 0.000 title claims abstract description 31
- 238000000034 method Methods 0.000 title claims abstract description 25
- 230000008569 process Effects 0.000 claims abstract description 11
- 230000009466 transformation Effects 0.000 claims abstract description 8
- 238000005070 sampling Methods 0.000 claims abstract description 7
- 238000010606 normalization Methods 0.000 claims description 30
- 238000012545 processing Methods 0.000 claims description 25
- 238000001228 spectrum Methods 0.000 claims description 18
- 230000007246 mechanism Effects 0.000 claims description 17
- 238000000638 solvent extraction Methods 0.000 abstract 1
- 238000004364 calculation method Methods 0.000 description 14
- 238000013528 artificial neural network Methods 0.000 description 10
- 238000005516 engineering process Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 5
- 230000005236 sound signal Effects 0.000 description 4
- 238000010845 search algorithm Methods 0.000 description 3
- 238000010276 construction Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000009432 framing Methods 0.000 description 2
- 230000003595 spectral effect Effects 0.000 description 2
- 230000004913 activation Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000037433 frameshift Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000003062 neural network model Methods 0.000 description 1
- 238000004321 preservation Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L15/00—Speech recognition
- G10L15/26—Speech to text systems
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L15/00—Speech recognition
- G10L15/08—Speech classification or search
- G10L15/16—Speech classification or search using artificial neural networks
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L15/00—Speech recognition
- G10L15/28—Constructional details of speech recognition systems
- G10L15/30—Distributed recognition, e.g. in client-server systems, for mobile phones or network applications
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L25/00—Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
- G10L25/03—Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of extracted parameters
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L25/00—Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
- G10L25/03—Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of extracted parameters
- G10L25/24—Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of extracted parameters the extracted parameters being the cepstrum
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L25/00—Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
- G10L25/27—Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the analysis technique
- G10L25/30—Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the analysis technique using neural networks
Landscapes
- Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- Acoustics & Sound (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
Description
技术领域technical field
本发明涉及语音转写技术领域,尤其涉及一种在线端对端语音转写方法及系统。The invention relates to the technical field of speech transcription, and in particular to an online end-to-end speech transcription method and system.
背景技术Background technique
语音转写技术是将输入的音频转换为文本的重要技术,也是人机交互领域的一个重要研究内容。Speech transcription technology is an important technology for converting input audio into text, and it is also an important research content in the field of human-computer interaction.
传统的语音转写技术包含声学模型、发音字典和语言模型,并且借助加权有限状态转换机构建复杂的解码网络,将声学特征序列转换为文本序列。当前新兴的端对端语言转写技术采用单个神经网络模型,直接将声学特征转换为文本序列,极大地简化了语音转写过程中的解码流程。但是目前的高性能的端对端语音转写必须等待完整的音频输入后,才能开始转换为文本序列,限制了端对端语音转写技术应用于实时转写的在线任务。Traditional speech transcription technology includes acoustic models, pronunciation dictionaries, and language models, and uses weighted finite state transition machines to build complex decoding networks to convert acoustic feature sequences into text sequences. The current emerging end-to-end language transcription technology uses a single neural network model to directly convert acoustic features into text sequences, which greatly simplifies the decoding process in the speech transcription process. However, the current high-performance end-to-end speech transcription must wait for the complete audio input before it can start converting into text sequences, which limits the application of end-to-end speech transcription technology to online tasks of real-time transcription.
发明内容Contents of the invention
有鉴于此,本申请实施例提供了一种在线端对端语音转写方法及系统,克服了现有的端对端语音转写技术不能应用于实时转写在线任务的问题,通过改进基于编码器和解码器结构的端对端语音转写技术,使得编码器和解码器不再依赖完整的音频就能开始转换为文本序列。In view of this, the embodiment of the present application provides an online end-to-end voice transcription method and system, which overcomes the problem that the existing end-to-end voice transcription technology cannot be applied to real-time transcription online tasks. The end-to-end speech transcription technology of the encoder and decoder structure enables the encoder and decoder to start converting into text sequences without relying on the complete audio.
第一方面,本发明申请提供了一种在线端对端语音转写方法包括:In the first aspect, the application of the present invention provides an online end-to-end voice transcription method including:
获取音频文件,对所述音频文件提取声学特征;Acquiring an audio file, and extracting acoustic features from the audio file;
对所述声学特征进行非线性变换和降采样并输出第一特征序列;performing nonlinear transformation and downsampling on the acoustic features and outputting a first feature sequence;
将第一特征序列进行分块,依次将每块特征序列输入到编码器中并输出多组第二特征序列;dividing the first feature sequence into blocks, sequentially inputting each block of feature sequences into the encoder and outputting multiple sets of second feature sequences;
对所述第二特征序列进行建模,输出多组汉字序列并对所述多组汉字序列进行打分;Modeling the second feature sequence, outputting multiple sets of Chinese character sequences and scoring the multiple sets of Chinese character sequences;
将分数最高的汉字序列作为最终转写结果。The Chinese character sequence with the highest score is taken as the final transliteration result.
可选地,所述获取音频文件,对所述音频文件提取声学特征包括:Optionally, the acquiring the audio file, and extracting the acoustic features from the audio file include:
对获取的音频文件提取对数梅尔谱特征作为帧级别声学特征。The logarithmic mel spectrum features are extracted from the acquired audio files as frame-level acoustic features.
可选地,所述编码器为基于自注意力机制的在线编码器;Optionally, the encoder is an online encoder based on a self-attention mechanism;
所述编码器由12个相同的子模块堆叠组成,每个子模块依次由自注意力网络、残差网络、层规范化网络、全连接网络、残差网络和层规范化网络堆叠组成。The encoder is composed of a stack of 12 identical sub-modules, and each sub-module is sequentially composed of a self-attention network, a residual network, a layer normalization network, a fully connected network, a residual network, and a layer normalization network stack.
可选地,所述对所述第二特征序列进行处理,输出多组汉字序列并对所述多组汉字序列进行打分包括:Optionally, the processing the second feature sequence, outputting multiple groups of Chinese character sequences and scoring the multiple groups of Chinese character sequences includes:
构建基于自注意力机制的在线解码器,所述解码器对第二特征序列进行建模,并对输出的多组汉字序列进行打分;Build an online decoder based on the self-attention mechanism, the decoder models the second feature sequence, and scores the output multiple groups of Chinese character sequences;
所述解码器由6个相同的子模块堆叠组成,其中每个子模块为一层自注意力网络、一层残差网络、一层层规范化网络、一层截断注意力网络、一层残差网络、一层层规范化网络、一层全连接网络、一层残差网络和一层层规范化网络。The decoder is composed of 6 identical sub-module stacks, wherein each sub-module is a layer of self-attention network, a layer of residual network, a layer of normalized network, a layer of truncated attention network, a layer of residual network , a layer-by-layer normalization network, a layer-by-layer fully connected network, a layer-by-layer residual network, and a layer-by-layer normalization network.
可选地,所述解码器对第二特征序列进行建模,并对输出的多组汉字序列进行打分包括:Optionally, the decoder models the second feature sequence, and scoring the output multiple groups of Chinese character sequences includes:
将多组第二特征序列依次通过所述解码器的6个子模块,将最后一个子模块的层规范网络的输出特征输入汉字分类器;Pass multiple groups of second feature sequences through 6 submodules of the decoder in turn, and input the output features of the layer specification network of the last submodule into the Chinese character classifier;
所述汉字分类器输出多组汉字以及每组汉字对应的分数;The Chinese character classifier outputs multiple groups of Chinese characters and the corresponding scores of each group of Chinese characters;
取排名前十的汉字分别输入解码器输出下一个汉字,直到解码器输出终止符为止。Take the top ten Chinese characters and input them into the decoder to output the next Chinese character until the decoder outputs the terminator.
第二方面,本发明申请提供了一种在线端对端语音转写系统包括:In the second aspect, the application of the present invention provides an online end-to-end speech transcription system including:
采集单元:用于采集音频,并对所述音频提取声学特征;Acquisition unit: used to collect audio and extract acoustic features from the audio;
处理单元:用于对采集单元提取的声学特征进行非线性变换和降采样并输出第一特征序列;将第一特征序列进行分块,依次将每块特征序列输入到编码器中并输出多组第二特征序列;Processing unit: used to perform nonlinear transformation and down-sampling on the acoustic features extracted by the acquisition unit and output the first feature sequence; divide the first feature sequence into blocks, input each block of feature sequences into the encoder in turn and output multiple groups the second feature sequence;
所述处理单元还用于,对所述第二特征序列进行建模,输出多组汉字序列并对所述多组汉字序列进行打分;The processing unit is also used to model the second feature sequence, output multiple sets of Chinese character sequences and score the multiple sets of Chinese character sequences;
输出单元:用于将处理单元输出的汉字序列中分数最高的汉字序列作为最终转写结果,并输出。Output unit: used to take the Chinese character sequence with the highest score among the Chinese character sequences output by the processing unit as the final transcription result, and output it.
可选地,对所述音频提取声学特征包括:Optionally, extracting acoustic features from the audio includes:
对获取的音频文件提取对数梅尔谱特征作为帧级别声学特征。The logarithmic mel spectrum features are extracted from the acquired audio files as frame-level acoustic features.
可选地,所述编码器为基于自注意力机制的在线编码器;Optionally, the encoder is an online encoder based on a self-attention mechanism;
所述编码器由12个相同的子模块堆叠组成,每个子模块依次由自注意力网络、残差网络、层规范化网络、全连接网络、残差网络和层规范化网络堆叠组成。The encoder is composed of a stack of 12 identical sub-modules, and each sub-module is sequentially composed of a self-attention network, a residual network, a layer normalization network, a fully connected network, a residual network, and a layer normalization network stack.
可选地,所述对所述第二特征序列进行处理,输出多组汉字序列并对所述多组汉字序列进行打分包括:Optionally, the processing the second feature sequence, outputting multiple groups of Chinese character sequences and scoring the multiple groups of Chinese character sequences includes:
构建基于自注意力机制的在线解码器,所述解码器对第二特征序列进行建模,并对输出的多组汉字序列进行打分;Build an online decoder based on the self-attention mechanism, the decoder models the second feature sequence, and scores the output multiple groups of Chinese character sequences;
所述解码器由6个相同的子模块堆叠组成,其中每个子模块为一层自注意力网络、一层残差网络、一层层规范化网络、一层截断注意力网络、一层残差网络、一层层规范化网络、一层全连接网络、一层残差网络和一层层规范化网络。The decoder is composed of 6 identical sub-module stacks, wherein each sub-module is a layer of self-attention network, a layer of residual network, a layer of normalized network, a layer of truncated attention network, a layer of residual network , a layer-by-layer normalization network, a layer-by-layer fully connected network, a layer-by-layer residual network, and a layer-by-layer normalization network.
可选地,所述解码器对第二特征序列进行建模,并对输出的多组汉字序列进行打分包括:Optionally, the decoder models the second feature sequence, and scoring the output multiple groups of Chinese character sequences includes:
将多组第二特征序列依次通过所述解码器的6个子模块,将最后一个子模块的层规范网络的输出特征输入汉字分类器;Pass multiple groups of second feature sequences through 6 submodules of the decoder in turn, and input the output features of the layer norm network of the last submodule into the Chinese character classifier;
所述汉字分类器输出多组汉字以及每组汉字对应的分数;The Chinese character classifier outputs multiple groups of Chinese characters and the corresponding scores of each group of Chinese characters;
取排名前十的汉字分别输入解码器输出下一个汉字,直到解码器输出终止符为止。Take the top ten Chinese characters and input them into the decoder to output the next Chinese character until the decoder outputs the terminator.
本申请实施例提供一种在线端对端语音转写方法及系统,在一个实施例中,对音频提取对数梅尔谱特征作为帧级别声学特征;构建前端神经网络,将对数梅尔谱特征进行非线性变换和降采样;构建基于自注意力机制的在线编码器,对前端神经网络的输出特征序列进行建模,并输出一组新的特征序列;构建基于自注意力机制的在线解码器,对编码器输出的特征序列进行建模,并输出多组汉字序列;利用束搜索算法搜索分数最高的汉字序列,并作为最终的转写结果。通过改进编码器结构,让其处理分块的音频;通过改进解码器的结构,让其在截断音频的基础上输出汉字。使得在输入音频的同时转写文本。An embodiment of the present application provides an online end-to-end speech transcription method and system. In one embodiment, logarithmic mel spectrum features are extracted from the audio as frame-level acoustic features; a front-end neural network is constructed to convert the logarithmic mel spectrum Non-linear transformation and downsampling of features; construction of an online encoder based on self-attention mechanism, modeling the output feature sequence of the front-end neural network, and output a new set of feature sequences; construction of online decoding based on self-attention mechanism The device models the feature sequence output by the encoder, and outputs multiple sets of Chinese character sequences; uses the beam search algorithm to search for the Chinese character sequence with the highest score, and uses it as the final transliteration result. By improving the structure of the encoder, let it process the divided audio; by improving the structure of the decoder, let it output Chinese characters on the basis of truncated audio. Enables transcription of text while inputting audio.
附图说明Description of drawings
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without making creative efforts.
图1为本发明申请一种在线端对端语音转写系统的结构示意图;Fig. 1 is a schematic structural diagram of an online end-to-end speech transcription system for the application of the present invention;
图2为本发明申请一种在线端对端语音转写方法的流程图;Fig. 2 is a flow chart of applying for an online end-to-end voice transcription method according to the present invention;
图3为基于自注意力机制的在线编码器对输入其中的特征序列的处理流程图;Fig. 3 is a flow chart of the processing of the feature sequence input by the online encoder based on the self-attention mechanism;
图4为基于自注意力机制的在线解码器对输入其中的特征序列的处理流程图。Fig. 4 is a flow chart of the processing of the feature sequence input by the online decoder based on the self-attention mechanism.
具体实施方式Detailed ways
下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。The technical solutions of the present invention will be described in further detail below with reference to the accompanying drawings and embodiments.
图1为本发明申请一种在线端到端语音转写方法的结构示意图,参见图1,本申请实施例中的一种端到端远场语音识别系统包括:采集单元101、处理单元102和输出单元103。Fig. 1 is a schematic structural diagram of an online end-to-end speech transcription method of the present invention. Referring to Fig. 1, an end-to-end far-field speech recognition system in the embodiment of the present application includes: an
采集单元101用于采集音频信号,并将采集的音频信号通过高通滤波器,进行预加重,提高音频信号中的高频部分。The
对通过高通滤波器的音频信号进行分帧,每帧25毫秒,帧移10毫秒。对每一帧进行加窗,窗函数为汉明窗。然后对每一帧进行快速傅里叶变换得到各帧的频谱,进一步得到各帧的能量谱。进一步地,对每一帧的能量谱计算通过梅尔滤波器的能量,并取对数,得到对数梅尔谱,其中梅尔滤波器的个数为80,因此每帧得到80维的对数梅尔谱特征。Framing the audio signal passed through the high-pass filter, each frame is 25 milliseconds, and the frame is shifted by 10 milliseconds. Windowing is performed on each frame, and the window function is a Hamming window. Then perform fast Fourier transform on each frame to obtain the frequency spectrum of each frame, and further obtain the energy spectrum of each frame. Further, calculate the energy passing through the Mel filter for the energy spectrum of each frame, and take the logarithm to obtain the logarithmic Mel spectrum, wherein the number of Mel filters is 80, so each frame gets an 80-dimensional pair Several mel spectral features.
处理单元102包括:第一处理单元1021、第二处理单元1022和第三处理单元1023。The
第一处理单元1021用于构建前端神经网络。其中,前端神经网络包含两层二维卷积网络,一层线性网络和一层位置编码网络。其中,卷积网络的卷积核大小为3、步长为2,卷积核数量为256,经过两层二维卷积层后特征序列的长度变为原先长度的四分之一,线性层将卷积层的输出特征投影到256维,位置编码层将线性层的输出特征和256维的位置特征相加。The first processing unit 1021 is used to construct a front-end neural network. Among them, the front-end neural network includes two layers of two-dimensional convolutional network, one layer of linear network and one layer of position encoding network. Among them, the convolution kernel size of the convolution network is 3, the step size is 2, and the number of convolution kernels is 256. After two layers of two-dimensional convolution layers, the length of the feature sequence becomes a quarter of the original length, and the linear layer The output features of the convolutional layer are projected to 256 dimensions, and the position encoding layer adds the output features of the linear layer and the 256-dimensional position features.
将采集单元101提取的对数梅尔谱特征序列输入到前端神经网络中,进行非线性变换和降采样,采样率为四分之一。The logarithmic mel spectrum feature sequence extracted by the
第二处理单元1022用于构建基于自注意力机制的在线编码器,该编码器由12个相同的子模块堆叠组成,每个子模块依次由自注意力网络、残差网络、层规范化网络、全连接网络、残差网络和层规范化网络堆叠组成。The second processing unit 1022 is used to construct an online encoder based on the self-attention mechanism. Concatenation network, residual network and layer normalization network stack composition.
将前端神经网络中输出的特征序列进行分块,再依次将每块特征序列输入在线编码器中,并输出多组新的特征序列。其中,从在线编码器中输出的特征序列与输入在线编码器的特征序列相同。Divide the feature sequences output from the front-end neural network into blocks, and then input each block of feature sequences into the online encoder in turn, and output multiple sets of new feature sequences. Among them, the feature sequence output from the online encoder is the same as the feature sequence input to the online encoder.
第三处理单元1023用于构建基于自注意力机制的在线解码器,该解码器由6个相同的子模块堆叠组成,每个子模块依次由自注意力网络、残差网络、层规范化网络、截断注意力网络、残差网络、层规范化网络、全连接网络、残差网络和层规范化网络堆叠组成。The third processing unit 1023 is used to build an online decoder based on the self-attention mechanism. The decoder is composed of 6 identical sub-modules stacked. Attention network, residual network, layer normalization network, fully connected network, residual network and layer normalization network stack.
在将在线编码器的输出特征输入到在线解码器之前,还需要为在线解码器输入一个起始符号作为在线解码器的起始点。将起始符号的词的嵌入特征与位置特征相加,并输入基于自注意力机制的在线解码器。Before inputting the output features of the online encoder to the online decoder, it is also necessary to input a starting symbol for the online decoder as the starting point of the online decoder. Add the word embedding feature of the start symbol and the position feature, and feed it into an online decoder based on the self-attention mechanism.
输出单元103用于将处理单元102输出的汉字序列中分数最高的汉字序列作为最终转写结果,并输出。The
在一个可能的实施例中,输出单元103采用束搜索算法控制第三处理单元1023每次输出汉字的个数,将其按照分数由高到低排序,取排名前十的汉字分别输入解码器输出下一个汉字,直到解码器输出终止符为止。结束后,具有最高分数的汉字序列将作为最终的转写结果。In a possible embodiment, the
图2为本发明申请一种在线端到端语音转写方法的流程图,参照图2,一种在线端到端语音转写方法包括步骤S201-步骤S205:Fig. 2 is a flowchart of an online end-to-end speech transcription method for the present invention. Referring to Fig. 2, an online end-to-end speech transcription method includes steps S201-step S205:
步骤S201:获取音频文件,对所述音频文件提取声学特征。Step S201: Acquire audio files, and extract acoustic features from the audio files.
对音频提取对数梅尔谱特征作为帧级别的声学特征。具体包括:对获取的音频文件进行预加重,提升高频部分。即将音频文件中的语音信号通过高通滤波器:Extract log-mel spectral features from audio as frame-level acoustic features. Specifically, it includes: pre-emphasizing the acquired audio files, and enhancing high-frequency parts. That is, the speech signal in the audio file is passed through a high-pass filter:
H(z)=1-0.97z-1 (1)H(z)=1-0.97z -1 (1)
对音频文件中的音频进行分帧和加窗处理,其中每一帧25毫秒,帧移10毫秒,窗函数为汉明窗。Framing and windowing are performed on the audio in the audio file, where each frame is 25 milliseconds, the frame shift is 10 milliseconds, and the window function is a Hamming window.
对每一帧进行快速傅里叶变换得到各帧的频谱,通过各帧的频谱进一步处理得到各帧的能量谱。Perform fast Fourier transform on each frame to obtain the frequency spectrum of each frame, and further process the frequency spectrum of each frame to obtain the energy spectrum of each frame.
计算每一帧的能量谱通过梅尔滤波器的能量,并取对数,得到对数梅尔谱,其中梅尔滤波器的个数为80,因此每帧得到80维的对数梅尔谱特征。Calculate the energy spectrum of each frame through the energy of the Mel filter, and take the logarithm to obtain the logarithmic Mel spectrum, where the number of Mel filters is 80, so each frame obtains an 80-dimensional logarithmic Mel spectrum feature.
步骤S202:对所述声学特征进行非线性变换和降采样并输出第一特征序列。Step S202: Perform nonlinear transformation and down-sampling on the acoustic features and output a first feature sequence.
将提取的声学特征输入到前端神经网络中,由前端神经网络对该声学特征进行非线性变换和降采样并输出第一特征序列;其中,采样率为四分之一。The extracted acoustic features are input into the front-end neural network, and the acoustic features are nonlinearly transformed and down-sampled by the front-end neural network to output the first feature sequence; wherein, the sampling rate is 1/4.
在一个可能的实施例中,构建的前端神经网络包含两层二维卷积网络,一层线性网络和一层位置编码网络,其中卷积网络的卷积核大小为3、步长为2,卷积核数量为256,经过两层二维卷积层后特征序列的长度变为原先长度的四分之一,线性层将卷积层的输出特征投影到256维,位置编码层将线性层的输出特征和256维的位置特征相加,总体的计算过程如下:In a possible embodiment, the constructed front-end neural network includes two layers of two-dimensional convolutional network, one layer of linear network and one layer of position encoding network, wherein the convolutional network has a convolution kernel size of 3 and a step size of 2, The number of convolution kernels is 256. After two layers of two-dimensional convolutional layers, the length of the feature sequence becomes a quarter of the original length. The linear layer projects the output features of the convolutional layer to 256 dimensions, and the position encoding layer converts the linear layer The output features of and the 256-dimensional position features are added, and the overall calculation process is as follows:
Y=ReLU(Conv(ReLU(Conv(X))) (2)Y=ReLU(Conv(ReLU(Conv(X))) (2)
zi=Linear(yi)+pi (3)z i =Linear(y i )+p i (3)
其中Conv(·)表示卷积层;ReLU(·)表示激活函数,其表达式为:Among them, Conv(·) represents the convolutional layer; ReLU(·) represents the activation function, and its expression is:
ReLU(x)=max(0,x) (4)ReLU(x)=max(0,x) (4)
Linear(·)表示线性层,X,Y分别表示对数梅尔谱特征序列和两层二维卷积层的输出特征序列,yi,pi,zi分别表示第i个两层二维卷积层的输出特征、第i个位置特征和第i个前端神经网络的输出特征,其中位置特征每个维度的计算公式为:Linear(·) represents the linear layer, X, Y represent the logarithmic mel spectrum feature sequence and the output feature sequence of the two-layer two-dimensional convolutional layer, respectively, y i , p i , z i represent the i-th two-dimensional two-dimensional The output features of the convolutional layer, the i-th position feature, and the output feature of the i-th front-end neural network, where the calculation formula for each dimension of the position feature is:
pi,2k+1=sin(i/10000k/128) (5)p i,2k+1 = sin(i/10000 k/128 ) (5)
pi,2k+2=cos(i/10000k/128) (6)p i,2k+2 = cos(i/10000 k/128 ) (6)
步骤S203:将第一特征序列进行分块,依次将每块特征序列输入到编码器中并输出多组第二特征序列。Step S203: Divide the first feature sequence into blocks, sequentially input each block of feature sequences into the encoder and output multiple sets of second feature sequences.
在一个可能的实施例中,将每块特征序列输入到基于自注意力机制的在线编码器,该编码器由12个相同的子模块堆叠构成,每个子模块依次为一层自注意力网络、一层残差网络、一层层规范化网络、一层全连接网络、一层残差网络和一层层规范化网络,每层网络输出特征均为256维。In a possible embodiment, each block feature sequence is input to an online encoder based on the self-attention mechanism, which is composed of 12 identical sub-modules stacked, and each sub-module is a layer of self-attention network, One layer of residual network, one layer of normalized network, one layer of fully connected network, one layer of residual network and one layer of normalized network, each layer of network output feature is 256 dimensions.
将第一特征序列进行分块,每块特征序列的长度为64。将每一块特征序列输入到编码器中进行处理,其处理流程图如图3所示,包括步骤S2031-S2038:The first feature sequence is divided into blocks, and the length of each feature sequence is 64. Input each block of feature sequences into the encoder for processing, the processing flow chart is shown in Figure 3, including steps S2031-S2038:
步骤S2031:将每块特征序列输入编码器第一个模块的自注意力网络中,计算如下:Step S2031: Input each feature sequence into the self-attention network of the first module of the encoder, and the calculation is as follows:
SAN(Q,K,V)=[head1,…,head4]WO (7)SAN(Q,K,V)=[head 1 ,...,head 4 ]W O (7)
其中Wi Q,Wi K,Wi V,WO表示参数矩阵,Q表示其中一块特征序列,其右边拼接了64个未来输入特征,K表示其中一块特征序列,其左边拼接了64个历史输入特征,右边拼接了64个未来输入特征,V和K相同。Among them, W i Q , W i K , W i V , and W O represent the parameter matrix, Q represents one of the feature sequences, and 64 future input features are spliced on the right side, and K represents one of the feature sequences, and 64 historical input features are spliced on the left side. Input features, 64 future input features are concatenated on the right, V and K are the same.
步骤S2032:将自注意力网络的输入和输出特征相加作为残差网络的输出特征。Step S2032: Add the input and output features of the self-attention network as the output features of the residual network.
步骤S2033:将残差网络的输出特征输入层规范化网络,计算如下:Step S2033: Input the output features of the residual network into the layer normalization network, and the calculation is as follows:
其中对每一帧输入特征h计算均值μ和方差var,通过模型参数wi和bi对h的每个维度数值进行规整和线性变换,输出新的特征序列 Among them, the mean value μ and variance var are calculated for the input feature h of each frame, and the value of each dimension of h is regularized and linearly transformed through the model parameters w i and b i to output a new feature sequence
步骤S2034:将层规范化网络的输出特征输入全连接网络,该网络的计算公式为:Step S2034: Input the output features of the layer normalization network into the fully connected network, the calculation formula of which is:
F(x)=max(0,xW1+b1)W2+b2 (12)F(x)=max(0,xW 1 +b 1 )W 2 +b 2 (12)
步骤S2035:将全连接网络的输入和输出特征相加作为残差网络的输出特征。Step S2035: add the input and output features of the fully connected network as the output features of the residual network.
步骤S2036:将残差网络的输出特征输入层规范化网络,计算公式与步骤S2033中的计算公式相同。Step S2036: Input the output features of the residual network into the layer normalization network, and the calculation formula is the same as that in step S2033.
步骤S2037:判断当前模块是否为最后一个子模块,若当前模块为最后一个子模块,则结束编码器计算流程;否则,执行步骤S2038。Step S2037: Determine whether the current module is the last sub-module, if the current module is the last sub-module, end the encoder calculation process; otherwise, execute step S2038.
步骤S2038:保存层规范化网络的输出特征,作为下一个子模块的自注意力网络的输入,并执行步骤S2032。Step S2038: Save the output features of the layer normalization network as the input of the self-attention network of the next sub-module, and execute step S2032.
将保存层规范化网络的输出特征,作为下一块特征处理过程中用来拼接的历史帧,并将输出特征输入下一个子模块。The output features of the normalized network of the preservation layer will be used as the historical frame used for splicing in the next feature processing process, and the output features will be input into the next sub-module.
在一个可能的实施例中,输入在线编码器的第一特征序列和在线编码器输出的第二特征序列的长度相同。In a possible embodiment, the lengths of the first feature sequence input to the online encoder and the second feature sequence output by the online encoder are the same.
步骤S204:对所述第二特征序列进行处理,输出多组汉字序列并对所述多组汉字序列进行打分。Step S204: Process the second feature sequence, output multiple sets of Chinese character sequences and score the multiple sets of Chinese character sequences.
通过在线解码器对在线编码器输出的第二特征序列进行建模。其中,基于自注意力机制的在线解码器由6个相同的子模块堆叠构成,每个子模块依次为一层自注意力网络、一层残差网络、一层层规范化网络、一层截断注意力网络、一层残差网络、一层层规范化网络、一层全连接网络、一层残差网络和一层层规范化网络,每层网络输出特征均为256维。The second feature sequence output by the online encoder is modeled by an online decoder. Among them, the online decoder based on the self-attention mechanism is composed of 6 identical sub-modules stacked, and each sub-module is a layer of self-attention network, a layer of residual network, a layer of normalized network, and a layer of truncated attention. network, a layer of residual network, a layer of normalized network, a layer of fully connected network, a layer of residual network and a layer of normalized network, each layer of network output feature is 256 dimensions.
通过在线解码器对在线编码器输出的第二特征序列进行处理。其处理流程图如图4所示,包括步骤:The second feature sequence output by the online encoder is processed by the online decoder. Its processing flowchart is shown in Figure 4, including steps:
步骤S2041:将起始符号的词嵌入特征与位置特征相加形成的特征序列与解码器输出的特征序列输入自注意力网络中。在自注意力网络中的计算公式与公式(7)和公式(8)相同。其中,其中Q表示一个输入特征,K表示当前和所有历史的输入特征组成的特征序列,V和K相同。Step S2041: Input the feature sequence formed by adding the word embedding feature of the starting symbol and the position feature and the feature sequence output by the decoder into the self-attention network. The calculation formula in the self-attention network is the same as formula (7) and formula (8). Among them, where Q represents an input feature, K represents the feature sequence composed of the current and all historical input features, and V and K are the same.
步骤S2042:将自注意力网络的输入和输出特征相加作为残差网络的输出特征。Step S2042: Add the input and output features of the self-attention network as the output features of the residual network.
步骤S2043:将残差网络的输出特征输入层规范化网络,计算公式与步骤S2033中的计算公式相同。Step S2043: Input the output features of the residual network into the layer normalization network, and the calculation formula is the same as that in step S2033.
步骤S2044:将层规范化网络的第i次输出特征qi输入截断注意力网络,计算公式如下,针对每一个编码器的输出特征kj,依次计算j=1,2,…:Step S2044: Input the i-th output feature q i of the layer normalization network into the truncated attention network, the calculation formula is as follows, for each encoder output feature k j , sequentially calculate j=1,2,...:
当某个j满足pij>0.5,并且j大于上一个截断点时,将其确立为当前截断注意力网络的截断点,并计算输出特征:When a certain j satisfies p ij >0.5, and j is greater than the previous truncation point, it is established as the truncation point of the current truncated attention network, and the output features are calculated:
步骤S2045:将截断注意力网络的输入和输出特征相加作为残差网络的输出特征;Step S2045: add the input and output features of the truncated attention network as the output features of the residual network;
步骤S2046:将残差网络的输出特征输入层规范化网络,计算公式与步骤S2033中的计算公式相同。Step S2046: Input the output features of the residual network into the layer normalization network, and the calculation formula is the same as that in step S2033.
步骤S2047:将层规范化网络的输出特征输入全连接网络,计算公式与步骤S2034中的计算公式相同。Step S2047: Input the output features of the layer normalization network into the fully connected network, and the calculation formula is the same as that in step S2034.
步骤S2048:将全连接网络的输入和输出特征相加作为残差网络的输出特征,并将残差网络的输出特征输入层规范化网络。计算公式与步骤S2033中的计算公式相同;Step S2048: add the input and output features of the fully connected network as the output features of the residual network, and input the output features of the residual network into the layer normalization network. The calculation formula is the same as the calculation formula in step S2033;
步骤S2049:判断当前模块是否为最后一个子模块,若当前模块为最后一个子模块,则执行步骤S20411;否则执行步骤S20410。Step S2049: Determine whether the current module is the last sub-module, if the current module is the last sub-module, execute step S20411; otherwise, execute step S20410.
步骤S20410:保存层规范化网络的输出特征,作为下一个子模块的自注意力网络的输入,并执行步骤S2042。Step S20410: Save the output features of the layer normalization network as the input of the self-attention network of the next sub-module, and execute step S2042.
步骤S20411:将层规范化网络的输出特征输入汉字分类器,输出多组汉字以及对应的分数,每一个汉字都将其词嵌入与位置特征相加,输入解码器预测下一个汉字。Step S20411: Input the output features of the layer normalization network into the Chinese character classifier, and output multiple groups of Chinese characters and corresponding scores. For each Chinese character, add its word embedding and position features, and input it into the decoder to predict the next Chinese character.
步骤S205:将分数最高的汉字序列作为最终转写结果。Step S205: The Chinese character sequence with the highest score is taken as the final transcription result.
采用束搜索算法,控制解码器中每次输出汉字的个数,并将其按照分数由高到低排序,取排名前十的汉字分别输入解码器输出下一个汉字,直到解码器输出终止符为止。结束后,将具有最高分数的汉字序列将作为最终的转写结果。Use the beam search algorithm to control the number of Chinese characters output by the decoder each time, and sort them according to the score from high to low. Take the top ten Chinese characters and input them into the decoder to output the next Chinese character until the decoder outputs the terminator. . At the end, the Chinese character sequence with the highest score will be the final transliteration result.
本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。Those skilled in the art should be aware that, in the above one or more examples, the functions described in the present invention may be implemented by hardware, software, firmware or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本发明的保护范围之内。The specific embodiments described above have further described the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only specific embodiments of the present invention and are not intended to limit the scope of the present invention. Protection scope, any modification, equivalent replacement, improvement, etc. made on the basis of the technical solution of the present invention shall be included in the protection scope of the present invention.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911415035.0A CN111128191B (en) | 2019-12-31 | 2019-12-31 | Online end-to-end voice transcription method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911415035.0A CN111128191B (en) | 2019-12-31 | 2019-12-31 | Online end-to-end voice transcription method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111128191A CN111128191A (en) | 2020-05-08 |
CN111128191B true CN111128191B (en) | 2023-03-28 |
Family
ID=70506638
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911415035.0A Active CN111128191B (en) | 2019-12-31 | 2019-12-31 | Online end-to-end voice transcription method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111128191B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111833886B (en) * | 2020-07-27 | 2021-03-23 | 中国科学院声学研究所 | Fully connected multi-scale residual network and its method for voiceprint recognition |
CN115019785A (en) * | 2022-05-24 | 2022-09-06 | 中国科学院自动化研究所 | Streaming voice recognition method and device, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101493812A (en) * | 2009-03-06 | 2009-07-29 | 中国科学院软件研究所 | Tone-character conversion method |
CN107590135A (en) * | 2016-07-07 | 2018-01-16 | 三星电子株式会社 | Automatic translating method, equipment and system |
CN108932941A (en) * | 2017-10-13 | 2018-12-04 | 北京猎户星空科技有限公司 | Audio recognition method, device and computer equipment, storage medium and program product |
CN109146066A (en) * | 2018-11-01 | 2019-01-04 | 重庆邮电大学 | A kind of collaborative virtual learning environment natural interactive method based on speech emotion recognition |
CN110473529A (en) * | 2019-09-09 | 2019-11-19 | 极限元(杭州)智能科技股份有限公司 | A kind of Streaming voice transcription system based on from attention mechanism |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018071389A1 (en) * | 2016-10-10 | 2018-04-19 | Google Llc | Very deep convolutional neural networks for end-to-end speech recognition |
US20180330718A1 (en) * | 2017-05-11 | 2018-11-15 | Mitsubishi Electric Research Laboratories, Inc. | System and Method for End-to-End speech recognition |
-
2019
- 2019-12-31 CN CN201911415035.0A patent/CN111128191B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101493812A (en) * | 2009-03-06 | 2009-07-29 | 中国科学院软件研究所 | Tone-character conversion method |
CN107590135A (en) * | 2016-07-07 | 2018-01-16 | 三星电子株式会社 | Automatic translating method, equipment and system |
CN108932941A (en) * | 2017-10-13 | 2018-12-04 | 北京猎户星空科技有限公司 | Audio recognition method, device and computer equipment, storage medium and program product |
CN109146066A (en) * | 2018-11-01 | 2019-01-04 | 重庆邮电大学 | A kind of collaborative virtual learning environment natural interactive method based on speech emotion recognition |
CN110473529A (en) * | 2019-09-09 | 2019-11-19 | 极限元(杭州)智能科技股份有限公司 | A kind of Streaming voice transcription system based on from attention mechanism |
Non-Patent Citations (1)
Title |
---|
《Attention Is All You Need》;Vaswani, Ashish et.al;《31st Conference on Neural Information Processing Systems》;20171209;第1-11页 * |
Also Published As
Publication number | Publication date |
---|---|
CN111128191A (en) | 2020-05-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11948066B2 (en) | Processing sequences using convolutional neural networks | |
CN112489635B (en) | Multi-mode emotion recognition method based on attention enhancement mechanism | |
CN111477221B (en) | Speech recognition system using bidirectional time sequence convolution and self-attention mechanism network | |
CN111627418B (en) | Training method, synthesizing method, system, device and medium for speech synthesis model | |
Du et al. | Aishell-2: Transforming mandarin asr research into industrial scale | |
CN110992987B (en) | Parallel feature extraction system and method for general specific voice in voice signal | |
CN111048082B (en) | Improved end-to-end speech recognition method | |
CN112466326B (en) | A Speech Emotion Feature Extraction Method Based on Transformer Model Encoder | |
CN109829058B (en) | Classification recognition method for improving dialect recognition accuracy based on multitask learning | |
CN103474069B (en) | For merging the method and system of the recognition result of multiple speech recognition system | |
US20230127787A1 (en) | Method and apparatus for converting voice timbre, method and apparatus for training model, device and medium | |
CN109448707A (en) | Speech recognition method and device, device and medium | |
CN111339278B (en) | Method and device for generating training speech generating model and method and device for generating answer speech | |
CN113327585B (en) | Automatic voice recognition method based on deep neural network | |
CN114333852A (en) | Multi-speaker voice and human voice separation method, terminal device and storage medium | |
CN111128191B (en) | Online end-to-end voice transcription method and system | |
US11810233B2 (en) | End-to-end virtual object animation generation method and apparatus, storage medium, and terminal | |
JP2022551678A (en) | Speech recognition method, device and electronic equipment | |
CN117672268A (en) | Multi-mode voice emotion recognition method based on relative entropy alignment fusion | |
CN113450758A (en) | Speech synthesis method, apparatus, device and medium | |
WO2019184942A1 (en) | Audio exchanging method and system employing linguistic semantics, and coding graph | |
CN113450761A (en) | Parallel speech synthesis method and device based on variational self-encoder | |
CN115240702B (en) | Voice separation method based on voiceprint characteristics | |
CN116312617A (en) | Voice conversion method, device, electronic equipment and storage medium | |
CN114373443A (en) | Speech synthesis method and apparatus, computing device, storage medium, and program product |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |