• Docs >
  • ASR Inference with CTC Decoder
Shortcuts

ASR Inference with CTC Decoder

Author: Caroline Chen

This tutorial shows how to perform speech recognition inference using a CTC beam search decoder with lexicon constraint and KenLM language model support. We demonstrate this on a pretrained wav2vec 2.0 model trained using CTC loss.

Note

This tutorial requires torchaudio prototype features.

torchaudio prototype features are available on nightly builds. Please refer to https://pytorch.org/get-started/locally/ for instructions.

The interfaces of prototype features are unstable and subject to change. Please refer to the nightly build documentation for the up-to-date API references.

Overview

Beam search decoding works by iteratively expanding text hypotheses (beams) with next possible characters, and maintaining only the hypotheses with the highest scores at each time step. A language model can be incorporated into the scoring computation, and adding a lexicon constraint restricts the next possible tokens for the hypotheses so that only words from the lexicon can be generated.

The underlying implementation is ported from Flashlight’s beam search decoder. A mathematical formula for the decoder optimization can be found in the Wav2Letter paper, and a more detailed algorithm can be found in this blog.

Running ASR inference using a CTC Beam Search decoder with a KenLM language model and lexicon constraint requires the following components

  • Acoustic Model: model predicting phonetics from audio waveforms

  • Tokens: the possible predicted tokens from the acoustic model

  • Lexicon: mapping between possible words and their corresponding tokens sequence

  • KenLM: n-gram language model trained with the KenLM library

Preparation

First we import the necessary utilities and fetch the data that we are working with

import time
from typing import List

import IPython
import matplotlib.pyplot as plt
import torch
import torchaudio

try:
    import torchaudio.prototype.ctc_decoder
except ModuleNotFoundError:
    try:
        import google.colab

        print(
            """
            To enable running this notebook in Google Colab, install nightly
            torch and torchaudio builds by adding the following code block to the top
            of the notebook before running it:

            !pip3 uninstall -y torch torchvision torchaudio
            !pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu
            """
        )
    except ModuleNotFoundError:
        pass
    raise

Acoustic Model and Data

We use the pretrained Wav2Vec 2.0 Base model that is finetuned on 10 min of the LibriSpeech dataset, which can be loaded in using torchaudio.pipelines(). For more detail on running Wav2Vec 2.0 speech recognition pipelines in torchaudio, please refer to this tutorial.

bundle = torchaudio.pipelines.WAV2VEC2_ASR_BASE_10M
acoustic_model = bundle.get_model()

Out:

Downloading: "https://download.pytorch.org/torchaudio/models/wav2vec2_fairseq_base_ls960_asr_ll10m.pth" to /root/.cache/torch/hub/checkpoints/wav2vec2_fairseq_base_ls960_asr_ll10m.pth

  0%|          | 0.00/360M [00:00<?, ?B/s]
  2%|1         | 6.70M/360M [00:00<00:06, 54.5MB/s]
  3%|3         | 11.9M/360M [00:00<00:07, 49.9MB/s]
  5%|4         | 16.6M/360M [00:00<00:07, 46.3MB/s]
  9%|8         | 32.0M/360M [00:00<00:05, 67.4MB/s]
 13%|#2        | 46.0M/360M [00:00<00:03, 89.3MB/s]
 15%|#5        | 54.9M/360M [00:00<00:04, 74.0MB/s]
 17%|#7        | 62.4M/360M [00:00<00:04, 73.1MB/s]
 19%|#9        | 69.6M/360M [00:01<00:05, 53.9MB/s]
 22%|##2       | 80.0M/360M [00:01<00:04, 65.1MB/s]
 26%|##5       | 92.6M/360M [00:01<00:03, 72.7MB/s]
 28%|##7       | 100M/360M [00:01<00:04, 58.6MB/s]
 31%|###       | 111M/360M [00:01<00:04, 59.5MB/s]
 32%|###2      | 117M/360M [00:02<00:04, 51.8MB/s]
 36%|###5      | 128M/360M [00:02<00:04, 59.6MB/s]
 40%|###9      | 144M/360M [00:02<00:03, 72.7MB/s]
 42%|####1     | 151M/360M [00:02<00:03, 63.2MB/s]
 45%|####4     | 161M/360M [00:02<00:02, 70.2MB/s]
 49%|####8     | 176M/360M [00:02<00:02, 82.8MB/s]
 53%|#####3    | 192M/360M [00:02<00:01, 98.2MB/s]
 58%|#####7    | 208M/360M [00:02<00:01, 111MB/s]
 61%|######    | 219M/360M [00:03<00:01, 104MB/s]
 64%|######3   | 230M/360M [00:03<00:01, 107MB/s]
 67%|######6   | 241M/360M [00:03<00:01, 87.7MB/s]
 69%|######9   | 250M/360M [00:03<00:01, 71.9MB/s]
 71%|#######1  | 257M/360M [00:03<00:01, 55.3MB/s]
 76%|#######6  | 274M/360M [00:03<00:01, 77.9MB/s]
 82%|########1 | 294M/360M [00:04<00:00, 105MB/s]
 85%|########5 | 307M/360M [00:04<00:00, 99.1MB/s]
 89%|########8 | 320M/360M [00:04<00:00, 106MB/s]
 92%|#########2| 332M/360M [00:04<00:00, 105MB/s]
 95%|#########5| 342M/360M [00:04<00:00, 92.8MB/s]
 98%|#########7| 352M/360M [00:04<00:00, 76.8MB/s]
100%|##########| 360M/360M [00:04<00:00, 77.4MB/s]

We will load a sample from the LibriSpeech test-other dataset.

hub_dir = torch.hub.get_dir()

speech_url = "https://download.pytorch.org/torchaudio/tutorial-assets/ctc-decoding/1688-142285-0007.wav"
speech_file = f"{hub_dir}/speech.wav"

torch.hub.download_url_to_file(speech_url, speech_file)

IPython.display.Audio(speech_file)

Out:

  0%|          | 0.00/441k [00:00<?, ?B/s]
100%|##########| 441k/441k [00:00<00:00, 32.5MB/s]


The transcript corresponding to this audio file is

i really was very much afraid of showing him how much shocked i was at some parts of what he said
waveform, sample_rate = torchaudio.load(speech_file)

if sample_rate != bundle.sample_rate:
    waveform = torchaudio.functional.resample(waveform, sample_rate, bundle.sample_rate)

Files and Data for Decoder

Next, we load in our token, lexicon, and KenLM data, which are used by the decoder to predict words from the acoustic model output. Pretrained files for the LibriSpeech dataset can be downloaded through torchaudio, or the user can provide their own files.

Tokens

The tokens are the possible symbols that the acoustic model can predict, including the blank and silent symbols. It can either be passed in as a file, where each line consists of the tokens corresponding to the same index, or as a list of tokens, each mapping to a unique index.

# tokens.txt
_
|
e
t
...
tokens = [label.lower() for label in bundle.get_labels()]
print(tokens)

Out:

['-', '|', 'e', 't', 'a', 'o', 'n', 'i', 'h', 's', 'r', 'd', 'l', 'u', 'm', 'w', 'c', 'f', 'g', 'y', 'p', 'b', 'v', 'k', "'", 'x', 'j', 'q', 'z']

Lexicon

The lexicon is a mapping from words to their corresponding tokens sequence, and is used to restrict the search space of the decoder to only words from the lexicon. The expected format of the lexicon file is a line per word, with a word followed by its space-split tokens.

# lexcion.txt
a a |
able a b l e |
about a b o u t |
...
...

KenLM

This is an n-gram language model trained with the KenLM library. Both the .arpa or the binarized .bin LM can be used, but the binary format is recommended for faster loading.

The language model used in this tutorial is a 4-gram KenLM trained using LibriSpeech.

Downloading Pretrained Files

Pretrained files for the LibriSpeech dataset can be downloaded using download_pretrained_files.

Note: this cell may take a couple of minutes to run, as the language model can be large

from torchaudio.prototype.ctc_decoder import download_pretrained_files

files = download_pretrained_files("librispeech-4-gram")

print(files)

Out:

  0%|          | 0.00/4.97M [00:00<?, ?B/s]
 85%|########5 | 4.23M/4.97M [00:00<00:00, 27.7MB/s]
100%|##########| 4.97M/4.97M [00:00<00:00, 31.1MB/s]

  0%|          | 0.00/57.0 [00:00<?, ?B/s]
