code: def beam_search_pipeline(char_lens, encoder_out, beam_searcher):
      """Performs a Beam Search on the phonemes. This function is
      meant to be used as a component in a decoding pipeline
  
      Arguments
      ---------
      char_lens: torch.Tensor
          the length of character inputs
      encoder_out: torch.Tensor
          Raw encoder outputs
      beam_searcher: speechbrain.decoders.seq2seq.S2SBeamSearcher
          a SpeechBrain beam searcher instance
  
      Returns
      -------
      hyps: list
          hypotheses
      scores: list
          confidence scores associated with each hypotheses
      """
      return beam_searcher(encoder_out, char_lens)
  
imports: from functools import reduce
  from speechbrain.wordemb.util import expand_to_chars
  import speechbrain
  import torch
  import re
label_desc: Use image node_id 10 for calling a global function with example usage: beam_search_pipeline(char_lens, encoder_out, beam_searcher) and returns: beam_searcher