语音识别-初识

  1. ASRT
    https://blog.ailemon.net/2018/08/29/asrt-a-chinese-speech-recognition-system/
  2. ASR-Automatic Speech Recognition &&&&&&&&&& Paddle Speech
    涉及数据集:Aishell, wenetspeech, librispeech…
    涉及方法:
    ① DeepSpeech2: End-to-End Speech Recognition in English and Mandarin;
    ② u2–Unified Streaming and Non-streaming Two-pass End-to-end Model for Speech Recognition;
    &&&&&&&&&&&&&&&
    Conformer, Transformer, chunk-conformer
    ① SpeedySpeech: Efficient Neural Speech Synthesis (conformer);
    ② Conformer: Convolution-augmented Transformer for Speech Recognition
    &&&&&&&&&&&&&&&
    其中解码方式还涉及,Attention, …and so on.
    不同的解码方式,其 Character Error Rate - CER 也不尽相同。

About End to End :
E2E models combine the acoustic, pronunciation and language models into a single neural network, showing competitive results compared to conventional ASR systems.
There are mainly three popular E2E approaches, namely CTC, recurrent neural network transducer (RNN-T) and attention based encoder-decoder (AED).

关于端到端:
E2E模型将声学、发音和语言模型组合成一个单一的神经网络,与传统ASR系统相比,显示出有竞争力的结果。
主要有三种流行的E2E方法,即CTC、递归神经网络转换器(RNN-T)和基于注意力的编码器-解码器(AED)。


u2

Propose a new framework namely U2 to unify non-streaming and streaming speech recognition.

Framework is based on the hybrid CTC/attention architecture with conformer blocks.
Propose a dynamic chunk-based attention strategy to allow arbitrary right context length.

To support streaming, Modify the conformer block while bringing negligible performance degradation.


Figure:
a Shared Encoder, a CTC Decoder and a Attention Decoder.
The Shared Encoder consists of multiple Transformer or Conformer encoder layers.

The CTC Decoder consists of a linear layer and a log softmax layer;
The CTC loss function is applied over the softmax output in training.

The Attention Decoder consists of multiple Transformer decoder layers.

模型包含三个部分,分别为共享的Encoder、CTC解码器、Attention解码器;

  1. 共享Encoder包含多层transformer或者conformer;
    (encoder-conformer layers are particularly modified.—改成了causal convolution)
  2. CTC解码器为一个全连接层和一个softmax层;
  3. Attention解码器包含多层transformer层。

在这里插入图片描述
Propose a dynamic chunk-based attention strategy to allow arbitrary right context length.

At inference time, the CTC decoder generates n-best hypotheses in a streaming manner.

The inference latency could be easily controlled by only changing the chunk size.

The CTC hypotheses are then rescored by the attention decoder to get the final result.
This efficient rescoring process causes negligible sentence-level latency.
注意力解码器对 CTC 假设进行重新评分以获得最终结果。
这种高效的重新评分过程导致的句子级延迟可以忽略不计。


模型训练loss包含两个部分:CTC loss 和 AED loss
x为输入的声学特征,y为音频标注序列
第一项为 CTC loss,第二项为 AED loss
λ用于平衡CTC与AED;

在这里插入图片描述
在这里插入图片描述


Make the Shared Encoder only see limited right contexts, then CTC decoder could run in a streaming mode in the first pass.----------为了使模型支持流式,需要限制共享Encoder看到未来信息。


为了支持流式语音识别,提出了Dynamic Chunk Training。

U2 只能在共享编码器流式传输时进行流式传输。 在标准的 Transformer 编码器层中使用了完全自注意力。 即,如果靠下图的(a), 做不到流式传输。(a)为标准的self attention,在每个输入时刻t都需要依赖整句的输入。

针对这一问题,最简单的流式思路,限制当前时刻t只看到历史信息,不看任何未来信息,如图(b)所示,但该方案会极大的影响模型识别效果。

而另外一种常用的思路,限制当前时刻t看到有限的未来时刻信息(比如看到未来C帧信息)-----
Limited input t only see a limited right context t+ 1, t+ 2, …, t+W, where W is the right context for each encoder layer, and the total context is accumulated through all the encoder layers.
For example, if we have N encoder layers, each has W right context, the total context is N ∗ W.

在这里插入图片描述
针对于此,提出了chunk attention, 图(C)。
通过固定的块大小 C 将输入分成几个块,深绿色代表当前块,对于每个块,都有输入 [t+1, t+2, …, t+C],每个块都依赖于自身和所有之前的块。
那么编码器的整个延迟取决于块大小,这很容易控制和实现。
可以使用固定的块大小来训练模型,称之为静态块训练,并使用相同的块进行解码。
在模型训练中,Chunk的大小可以是固定的,也可以是动态调整的。

在这里插入图片描述


CTC 解码器以流式传输方式输出第一遍假设。
在输入结束时,注意力解码器使用完整的上下文注意力来获得更好的结果。
这里探讨了两种不同的模式:
1. Attention Decoder mode. -----The CTC results are ignored in this mode.
Attention Decoder generate outputs in an auto-regressive way with the attention of the output of Shared Encoder.
2. Rescoring mode.
来自 CTC 的 n 最佳假设由注意力解码器在教师强制模式下使用共享编码器的输出进行评分。 最好的重新评分假设用作最终结果。 这种模式避免了自回归过程并获得更好的实时因子。
此外,可以通过简单的方式对 CTC 分数进行加权组合以获得更好的结果。

在这里插入图片描述


题外1::
CTC靠谱链接:
https://www.cnblogs.com/liaohuiqiang/p/9953978.html
https://zhuanlan.zhihu.com/p/42719047


题外2::
SoX( Sound eXchange)是一个跨平台(Windows,Linux,MacOS 等)的命令行实用程序,可以将各种格式的音频文件转换为需要的其他格式。
SoX 还可以对输入的音频文件应用各种效果,也支持在大多数平台上播放和录制音频文件。

链接:https://www.jianshu.com/p/be8977de4a6b


题外3::
Python .mp3转.wav

from pydub import AudioSegment

wav_file = 'now.wav'

song = AudioSegment.from_mp3('2.mp3')
song.export(wav_file , format="wav")

其中AudioSegment需要装ffmpeg
不是pip install
而是下载ffmpeg的文件,里面包含bin/ffmpeg.exe,并在环境变量中配置才行;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值