100%|##########| 57.0/57.0 [00:00<00:00, 43.2kB/s]

  0%|          | 0.00/2.91G [00:00<?, ?B/s]
  1%|          | 16.0M/2.91G [00:00<00:24, 126MB/s]
  1%|          | 28.0M/2.91G [00:00<00:25, 122MB/s]
  1%|1         | 39.6M/2.91G [00:00<00:33, 92.1MB/s]
  2%|1         | 48.8M/2.91G [00:00<00:50, 60.3MB/s]
  2%|1         | 55.8M/2.91G [00:00<00:48, 62.7MB/s]
  2%|2         | 62.8M/2.91G [00:00<00:47, 64.5MB/s]
  2%|2         | 69.6M/2.91G [00:01<00:53, 57.2MB/s]
  3%|2         | 79.7M/2.91G [00:01<00:51, 59.4MB/s]
  3%|2         | 85.7M/2.91G [00:01<01:02, 48.7MB/s]
  3%|3         | 94.8M/2.91G [00:01<00:56, 53.9MB/s]
  3%|3         | 100M/2.91G [00:01<00:59, 50.7MB/s]
  4%|3         | 107M/2.91G [00:01<01:03, 47.4MB/s]
  4%|3         | 111M/2.91G [00:01<01:05, 45.8MB/s]
  4%|3         | 116M/2.91G [00:02<01:17, 38.9MB/s]
  4%|4         | 123M/2.91G [00:02<01:04, 46.4MB/s]
  4%|4         | 132M/2.91G [00:02<00:51, 57.9MB/s]
  5%|4         | 144M/2.91G [00:02<00:41, 71.4MB/s]
  5%|5         | 151M/2.91G [00:02<00:45, 65.7MB/s]
  5%|5         | 160M/2.91G [00:02<00:46, 62.9MB/s]
  6%|5         | 175M/2.91G [00:02<00:39, 73.7MB/s]
  6%|6         | 182M/2.91G [00:03<00:47, 61.9MB/s]
  6%|6         | 191M/2.91G [00:03<00:46, 62.8MB/s]
  7%|6         | 197M/2.91G [00:03<00:47, 61.7MB/s]
  7%|6         | 208M/2.91G [00:03<00:42, 68.0MB/s]
  8%|7         | 224M/2.91G [00:03<00:36, 79.6MB/s]
  8%|7         | 231M/2.91G [00:03<00:46, 61.7MB/s]
  8%|7         | 238M/2.91G [00:04<00:48, 59.2MB/s]
  8%|8         | 243M/2.91G [00:04<00:55, 52.2MB/s]
  8%|8         | 253M/2.91G [00:04<00:46, 61.6MB/s]
  9%|8         | 259M/2.91G [00:04<01:02, 45.9MB/s]
  9%|9         | 271M/2.91G [00:04<00:50, 56.2MB/s]
  9%|9         | 277M/2.91G [00:04<00:48, 58.3MB/s]
 10%|9         | 283M/2.91G [00:04<00:49, 57.4MB/s]
 10%|9         | 289M/2.91G [00:05<00:57, 49.2MB/s]
 10%|9         | 295M/2.91G [00:05<00:56, 49.8MB/s]
 10%|#         | 300M/2.91G [00:05<01:00, 46.6MB/s]
 10%|#         | 305M/2.91G [00:05<01:09, 40.4MB/s]
 11%|#         | 319M/2.91G [00:05<00:53, 51.7MB/s]
 11%|#         | 324M/2.91G [00:05<01:00, 46.1MB/s]
 11%|#1        | 335M/2.91G [00:06<00:51, 53.4MB/s]
 11%|#1        | 340M/2.91G [00:06<00:57, 47.9MB/s]
 12%|#1        | 357M/2.91G [00:06<00:36, 74.6MB/s]
 12%|#2        | 367M/2.91G [00:06<00:33, 82.3MB/s]
 13%|#2        | 376M/2.91G [00:06<00:36, 74.5MB/s]
 13%|#2        | 384M/2.91G [00:06<00:35, 75.9MB/s]
 13%|#3        | 400M/2.91G [00:06<00:30, 90.1MB/s]
 14%|#3        | 413M/2.91G [00:06<00:29, 91.2MB/s]
 14%|#4        | 422M/2.91G [00:07<00:31, 85.4MB/s]
 14%|#4        | 432M/2.91G [00:07<00:29, 89.1MB/s]
 15%|#4        | 440M/2.91G [00:07<00:33, 79.6MB/s]
 15%|#5        | 448M/2.91G [00:07<00:43, 61.7MB/s]
 16%|#5        | 464M/2.91G [00:07<00:35, 74.4MB/s]
 16%|#5        | 472M/2.91G [00:07<00:35, 73.1MB/s]
 16%|#6        | 480M/2.91G [00:08<00:36, 70.9MB/s]
 17%|#6        | 496M/2.91G [00:08<00:28, 90.4MB/s]
 17%|#6        | 505M/2.91G [00:08<00:30, 85.6MB/s]
 17%|#7        | 513M/2.91G [00:08<00:31, 82.9MB/s]
 18%|#7        | 528M/2.91G [00:08<00:32, 78.6MB/s]
 18%|#8        | 542M/2.91G [00:08<00:27, 94.2MB/s]
 19%|#8        | 552M/2.91G [00:08<00:33, 75.4MB/s]
 19%|#8        | 560M/2.91G [00:09<00:40, 63.2MB/s]
 19%|#9        | 576M/2.91G [00:09<00:34, 74.1MB/s]
 20%|#9        | 591M/2.91G [00:09<00:38, 64.8MB/s]
 20%|##        | 598M/2.91G [00:09<00:41, 60.9MB/s]
 20%|##        | 608M/2.91G [00:09<00:38, 63.9MB/s]
 21%|##        | 623M/2.91G [00:09<00:32, 76.9MB/s]
 21%|##1       | 631M/2.91G [00:10<00:34, 70.6MB/s]
 21%|##1       | 640M/2.91G [00:10<00:34, 71.7MB/s]
 22%|##1       | 647M/2.91G [00:10<00:35, 69.9MB/s]
 22%|##2       | 656M/2.91G [00:10<00:37, 65.0MB/s]
 23%|##2       | 672M/2.91G [00:10<00:33, 72.4MB/s]
 23%|##2       | 679M/2.91G [00:10<00:35, 67.3MB/s]
 23%|##3       | 688M/2.91G [00:11<00:36, 66.5MB/s]
 23%|##3       | 694M/2.91G [00:11<00:40, 59.7MB/s]
 24%|##3       | 704M/2.91G [00:11<00:36, 66.1MB/s]
 24%|##4       | 719M/2.91G [00:11<00:30, 78.2MB/s]
 24%|##4       | 726M/2.91G [00:11<00:36, 65.3MB/s]
 25%|##4       | 733M/2.91G [00:11<00:36, 65.4MB/s]
 25%|##4       | 739M/2.91G [00:11<00:43, 54.1MB/s]
 25%|##5       | 751M/2.91G [00:12<00:33, 69.8MB/s]
 25%|##5       | 759M/2.91G [00:12<00:34, 66.6MB/s]
 26%|##5       | 766M/2.91G [00:12<00:34, 67.2MB/s]
 26%|##5       | 772M/2.91G [00:12<00:37, 61.6MB/s]
 26%|##6       | 781M/2.91G [00:12<00:35, 64.1MB/s]
 26%|##6       | 787M/2.91G [00:12<00:47, 48.2MB/s]
 27%|##6       | 797M/2.91G [00:12<00:39, 57.4MB/s]
 27%|##6       | 803M/2.91G [00:13<01:04, 35.2MB/s]
 27%|##7       | 808M/2.91G [00:13<01:02, 36.7MB/s]
 27%|##7       | 812M/2.91G [00:13<00:58, 38.7MB/s]
 27%|##7       | 818M/2.91G [00:13<00:52, 43.5MB/s]
 28%|##7       | 832M/2.91G [00:13<00:43, 51.5MB/s]
 28%|##8       | 847M/2.91G [00:13<00:33, 66.8MB/s]
 29%|##8       | 854M/2.91G [00:14<00:35, 62.0MB/s]
 29%|##8       | 864M/2.91G [00:14<00:32, 69.0MB/s]
 29%|##9       | 875M/2.91G [00:14<00:27, 79.8MB/s]
 30%|##9       | 883M/2.91G [00:14<00:33, 64.9MB/s]
 30%|##9       | 891M/2.91G [00:14<00:34, 62.7MB/s]
 30%|###       | 898M/2.91G [00:14<00:37, 57.9MB/s]
 31%|###       | 912M/2.91G [00:15<00:33, 65.4MB/s]
 31%|###       | 918M/2.91G [00:15<00:34, 63.4MB/s]
 31%|###1      | 928M/2.91G [00:15<00:32, 66.9MB/s]
 31%|###1      | 934M/2.91G [00:15<00:37, 57.6MB/s]
 32%|###1      | 943M/2.91G [00:15<00:34, 62.3MB/s]
 32%|###1      | 949M/2.91G [00:15<00:41, 51.8MB/s]
 32%|###2      | 960M/2.91G [00:15<00:36, 58.7MB/s]
 32%|###2      | 968M/2.91G [00:16<00:32, 64.1MB/s]
 33%|###2      | 976M/2.91G [00:16<00:36, 57.6MB/s]
 33%|###3      | 988M/2.91G [00:16<00:29, 71.8MB/s]
 33%|###3      | 997M/2.91G [00:16<00:26, 77.6MB/s]
 34%|###3      | 0.98G/2.91G [00:16<00:28, 71.5MB/s]
 34%|###4      | 1.00G/2.91G [00:16<00:23, 87.7MB/s]
 35%|###4      | 1.01G/2.91G [00:16<00:25, 81.1MB/s]
 35%|###4      | 1.02G/2.91G [00:16<00:26, 75.4MB/s]
 35%|###5      | 1.02G/2.91G [00:17<00:28, 71.6MB/s]
 35%|###5      | 1.03G/2.91G [00:17<00:27, 74.3MB/s]
 36%|###5      | 1.04G/2.91G [00:17<00:35, 56.4MB/s]
 36%|###5      | 1.05G/2.91G [00:17<00:32, 62.4MB/s]
 36%|###6      | 1.05G/2.91G [00:17<00:35, 56.0MB/s]
 36%|###6      | 1.06G/2.91G [00:17<00:45, 44.0MB/s]
 37%|###6      | 1.06G/2.91G [00:18<00:55, 35.6MB/s]
 37%|###6      | 1.07G/2.91G [00:18<00:49, 39.6MB/s]
 37%|###7      | 1.08G/2.91G [00:18<00:48, 40.3MB/s]
 37%|###7      | 1.08G/2.91G [00:18<00:53, 36.6MB/s]
 37%|###7      | 1.09G/2.91G [00:18<00:46, 42.5MB/s]
 38%|###7      | 1.09G/2.91G [00:18<00:43, 44.5MB/s]
 38%|###8      | 1.11G/2.91G [00:19<00:31, 61.6MB/s]
 39%|###8      | 1.12G/2.91G [00:19<00:23, 81.4MB/s]
 39%|###8      | 1.13G/2.91G [00:19<00:24, 77.8MB/s]
 39%|###9      | 1.14G/2.91G [00:19<00:24, 76.4MB/s]
 40%|###9      | 1.16G/2.91G [00:19<00:23, 80.7MB/s]
 40%|####      | 1.17G/2.91G [00:19<00:20, 91.1MB/s]
 41%|####      | 1.19G/2.91G [00:20<00:23, 78.8MB/s]
 41%|####1     | 1.19G/2.91G [00:20<00:24, 74.0MB/s]
 41%|####1     | 1.20G/2.91G [00:20<00:25, 72.9MB/s]
 42%|####1     | 1.21G/2.91G [00:20<00:25, 72.0MB/s]
 42%|####1     | 1.22G/2.91G [00:20<00:25, 72.4MB/s]
 42%|####2     | 1.23G/2.91G [00:20<00:29, 61.6MB/s]
 42%|####2     | 1.23G/2.91G [00:20<00:28, 62.5MB/s]
 43%|####2     | 1.25G/2.91G [00:20<00:20, 85.1MB/s]
 43%|####3     | 1.26G/2.91G [00:21<00:23, 75.2MB/s]
 44%|####3     | 1.27G/2.91G [00:21<00:26, 67.7MB/s]
 44%|####3     | 1.27G/2.91G [00:21<00:26, 65.4MB/s]
 44%|####4     | 1.28G/2.91G [00:21<00:31, 55.0MB/s]
 44%|####4     | 1.29G/2.91G [00:21<00:33, 51.6MB/s]
 45%|####4     | 1.30G/2.91G [00:21<00:30, 57.3MB/s]
 45%|####5     | 1.31G/2.91G [00:22<00:22, 77.1MB/s]
 45%|####5     | 1.32G/2.91G [00:22<00:27, 63.2MB/s]
 46%|####5     | 1.33G/2.91G [00:22<00:25, 67.2MB/s]
 46%|####5     | 1.34G/2.91G [00:22<00:25, 66.4MB/s]
 46%|####6     | 1.34G/2.91G [00:22<00:25, 65.0MB/s]
 46%|####6     | 1.35G/2.91G [00:22<00:23, 72.0MB/s]
 47%|####6     | 1.36G/2.91G [00:23<00:40, 41.3MB/s]
 47%|####6     | 1.37G/2.91G [00:23<00:36, 46.0MB/s]
 47%|####7     | 1.37G/2.91G [00:23<00:31, 52.9MB/s]
 47%|####7     | 1.38G/2.91G [00:23<00:31, 52.3MB/s]
 48%|####7     | 1.39G/2.91G [00:23<00:28, 58.0MB/s]
 48%|####8     | 1.40G/2.91G [00:23<00:24, 66.4MB/s]
 48%|####8     | 1.41G/2.91G [00:23<00:26, 61.7MB/s]
 49%|####9     | 1.43G/2.91G [00:23<00:16, 99.1MB/s]
 49%|####9     | 1.44G/2.91G [00:24<00:16, 97.3MB/s]
 50%|####9     | 1.45G/2.91G [00:24<00:15, 99.5MB/s]
 50%|#####     | 1.47G/2.91G [00:24<00:14, 106MB/s]
 51%|#####     | 1.48G/2.91G [00:24<00:17, 89.2MB/s]
 51%|#####1    | 1.49G/2.91G [00:24<00:23, 63.9MB/s]
 51%|#####1    | 1.49G/2.91G [00:24<00:24, 62.2MB/s]
 52%|#####1    | 1.50G/2.91G [00:25<00:30, 50.3MB/s]
 52%|#####1    | 1.51G/2.91G [00:25<00:26, 55.8MB/s]
 52%|#####2    | 1.52G/2.91G [00:25<00:27, 54.8MB/s]
 52%|#####2    | 1.52G/2.91G [00:25<00:27, 54.6MB/s]
 53%|#####2    | 1.53G/2.91G [00:25<00:27, 53.6MB/s]
 53%|#####2    | 1.54G/2.91G [00:26<00:33, 44.2MB/s]
 53%|#####3    | 1.55G/2.91G [00:26<00:27, 52.5MB/s]
 53%|#####3    | 1.55G/2.91G [00:26<00:29, 49.2MB/s]
 54%|#####3    | 1.56G/2.91G [00:26<00:22, 63.8MB/s]
 54%|#####4    | 1.58G/2.91G [00:26<00:18, 77.0MB/s]
 55%|#####4    | 1.59G/2.91G [00:26<00:16, 84.3MB/s]
 55%|#####5    | 1.60G/2.91G [00:26<00:18, 78.0MB/s]
 55%|#####5    | 1.61G/2.91G [00:26<00:18, 76.5MB/s]
 56%|#####5    | 1.62G/2.91G [00:27<00:19, 71.1MB/s]
 56%|#####5    | 1.62G/2.91G [00:27<00:17, 78.3MB/s]
 56%|#####6    | 1.63G/2.91G [00:27<00:19, 69.9MB/s]
 56%|#####6    | 1.64G/2.91G [00:27<00:22, 61.9MB/s]
 57%|#####6    | 1.65G/2.91G [00:27<00:17, 77.8MB/s]
 57%|#####7    | 1.66G/2.91G [00:27<00:19, 70.3MB/s]
 57%|#####7    | 1.67G/2.91G [00:28<00:22, 60.3MB/s]
 58%|#####7    | 1.69G/2.91G [00:28<00:17, 76.5MB/s]
 58%|#####8    | 1.70G/2.91G [00:28<00:17, 72.8MB/s]
 59%|#####8    | 1.70G/2.91G [00:28<00:19, 66.5MB/s]
 59%|#####8    | 1.71G/2.91G [00:28<00:17, 72.4MB/s]
 59%|#####9    | 1.72G/2.91G [00:28<00:21, 59.0MB/s]
 60%|#####9    | 1.73G/2.91G [00:28<00:17, 71.6MB/s]
 60%|#####9    | 1.74G/2.91G [00:29<00:21, 59.0MB/s]
 60%|######    | 1.75G/2.91G [00:29<00:23, 53.6MB/s]
 60%|######    | 1.75G/2.91G [00:29<00:24, 50.2MB/s]
 61%|######    | 1.76G/2.91G [00:29<00:20, 59.8MB/s]
 61%|######    | 1.77G/2.91G [00:29<00:24, 49.4MB/s]
 61%|######1   | 1.78G/2.91G [00:29<00:23, 52.4MB/s]
 61%|######1   | 1.79G/2.91G [00:30<00:24, 49.6MB/s]
 62%|######1   | 1.80G/2.91G [00:30<00:22, 53.5MB/s]
 62%|######2   | 1.81G/2.91G [00:30<00:16, 71.5MB/s]
 62%|######2   | 1.82G/2.91G [00:30<00:17, 66.3MB/s]
 63%|######2   | 1.83G/2.91G [00:30<00:17, 67.1MB/s]
 63%|######3   | 1.84G/2.91G [00:30<00:13, 86.8MB/s]
 64%|######3   | 1.85G/2.91G [00:30<00:14, 79.6MB/s]
 64%|######3   | 1.86G/2.91G [00:31<00:18, 61.8MB/s]
 64%|######4   | 1.87G/2.91G [00:31<00:14, 79.0MB/s]
 65%|######4   | 1.89G/2.91G [00:31<00:12, 87.3MB/s]
 65%|######5   | 1.90G/2.91G [00:31<00:13, 83.1MB/s]
 66%|######5   | 1.91G/2.91G [00:31<00:14, 71.9MB/s]
 66%|######6   | 1.92G/2.91G [00:31<00:14, 74.6MB/s]
 66%|######6   | 1.93G/2.91G [00:32<00:16, 64.4MB/s]
 67%|######6   | 1.94G/2.91G [00:32<00:17, 58.2MB/s]
 67%|######6   | 1.94G/2.91G [00:32<00:18, 55.1MB/s]
 67%|######7   | 1.95G/2.91G [00:32<00:18, 56.4MB/s]
 68%|######7   | 1.96G/2.91G [00:32<00:14, 69.4MB/s]
 68%|######7   | 1.97G/2.91G [00:32<00:15, 66.3MB/s]
 68%|######8   | 1.98G/2.91G [00:33<00:14, 69.4MB/s]
 68%|######8   | 1.99G/2.91G [00:33<00:15, 64.6MB/s]
 69%|######8   | 2.00G/2.91G [00:33<00:14, 65.2MB/s]
 69%|######9   | 2.02G/2.91G [00:33<00:11, 80.3MB/s]
 70%|######9   | 2.03G/2.91G [00:33<00:11, 80.5MB/s]
 70%|######9   | 2.03G/2.91G [00:33<00:13, 69.4MB/s]
 70%|#######   | 2.05G/2.91G [00:33<00:12, 76.6MB/s]
 71%|#######   | 2.05G/2.91G [00:34<00:15, 59.2MB/s]
 71%|#######   | 2.06G/2.91G [00:34<00:14, 62.3MB/s]
 71%|#######1  | 2.07G/2.91G [00:34<00:12, 71.6MB/s]
 71%|#######1  | 2.08G/2.91G [00:34<00:16, 54.1MB/s]
 72%|#######1  | 2.09G/2.91G [00:34<00:14, 61.9MB/s]
 72%|#######2  | 2.11G/2.91G [00:35<00:12, 68.3MB/s]
 73%|#######2  | 2.12G/2.91G [00:35<00:13, 64.5MB/s]
 73%|#######3  | 2.12G/2.91G [00:35<00:13, 61.9MB/s]
 74%|#######3  | 2.14G/2.91G [00:35<00:11, 72.8MB/s]
 74%|#######3  | 2.15G/2.91G [00:35<00:11, 70.2MB/s]
 74%|#######4  | 2.15G/2.91G [00:35<00:11, 69.7MB/s]
 74%|#######4  | 2.16G/2.91G [00:35<00:12, 64.5MB/s]
 74%|#######4  | 2.17G/2.91G [00:36<00:13, 58.7MB/s]
 75%|#######4  | 2.17G/2.91G [00:36<00:12, 63.0MB/s]
 75%|#######5  | 2.19G/2.91G [00:36<00:09, 83.1MB/s]
 75%|#######5  | 2.19G/2.91G [00:36<00:11, 67.1MB/s]
 76%|#######5  | 2.20G/2.91G [00:36<00:12, 62.0MB/s]
 76%|#######5  | 2.21G/2.91G [00:36<00:14, 51.3MB/s]
 76%|#######6  | 2.22G/2.91G [00:36<00:12, 60.2MB/s]
 76%|#######6  | 2.22G/2.91G [00:37<00:14, 52.4MB/s]
 77%|#######6  | 2.23G/2.91G [00:37<00:13, 53.5MB/s]
 77%|#######7  | 2.25G/2.91G [00:37<00:09, 74.7MB/s]
 78%|#######7  | 2.26G/2.91G [00:37<00:09, 76.6MB/s]
 78%|#######8  | 2.27G/2.91G [00:37<00:08, 77.7MB/s]
 78%|#######8  | 2.28G/2.91G [00:37<00:08, 80.9MB/s]
 79%|#######8  | 2.29G/2.91G [00:38<00:11, 57.0MB/s]
 79%|#######8  | 2.30G/2.91G [00:38<00:11, 58.0MB/s]
 79%|#######9  | 2.30G/2.91G [00:38<00:12, 53.4MB/s]
 79%|#######9  | 2.31G/2.91G [00:38<00:10, 62.3MB/s]
 80%|#######9  | 2.33G/2.91G [00:38<00:09, 69.2MB/s]
 80%|########  | 2.33G/2.91G [00:38<00:09, 64.2MB/s]
 81%|########  | 2.34G/2.91G [00:38<00:08, 68.1MB/s]
 81%|########  | 2.35G/2.91G [00:39<00:08, 67.8MB/s]
 81%|########1 | 2.36G/2.91G [00:39<00:08, 72.1MB/s]
 81%|########1 | 2.37G/2.91G [00:39<00:10, 56.9MB/s]
 82%|########1 | 2.38G/2.91G [00:39<00:07, 72.8MB/s]
 82%|########2 | 2.39G/2.91G [00:39<00:06, 85.6MB/s]
 82%|########2 | 2.40G/2.91G [00:39<00:06, 83.8MB/s]
 83%|########2 | 2.41G/2.91G [00:39<00:09, 58.6MB/s]
 83%|########3 | 2.42G/2.91G [00:40<00:06, 75.9MB/s]
 83%|########3 | 2.43G/2.91G [00:40<00:06, 75.1MB/s]
 84%|########3 | 2.44G/2.91G [00:40<00:06, 76.8MB/s]
 84%|########4 | 2.45G/2.91G [00:40<00:05, 90.5MB/s]
 85%|########4 | 2.46G/2.91G [00:40<00:07, 60.4MB/s]
 85%|########4 | 2.47G/2.91G [00:40<00:09, 51.6MB/s]
 85%|########5 | 2.47G/2.91G [00:41<00:09, 51.7MB/s]
 85%|########5 | 2.48G/2.91G [00:41<00:08, 56.2MB/s]
 86%|########5 | 2.49G/2.91G [00:41<00:08, 54.1MB/s]
 86%|########5 | 2.50G/2.91G [00:41<00:06, 64.6MB/s]
 86%|########6 | 2.51G/2.91G [00:41<00:08, 53.5MB/s]
 86%|########6 | 2.51G/2.91G [00:41<00:07, 57.2MB/s]
 87%|########6 | 2.52G/2.91G [00:42<00:09, 45.8MB/s]
 87%|########6 | 2.53G/2.91G [00:42<00:07, 56.3MB/s]
 87%|########7 | 2.55G/2.91G [00:42<00:05, 71.8MB/s]
 88%|########7 | 2.55G/2.91G [00:42<00:05, 71.0MB/s]
 88%|########8 | 2.56G/2.91G [00:42<00:05, 66.9MB/s]
 89%|########8 | 2.58G/2.91G [00:42<00:04, 80.0MB/s]
 89%|########8 | 2.58G/2.91G [00:42<00:04, 78.2MB/s]
 89%|########9 | 2.59G/2.91G [00:42<00:04, 74.3MB/s]
 89%|########9 | 2.60G/2.91G [00:43<00:04, 70.9MB/s]
 90%|########9 | 2.61G/2.91G [00:43<00:04, 77.6MB/s]
 90%|######### | 2.62G/2.91G [00:43<00:03, 76.9MB/s]
 90%|######### | 2.63G/2.91G [00:43<00:04, 70.5MB/s]
 91%|######### | 2.64G/2.91G [00:43<00:04, 61.2MB/s]
 91%|######### | 2.65G/2.91G [00:43<00:04, 56.9MB/s]
 91%|#########1| 2.66G/2.91G [00:44<00:04, 59.0MB/s]
 91%|#########1| 2.66G/2.91G [00:44<00:05, 50.1MB/s]
 92%|#########1| 2.67G/2.91G [00:44<00:05, 50.3MB/s]
 92%|#########1| 2.67G/2.91G [00:44<00:05, 45.8MB/s]
 92%|#########2| 2.69G/2.91G [00:44<00:04, 54.8MB/s]
 93%|#########2| 2.70G/2.91G [00:44<00:02, 75.2MB/s]
 93%|#########3| 2.71G/2.91G [00:45<00:03, 65.9MB/s]
 93%|#########3| 2.72G/2.91G [00:45<00:04, 47.1MB/s]
 94%|#########3| 2.72G/2.91G [00:45<00:04, 40.6MB/s]
 94%|#########3| 2.73G/2.91G [00:45<00:03, 50.0MB/s]
 94%|#########4| 2.74G/2.91G [00:45<00:04, 39.8MB/s]
 95%|#########4| 2.75G/2.91G [00:46<00:03, 47.0MB/s]
 95%|#########4| 2.76G/2.91G [00:46<00:02, 63.9MB/s]
 95%|#########5| 2.77G/2.91G [00:46<00:02, 56.3MB/s]
 96%|#########5| 2.78G/2.91G [00:46<00:02, 59.5MB/s]
 96%|#########6| 2.80G/2.91G [00:46<00:01, 76.3MB/s]
 96%|#########6| 2.80G/2.91G [00:46<00:01, 70.7MB/s]
 97%|#########6| 2.81G/2.91G [00:47<00:01, 71.9MB/s]
 97%|#########6| 2.82G/2.91G [00:47<00:01, 65.9MB/s]
 97%|#########7| 2.83G/2.91G [00:47<00:01, 59.8MB/s]
 97%|#########7| 2.83G/2.91G [00:47<00:01, 54.7MB/s]
 98%|#########7| 2.84G/2.91G [00:47<00:01, 52.1MB/s]
 98%|#########7| 2.84G/2.91G [00:47<00:01, 38.0MB/s]
 98%|#########8| 2.85G/2.91G [00:48<00:01, 49.6MB/s]
 98%|#########8| 2.86G/2.91G [00:48<00:01, 51.0MB/s]
 99%|#########8| 2.87G/2.91G [00:48<00:00, 66.9MB/s]
 99%|#########8| 2.88G/2.91G [00:48<00:00, 53.4MB/s]
 99%|#########9| 2.89G/2.91G [00:48<00:00, 51.5MB/s]
 99%|#########9| 2.89G/2.91G [00:48<00:00, 37.5MB/s]
