Wav2Vec2 Trained on LibriSpeech Data

Transcribe an English audio recording

This family of models was trained using self-supervised learning in order to learn powerful representations from speech audio alone, followed by a fine-tuning on transcribed speech. At training time, Wav2Vec2 encodes raw speech audio into latent speech representations via a multilayer convolutional neural network. Parts of these feature representations are then artificially masked and fed to a transformer network that outputs contextualized representations, and the entire model is trained via a contrastive task where the output of the masked data at masked time steps is penalized for being distant from the true representation. Wav2Vec2 achieves state-of-the-art performance on the full LibriSpeech benchmark for noisy speech, while for the clean 100-hour LibriSpeech setup, it outperforms the previous best result while using 100 times less labeled data.

Training Set Information

Model Information

Examples

Resource retrieval

Get the pre-trained net:

In[1]:=

Pick a non-default net by specifying the parameters:

In[5]:=

Evaluation function

Define an evaluation function that runs the net and produces the final transcribed text:

In[9]:=
netevaluate[audio_] := Module[{chars},
  chars = NetModel["Wav2Vec2 Trained on LibriSpeech Data"][audio];
  StringReplace[StringJoin@chars, "|" -> " "]
  ]

Basic usage

Record an audio sample and transcribe it:

In[10]:=

Try it over different audio samples. Notice that the output can contain spelling mistakes, especially with noisy audio. Hence a spellchecker is usually needed as a post-processing step:

In[13]:=
AssociationMap[netevaluate]@
 Map[ExampleData[{"Audio", #}] &, {"FemaleVoice", "MaleVoice", "NoisyTalk"}]
Out[13]=
extractor = NetAppend[
  NetTake[NetModel["Wav2Vec2 Trained on LibriSpeech Data"], "FeatureExtractor"], "Mean" -> AggregationLayer[Mean, 1]]
Out[15]=

Net information

Inspect the sizes of all arrays in the net:

In[18]:=
Information[
 NetModel[
  "Wav2Vec2 Trained on LibriSpeech Data"], "ArraysElementCounts"]
Out[26]=
Information[
 NetModel[
  "Wav2Vec2 Trained on LibriSpeech Data"], "ArraysTotalElementCount"]
Out[28]=
Information[
 NetModel["Wav2Vec2 Trained on LibriSpeech Data"], "LayerTypeCounts"]
Out[30]=
Information[
 NetModel["Wav2Vec2 Trained on LibriSpeech Data"], "SummaryGraphic"]
Out[32]=

Requirements

Wolfram Language 13.2 (December 2022) or above

Resource History

Reference

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant