code: def _wordwise_detokenize(
      tokenizer, sequence, output_separtor, token_separator
  ):
      """Detokenizes a sequence wordwise
  
      Arguments
      ---------
      tokenizer: speechbrain.tokenizers.SentencePiece.SentencePiece
          a tokenizer instance
      sequence: iterable
          the original sequence
      output_separator: str
          the separator used in the output seauence
      token_separator: str
          the token separator used in the output sequence
  
      Returns
      -------
      result: torch.Tensor
          the result
  
      """
      if isinstance(sequence, str) and sequence == "":
          return ""
      if token_separator not in sequence:
          sequence_list = (
              sequence
              if isinstance(sequence, list)
              else sequence.tolist()
          )
          return tokenizer.sp.decode_ids(sequence_list)
      words = list(_split_list(sequence, token_separator))
      encoded_words = [
          tokenizer.sp.decode_ids(word_tokens) for word_tokens in words
      ]
      return output_separtor.join(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 5 for calling a global function with example usage: _wordwise_detokenize(tokenizer, sequence, output_separtor, token_separator) and returns: output_separtor, str, tokenizer