100%|#########9| 2.91G/2.91G [00:49<00:00, 55.7MB/s]
100%|##########| 2.91G/2.91G [00:49<00:00, 63.4MB/s]
PretrainedFiles(lexicon='/root/.cache/torch/hub/torchaudio/decoder-assets/librispeech-4-gram/lexicon.txt', tokens='/root/.cache/torch/hub/torchaudio/decoder-assets/librispeech-4-gram/tokens.txt', lm='/root/.cache/torch/hub/torchaudio/decoder-assets/librispeech-4-gram/lm.bin')

Construct Decoders

In this tutorial, we construct both a beam search decoder and a greedy decoder for comparison.

Beam Search Decoder

The decoder can be constructed using the factory function ctc_decoder. In addition to the previously mentioned components, it also takes in various beam search decoding parameters and token/word parameters.

This decoder can also be run without a language model by passing in None into the lm parameter.

from torchaudio.prototype.ctc_decoder import ctc_decoder

LM_WEIGHT = 3.23
WORD_SCORE = -0.26

beam_search_decoder = ctc_decoder(
    lexicon=files.lexicon,
    tokens=files.tokens,
    lm=files.lm,
    nbest=3,
    beam_size=1500,
    lm_weight=LM_WEIGHT,
    word_score=WORD_SCORE,
)

