class_docstr: Model for end-to-end speech intent classification and slot filling, which is formulated as a speech-to-sequence task
class_docstr_tok: ["Model","for","end-to-end","speech","intent","classification","and","slot","filling",",","which","is","formulated","as","a","speech-to-sequence","task"]
docstr: Forward pass of the model.
  
  Params:
      input_signal: Tensor that represents a batch of raw audio signals, of shape [B, T]. T here represents
      timesteps, with 1 second of audio represented as `self.sample_rate` number of floating point values.
  
      input_signal_length: Vector of length B, that contains the individual lengths of the audio sequences.
  
      target_semantics: Tensor that represents a batch of semantic tokens, of shape [B, L].
  
      target_semantics_length: Vector of length B, that contains the individual lengths of the semantic sequences.
  
      processed_signal: Tensor that represents a batch of processed audio signals, of shape (B, D, T) that has
      undergone processing via some DALI preprocessor.
  
      processed_signal_length: Vector of length B, that contains the individual lengths of the processed audio
      sequences.
  
  Returns:
      A tuple of 3 elements -
      1) The log probabilities tensor of shape [B, T, D].
      2) The lengths of the output sequence after decoder, of shape [B].
      3) The token predictions of the model of shape [B, T].
docstr_tok: ["Forward","pass","of","the","model",".","Params",":","input_signal",":","Tensor","that","represents","a","batch","of","raw","audio","signals",",","of","shape","[","B",",","T","]",".","T","here","represents","timesteps",",","with","1","second","of","audio","represented","as","`","self.sample_rate","`","number","of","floating","point","values",".","input_signal_length",":","Vector","of","length","B",",","that","contains","the","individual","lengths","of","the","audio","sequences",".","target_semantics",":","Tensor","that","represents","a","batch","of","semantic","tokens",",","of","shape","[","B",",","L","]",".","target_semantics_length",":","Vector","of","length","B",",","that","contains","the","individual","lengths","of","the","semantic","sequences",".","processed_signal",":","Tensor","that","represents","a","batch","of","processed","audio","signals",",","of","shape","(","B",",","D",",","T",")","that","has","undergone","processing","via","some","DALI","preprocessor",".","processed_signal_length",":","Vector","of","length","B",",","that","contains","the","individual","lengths","of","the","processed","audio","sequences",".","Returns",":","A","tuple","of","3","elements","-","1",")","The","log","probabilities","tensor","of","shape","[","B",",","T",",","D","]",".","2",")","The","lengths","of","the","output","sequence","after","decoder",",","of","shape","[","B","]",".","3",")","The","token","predictions","of","the","model","of","shape","[","B",",","T","]","."]
code: def forward(
      self,
      input_signal=None,
      input_signal_length=None,
      target_semantics=None,
      target_semantics_length=None,
      processed_signal=None,
      processed_signal_length=None,
  ):
      """
      Forward pass of the model.
  
      Params:
          input_signal: Tensor that represents a batch of raw audio signals, of shape [B, T]. T here represents
          timesteps, with 1 second of audio represented as `self.sample_rate` number of floating point values.
  
          input_signal_length: Vector of length B, that contains the individual lengths of the audio sequences.
  
          target_semantics: Tensor that represents a batch of semantic tokens, of shape [B, L].
  
          target_semantics_length: Vector of length B, that contains the individual lengths of the semantic sequences.
  
          processed_signal: Tensor that represents a batch of processed audio signals, of shape (B, D, T) that has
          undergone processing via some DALI preprocessor.
  
          processed_signal_length: Vector of length B, that contains the individual lengths of the processed audio
          sequences.
  
      Returns:
          A tuple of 3 elements -
          1) The log probabilities tensor of shape [B, T, D].
          2) The lengths of the output sequence after decoder, of shape [B].
          3) The token predictions of the model of shape [B, T].
      """
      has_input_signal = (
          input_signal is not None and input_signal_length is not None
      )
      has_processed_signal = (
          processed_signal is not None
          and processed_signal_length is not None
      )
      if (has_input_signal ^ has_processed_signal) == False:
          raise ValueError(
              f"{self} Arguments ``input_signal`` and ``input_signal_length`` are mutually exclusive "
              " with ``processed_signal`` and ``processed_signal_len`` arguments."
          )
  
      if not has_processed_signal:
          processed_signal, processed_signal_length = self.preprocessor(
              input_signal=input_signal,
              length=input_signal_length,
          )
  
      if self.spec_augmentation is not None and self.training:
          processed_signal = self.spec_augmentation(
              input_spec=processed_signal,
              length=processed_signal_length,
          )
  
      encoded, encoded_len = self.encoder(
          audio_signal=processed_signal, length=processed_signal_length
      )
      encoded = encoded.transpose(1, 2)  # BxDxT -> BxTxD
      encoded_mask = get_seq_mask(encoded, encoded_len)
  
      if target_semantics is None:  # in inference-only mode
          predictions = self.sequence_generator(encoded, encoded_mask)
          return None, None, predictions
  
      bos_semantics_tokens = target_semantics[:, :-1]
      bos_semantics = self.embedding(bos_semantics_tokens)
      bos_semantics_mask = get_seq_mask(
          bos_semantics, target_semantics_length - 1
      )
  
      decoded = self.decoder(
          encoder_states=encoded,
          encoder_mask=encoded_mask,
          decoder_states=bos_semantics,
          decoder_mask=bos_semantics_mask,
      )
      log_probs = self.classifier(decoded)
  
      predictions = log_probs.argmax(dim=-1, keepdim=False)
  
      pred_len = self.sequence_generator.get_seq_length(predictions)
      return log_probs, pred_len, predictions
  
imports: import json
  import os
  import tempfile
  from math import ceil
  from typing import Dict, List, Optional, Union
  import torch
  from omegaconf import DictConfig, OmegaConf, open_dict
  from tqdm.auto import tqdm
  from nemo.collections.asr.data import audio_to_text_dataset
  from nemo.collections.asr.data.audio_to_text_dali import DALIOutputs
  from nemo.collections.asr.metrics.wer import WER
  from nemo.collections.asr.models.asr_model import ASRModel, ExportableEncDecModel
  from nemo.collections.asr.parts.mixins import ASRBPEMixin, ASRModuleMixin
  from nemo.collections.asr.parts.preprocessing.perturb import process_augmentations
  from nemo.collections.asr.parts.submodules.ctc_decoding import CTCBPEDecoding, CTCBPEDecodingConfig
  from nemo.collections.asr.parts.utils.slu_utils import SequenceGenerator, SequenceGeneratorConfig, get_seq_mask
  from nemo.collections.common.losses import SmoothedNLLLoss
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.neural_types import AudioSignal, LabelsType, LengthsType, LogprobsType, NeuralType, SpectrogramType
  from nemo.utils import logging, model_utils
label_desc: Use image node_id 5 for calling the SLUIntentSlotBPEModel obj's underlying member method code with example usage: obj.forward(input_signal, input_signal_length, target_semantics, target_semantics_length, processed_signal, processed_signal_length) and returns: log_probs,  pred_len,  predictions, None,  None,  predictions