class_docstr: Calculate CER and WER for E2E_ASR and CTC models during training.
  
  :param y_hats: numpy array with predicted text
  :param y_pads: numpy array with true (target) text
  :param char_list:
  :param sym_space:
  :param sym_blank:
  :return:
docstr: Construct an ErrorCalculator object.
docstr_tok: ["Construct","an","ErrorCalculator","object","."]
code: def __init__(
      self,
      char_list,
      sym_space,
      sym_blank,
      report_cer=False,
      report_wer=False,
  ):
      """Construct an ErrorCalculator object."""
      super(ErrorCalculator, self).__init__()
  
      self.report_cer = report_cer
      self.report_wer = report_wer
  
      self.char_list = char_list
      self.space = sym_space
      self.blank = sym_blank
      # NOTE (Shih-Lun): else case is for OpenAI Whisper ASR model,
      #                  which doesn't use <blank> token
      if self.blank in self.char_list:
          self.idx_blank = self.char_list.index(self.blank)
      else:
          self.idx_blank = None
      if self.space in self.char_list:
          self.idx_space = self.char_list.index(self.space)
      else:
          self.idx_space = None
  
file_path: espnet/espnet/nets/e2e_asr_common.py
imports: import json
  import logging
  import sys
  from itertools import groupby
  import numpy
label_desc: Use image node_id 1 to create a new ErrorCalculator object from inherited base classes: object with example: obj = ErrorCalculator(char_list, sym_space, sym_blank, report_cer, report_wer)