Greedy Decoder

class GreedyCTCDecoder(torch.nn.Module):
    def __init__(self, labels, blank=0):
        super().__init__()
        self.labels = labels
        self.blank = blank

    def forward(self, emission: torch.Tensor) -> List[str]:
        """Given a sequence emission over labels, get the best path
        Args:
          emission (Tensor): Logit tensors. Shape `[num_seq, num_label]`.

        Returns:
          List[str]: The resulting transcript
        """
        indices = torch.argmax(emission, dim=-1)  # [num_seq,]
        indices = torch.unique_consecutive(indices, dim=-1)
        indices = [i for i in indices if i != self.blank]
        joined = "".join([self.labels[i] for i in indices])
        return joined.replace("|", " ").strip().split()


greedy_decoder = GreedyCTCDecoder(tokens)

Run Inference

Now that we have the data, acoustic model, and decoder, we can perform inference. The output of the beam search decoder is of type torchaudio.prototype.ctc_decoder.Hypothesis(), consisting of the predicted token IDs, corresponding words, hypothesis score, and timesteps corresponding to the token IDs. Recall the transcript corresponding to the waveform is

i really was very much afraid of showing him how much shocked i was at some parts of what he said
actual_transcript = "i really was very much afraid of showing him how much shocked i was at some parts of what he said"
actual_transcript = actual_transcript.split()

