docstr: Computations from input to semantic outputs
docstr_tok: ["Computations","from","input","to","semantic","outputs"]
code: def compute_forward(self, batch, stage):
      """Computations from input to semantic outputs"""
      batch = batch.to(self.device)
      (
          transcript_tokens,
          transcript_tokens_lens,
      ) = batch.transcript_tokens
      (
          semantics_tokens_bos,
          semantics_tokens_bos_lens,
      ) = batch.semantics_tokens_bos
  
      embedded_transcripts = self.hparams.input_emb(transcript_tokens)
      encoder_out = self.hparams.slu_enc(embedded_transcripts)
      e_in = self.hparams.output_emb(semantics_tokens_bos)
      h, _ = self.hparams.dec(e_in, encoder_out, transcript_tokens_lens)
  
      # Output layer for seq2seq log-probabilities
      logits = self.hparams.seq_lin(h)
      p_seq = self.hparams.log_softmax(logits)
  
      # Compute outputs
      p_tokens = None
      if (
          stage == sb.Stage.TRAIN
          and self.step % show_results_every != 0
      ):
          return p_seq, transcript_tokens_lens
      else:
          p_tokens, _, _, _ = self.hparams.beam_searcher(
              encoder_out, transcript_tokens_lens
          )
  
          return p_seq, transcript_tokens_lens, p_tokens
  
file_path: speechbrain/recipes/SLURP/NLU/train.py
imports: import sys
  import torch
  import speechbrain
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.distributed import run_on_main, if_main_process
  import jsonlines
  import ast
  import pandas
label_desc: Use image node_id 1 for calling the SLU obj's underlying member method code with example usage: obj.compute_forward(batch, stage) and returns: p_seq,  transcript_tokens_lens, p_seq,  transcript_tokens_lens,  p_tokens