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: Construct an ErrorCalculatorTransducer.
docstr_tok: ["Construct","an","ErrorCalculatorTransducer","."]
code: def __init__(
      self,
      decoder: AbsDecoder,
      joint_network: torch.nn.Module,
      token_list: List[int],
      sym_space: str,
      sym_blank: str,
      report_cer: bool = False,
      report_wer: bool = False,
  ):
      """Construct an ErrorCalculatorTransducer."""
      super().__init__()
  
      self.beam_search = BeamSearchTransducer(
          decoder=decoder,
          joint_network=joint_network,
          beam_size=2,
          search_type="default",
          score_norm=False,
      )
  
      self.decoder = decoder
  
      self.token_list = token_list
      self.space = sym_space
      self.blank = sym_blank
  
      self.report_cer = report_cer
      self.report_wer = report_wer
  
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 1 to create a new ErrorCalculatorTransducer object from inherited base classes: object with example: obj = ErrorCalculatorTransducer(decoder, joint_network, token_list, sym_space, sym_blank, report_cer, report_wer)