emission, _ = acoustic_model(waveform)

The greedy decoder give the following result.

greedy_result = greedy_decoder(emission[0])
greedy_transcript = " ".join(greedy_result)
greedy_wer = torchaudio.functional.edit_distance(actual_transcript, greedy_result) / len(actual_transcript)

print(f"Transcript: {greedy_transcript}")
print(f"WER: {greedy_wer}")

Out:

Transcript: i reily was very much affrayd of showing him howmuch shoktd i wause at some parte of what he seid
WER: 0.38095238095238093

Using the beam search decoder:

beam_search_result = beam_search_decoder(emission)
beam_search_transcript = " ".join(beam_search_result[0][0].words).strip()
beam_search_wer = torchaudio.functional.edit_distance(actual_transcript, beam_search_result[0][0].words) / len(
    actual_transcript
)

print(f"Transcript: {beam_search_transcript}")
print(f"WER: {beam_search_wer}")

Out:

Transcript: i really was very much afraid of showing him how much shocked i was at some part of what he said
WER: 0.047619047619047616

We see that the transcript with the lexicon-constrained beam search decoder produces a more accurate result consisting of real words, while the greedy decoder can predict incorrectly spelled words like “affrayd” and “shoktd”.

Timestep Alignments

Recall that one of the components of the resulting Hypotheses is timesteps corresponding to the token IDs.

