class_docstr: Calculate CER and WER for transducer models.
  
  Args:
      decoder: Decoder module.
      token_list: List of tokens.
      sym_space: Space symbol.
      sym_blank: Blank symbol.
      report_cer: Whether to compute CER.
      report_wer: Whether to compute WER.
class_docstr_tok: ["Calculate","CER","and","WER","for","transducer","models",".","Args",":","decoder",":","Decoder","module",".","token_list",":","List","of","tokens",".","sym_space",":","Space","symbol",".","sym_blank",":","Blank","symbol",".","report_cer",":","Whether","to","compute","CER",".","report_wer",":","Whether","to","compute","WER","."]
docstr: Convert label ID sequences to character sequences.
  
  Args:
      pred: Prediction label ID sequences. (B, U)
      target: Target label ID sequences. (B, L)
  
  Returns:
      char_pred: Prediction character sequences. (B, ?)
      char_target: Target character sequences. (B, ?)
docstr_tok: ["Convert","label","ID","sequences","to","character","sequences",".","Args",":","pred",":","Prediction","label","ID","sequences",".","(","B",",","U",")","target",":","Target","label","ID","sequences",".","(","B",",","L",")","Returns",":","char_pred",":","Prediction","character","sequences",".","(","B",",","?",")","char_target",":","Target","character","sequences",".","(","B",",","?",")"]
code: def convert_to_char(
      self, pred: torch.Tensor, target: torch.Tensor
  ) -> Tuple[List, List]:
      """Convert label ID sequences to character sequences.
  
      Args:
          pred: Prediction label ID sequences. (B, U)
          target: Target label ID sequences. (B, L)
  
      Returns:
          char_pred: Prediction character sequences. (B, ?)
          char_target: Target character sequences. (B, ?)
  
      """
      char_pred, char_target = [], []
  
      for i, pred_i in enumerate(pred):
          char_pred_i = [self.token_list[int(h)] for h in pred_i]
          char_target_i = [self.token_list[int(r)] for r in target[i]]
  
          char_pred_i = "".join(char_pred_i).replace(self.space, " ")
          char_pred_i = char_pred_i.replace(self.blank, "")
  
          char_target_i = "".join(char_target_i).replace(
              self.space, " "
          )
          char_target_i = char_target_i.replace(self.blank, "")
  
          char_pred.append(char_pred_i)
          char_target.append(char_target_i)
  
      return char_pred, char_target
  
file_path: espnet/espnet2/asr/transducer/error_calculator.py
imports: from typing import List, Tuple
  import torch
  from espnet2.asr.decoder.abs_decoder import AbsDecoder
  from espnet2.asr.transducer.beam_search_transducer import BeamSearchTransducer
label_desc: Use image node_id 3 for calling the ErrorCalculatorTransducer obj's underlying member method code with example usage: obj.convert_to_char(pred, target) and returns: char_pred,  char_target