class_docstr: CER and WER computation for Transducer model.
  
  Args:
      decoder: Decoder module.
      joint_network: Joint network module.
      token_list: Set of unique labels.
      sym_space: Space symbol.
      sym_blank: Blank symbol.
      report_cer: Whether to compute CER.
      report_wer: Whether to compute WER.
class_docstr_tok: ["CER","and","WER","computation","for","Transducer","model",".","Args",":","decoder",":","Decoder","module",".","joint_network",":","Joint","network","module",".","token_list",":","Set","of","unique","labels",".","sym_space",":","Space","symbol",".","sym_blank",":","Blank","symbol",".","report_cer",":","Whether","to","compute","CER",".","report_wer",":","Whether","to","compute","WER","."]
docstr: Construct an ErrorCalculator object for Transducer model.
docstr_tok: ["Construct","an","ErrorCalculator","object","for","Transducer","model","."]
code: def __init__(
      self,
      decoder: Union[RNNDecoder, CustomDecoder],
      joint_network: JointNetwork,
      token_list: List[int],
      sym_space: str,
      sym_blank: str,
      report_cer: bool = False,
      report_wer: bool = False,
  ):
      """Construct an ErrorCalculator object for Transducer model."""
      super().__init__()
  
      self.beam_search = BeamSearchTransducer(
          decoder=decoder,
          joint_network=joint_network,
          beam_size=2,
          search_type="default",
      )
  
      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/espnet/nets/pytorch_backend/transducer/error_calculator.py
imports: from typing import List, Tuple, Union
  import torch
  from espnet.nets.beam_search_transducer import BeamSearchTransducer
  from espnet.nets.pytorch_backend.transducer.custom_decoder import CustomDecoder
  from espnet.nets.pytorch_backend.transducer.joint_network import JointNetwork
  from espnet.nets.pytorch_backend.transducer.rnn_decoder import RNNDecoder
label_desc: Use image node_id 1 to create a new ErrorCalculator object from inherited base classes: object with example: obj = ErrorCalculator(decoder, joint_network, token_list, sym_space, sym_blank, report_cer, report_wer)