timesteps = beam_search_result[0][0].timesteps
predicted_tokens = beam_search_decoder.idxs_to_tokens(beam_search_result[0][0].tokens)

print(predicted_tokens, len(predicted_tokens))
print(timesteps, timesteps.shape[0])

Out:

['|', 'i', '|', 'r', 'e', 'a', 'l', 'l', 'y', '|', 'w', 'a', 's', '|', 'v', 'e', 'r', 'y', '|', 'm', 'u', 'c', 'h', '|', 'a', 'f', 'r', 'a', 'i', 'd', '|', 'o', 'f', '|', 's', 'h', 'o', 'w', 'i', 'n', 'g', '|', 'h', 'i', 'm', '|', 'h', 'o', 'w', '|', 'm', 'u', 'c', 'h', '|', 's', 'h', 'o', 'c', 'k', 'e', 'd', '|', 'i', '|', 'w', 'a', 's', '|', 'a', 't', '|', 's', 'o', 'm', 'e', '|', 'p', 'a', 'r', 't', '|', 'o', 'f', '|', 'w', 'h', 'a', 't', '|', 'h', 'e', '|', 's', 'a', 'i', 'd', '|', '|'] 99
tensor([  0,  31,  33,  36,  39,  41,  42,  44,  46,  48,  49,  52,  54,  58,
         64,  66,  69,  73,  74,  76,  80,  82,  84,  86,  88,  94,  97, 107,
        111, 112, 116, 134, 136, 138, 140, 142, 146, 148, 151, 153, 155, 157,
        159, 161, 162, 166, 170, 176, 177, 178, 179, 182, 184, 186, 187, 191,
        193, 198, 201, 202, 203, 205, 207, 212, 213, 216, 222, 224, 230, 250,
        251, 254, 256, 261, 262, 264, 267, 270, 276, 277, 281, 284, 288, 289,
        292, 295, 297, 299, 300, 303, 305, 307, 310, 311, 324, 325, 329, 331,
        353], dtype=torch.int32) 99

Below, we visualize the token timestep alignments relative to the original waveform.

def plot_alignments(waveform, emission, tokens, timesteps):
    fig, ax = plt.subplots(figsize=(32, 10))

    ax.plot(waveform)

    ratio = waveform.shape[0] / emission.shape[1]
    word_start = 0

    for i in range(len(tokens)):
        if i != 0 and tokens[i - 1] == "|":
            word_start = timesteps[i]
        if tokens[i] != "|":
            plt.annotate(tokens[i].upper(), (timesteps[i] * ratio, waveform.max() * 1.02), size=14)
        elif i != 0:
            word_end = timesteps[i]
            ax.axvspan(word_start * ratio, word_end * ratio, alpha=0.1, color="red")

    xticks = ax.get_xticks()
    plt.xticks(xticks, xticks / bundle.sample_rate)
    ax.set_xlabel("time (sec)")
    ax.set_xlim(0, waveform.shape[0])


plot_alignments(waveform[0], emission, predicted_tokens, timesteps)
asr inference with ctc decoder tutorial

Beam Search Decoder Parameters

In this section, we go a little bit more in depth about some different parameters and tradeoffs. For the full list of customizable parameters, please refer to the documentation.

Helper Function

