code: def dataio_prep(hparams):
      "Creates the datasets and their data processing pipelines."
  
      label_encoder = sb.dataio.encoder.CTCTextEncoder()
  
      # 1. Define audio pipeline:
      @sb.utils.data_pipeline.takes(hparams["input_type"])
      @sb.utils.data_pipeline.provides("sig")
      def audio_pipeline(wav):
          sig = sb.dataio.dataio.read_audio(wav)
          return sig
  
      # 2. Define text pipeline:
      @sb.utils.data_pipeline.takes("phones")
      @sb.utils.data_pipeline.provides("phn_list", "phn_encoded")
      def text_pipeline(phones):
          phn_list = phones.strip().split()
          yield phn_list
          phn_encoded = label_encoder.encode_sequence_torch(phn_list)
          yield phn_encoded
  
      # 3. Create datasets
      data = {}
      data_info = {
          "train": hparams["train_annotation"],
          "valid": hparams["valid_annotation"],
          "test": hparams["test_annotation"],
      }
      for dataset in data_info:
          data[
              dataset
          ] = sb.dataio.dataset.DynamicItemDataset.from_json(
              json_path=data_info[dataset],
              replacements={"data_root": hparams["data_folder"]},
              dynamic_items=[audio_pipeline, text_pipeline],
              output_keys=["id", "sig", "phn_encoded"],
          )
  
      # Sort train dataset and ensure it doesn't get un-sorted
      if (
          hparams["sorting"] == "ascending"
          or hparams["sorting"] == "descending"
      ):
          data["train"] = data["train"].filtered_sorted(
              sort_key="length",
              reverse=hparams["sorting"] == "descending",
          )
          hparams["dataloader_options"]["shuffle"] = False
      elif hparams["sorting"] != "random":
          raise NotImplementedError(
              "Sorting must be random, ascending, or descending"
          )
  
      # 4. Fit encoder:
      # Load or compute the label encoder (with multi-gpu dpp support)
      lab_enc_file = os.path.join(
          hparams["save_folder"], "label_encoder.txt"
      )
      label_encoder.load_or_create(
          path=lab_enc_file,
          from_didatasets=[data["train"]],
          output_key="phn_list",
          special_labels={"blank_label": hparams["blank_index"]},
          sequence_input=True,
      )
  
      return data, label_encoder
  
file_path: speechbrain/recipes/Voicebank/ASR/CTC/train.py
imports: import os
  import sys
  import torch
  import speechbrain
  from speechbrain.utils.distributed import run_on_main
  from hyperpyyaml import load_hyperpyyaml
label_desc: Use image node_id 1 for calling a global function with example usage: dataio_prep(hparams) and returns: data,  label_encoder, sig