code: def _wordwise_tokenize(
      tokenizer, sequence, input_separator, token_separator
  ):
      """Tokenizes a sequence wordwise
  
      Arguments
      ---------
      tokenizer: speechbrain.tokenizers.SentencePiece.SentencePiece
          a tokenizer instance
      sequence: iterable
          the original sequence
      input_separator: str
          the separator used in the input seauence
      token_separator: str
          the token separator used in the output sequence
  
      Returns
      -------
      result: str
          the resulting tensor
      """
  
      if input_separator not in sequence:
          return tokenizer.sp.encode_as_ids(sequence)
      words = list(_split_list(sequence, input_separator))
      encoded_words = [
          tokenizer.sp.encode_as_ids(word_tokens)
          for word_tokens in words
      ]
      sep_list = [token_separator]
      return reduce(
          (lambda left, right: left + sep_list + right), encoded_words
      )
  
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 4 for calling a global function with example usage: _wordwise_tokenize(tokenizer, sequence, input_separator, token_separator) and returns: reduce, tokenizer