def print_decoded(decoder, emission, param, param_value):
    start_time = time.monotonic()
    result = decoder(emission)
    decode_time = time.monotonic() - start_time

    transcript = " ".join(result[0][0].words).lower().strip()
    score = result[0][0].score
    print(f"{param} {param_value:<3}: {transcript} (score: {score:.2f}; {decode_time:.4f} secs)")

nbest

This parameter indicates the number of best Hypothesis to return, which is a property that is not possible with the greedy decoder. For instance, by setting nbest=3 when constructing the beam search decoder earlier, we can now access the hypotheses with the top 3 scores.

for i in range(3):
    transcript = " ".join(beam_search_result[0][i].words).strip()
    score = beam_search_result[0][i].score
    print(f"{transcript} (score: {score})")

Out:

i really was very much afraid of showing him how much shocked i was at some part of what he said (score: 3699.8238231825794)
i really was very much afraid of showing him how much shocked i was at some parts of what he said (score: 3697.8580900895563)
i reply was very much afraid of showing him how much shocked i was at some part of what he said (score: 3695.015467226502)

beam size

The beam_size parameter determines the maximum number of best hypotheses to hold after each decoding step. Using larger beam sizes allows for exploring a larger range of possible hypotheses which can produce hypotheses with higher scores, but it is computationally more expensive and does not provide additional gains beyond a certain point.

In the example below, we see improvement in decoding quality as we increase beam size from 1 to 5 to 50, but notice how using a beam size of 500 provides the same output as beam size 50 while increase the computation time.

beam_sizes = [1, 5, 50, 500]

for beam_size in beam_sizes:
    beam_search_decoder = ctc_decoder(
        lexicon=files.lexicon,
        tokens=files.tokens,
        lm=files.lm,
        beam_size=beam_size,
        lm_weight=LM_WEIGHT,
        word_score=WORD_SCORE,
    )

    print_decoded(beam_search_decoder, emission, "beam size", beam_size)

Out:

beam size 1  : i you ery much afra of shongut shot i was at some arte what he sad (score: 3144.93; 0.3279 secs)
beam size 5  : i rely was very much afraid of showing him how much shot i was at some parts of what he said (score: 3688.02; 0.0580 secs)
beam size 50 : i really was very much afraid of showing him how much shocked i was at some part of what he said (score: 3699.82; 0.2755 secs)
beam size 500: i really was very much afraid of showing him how much shocked i was at some part of what he said (score: 3699.82; 0.8277 secs)

beam size token

The beam_size_token parameter corresponds to the number of tokens to consider for expanding each hypothesis at the decoding step. Exploring a larger number of next possible tokens increases the range of potential hypotheses at the cost of computation.

num_tokens = len(tokens)
beam_size_tokens = [1, 5, 10, num_tokens]

for beam_size_token in beam_size_tokens:
    beam_search_decoder = ctc_decoder(
        lexicon=files.lexicon,
        tokens=files.tokens,
        lm=files.lm,
        beam_size_token=beam_size_token,
        lm_weight=LM_WEIGHT,
        word_score=WORD_SCORE,
    )

    print_decoded(beam_search_decoder, emission, "beam size token", beam_size_token)

Out:

beam size token 1  : i rely was very much affray of showing him hoch shot i was at some part of what he sed (score: 3584.80; 0.3169 secs)
beam size token 5  : i rely was very much afraid of showing him how much shocked i was at some part of what he said (score: 3694.83; 0.2543 secs)
beam size token 10 : i really was very much afraid of showing him how much shocked i was at some part of what he said (score: 3696.25; 0.2974 secs)
beam size token 29 : i really was very much afraid of showing him how much shocked i was at some part of what he said (score: 3699.82; 0.3553 secs)

beam threshold

The beam_threshold parameter is used to prune the stored hypotheses set at each decoding step, removing hypotheses whose scores are greater than beam_threshold away from the highest scoring hypothesis. There is a balance between choosing smaller thresholds to prune more hypotheses and reduce the search space, and choosing a large enough threshold such that plausible hypotheses are not pruned.

beam_thresholds = [1, 5, 10, 25]

for beam_threshold in beam_thresholds:
    beam_search_decoder = ctc_decoder(
        lexicon=files.lexicon,
        tokens=files.tokens,
        lm=files.lm,
        beam_threshold=beam_threshold,
        lm_weight=LM_WEIGHT,
        word_score=WORD_SCORE,
    )

    print_decoded(beam_search_decoder, emission, "beam threshold", beam_threshold)

Out:

beam threshold 1  : i ila ery much afraid of shongut shot i was at some parts of what he said (score: 3316.20; 0.0559 secs)
beam threshold 5  : i rely was very much afraid of showing him how much shot i was at some parts of what he said (score: 3682.23; 0.0959 secs)
beam threshold 10 : i really was very much afraid of showing him how much shocked i was at some part of what he said (score: 3699.82; 0.2800 secs)
beam threshold 25 : i really was very much afraid of showing him how much shocked i was at some part of what he said (score: 3699.82; 0.2659 secs)

language model weight

The lm_weight parameter is the weight to assign to the language model score which to accumulate with the acoustic model score for determining the overall scores. Larger weights encourage the model to predict next words based on the language model, while smaller weights give more weight to the acoustic model score instead.

lm_weights = [0, LM_WEIGHT, 15]

for lm_weight in lm_weights:
    beam_search_decoder = ctc_decoder(
        lexicon=files.lexicon,
        tokens=files.tokens,
        lm=files.lm,
        lm_weight=lm_weight,
        word_score=WORD_SCORE,
    )

    print_decoded(beam_search_decoder, emission, "lm weight", lm_weight)

Out:

lm weight 0  : i rely was very much affraid of showing him ho much shoke i was at some parte of what he seid (score: 3834.05; 0.3334 secs)
lm weight 3.23: i really was very much afraid of showing him how much shocked i was at some part of what he said (score: 3699.82; 0.4214 secs)
lm weight 15 : was there in his was at some of what he said (score: 2918.98; 0.3334 secs)

additional parameters

Additional parameters that can be optimized include the following

  • word_score: score to add when word finishes

  • unk_score: unknown word appearance score to add

  • sil_score: silence appearance score to add

  • log_add: whether to use log add for lexicon Trie smearing

Total running time of the script: ( 3 minutes 2.125 seconds)

Gallery generated by Sphinx-Gallery

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources