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: Calculate sentence-level CER score.
  
  :param list seqs_hat: prediction
  :param list seqs_true: reference
  :return: average sentence-level CER score
  :rtype float
docstr_tok: ["Calculate","sentence-level","CER","score",".",":","param","list","seqs_hat",":","prediction",":","param","list","seqs_true",":","reference",":","return",":","average","sentence-level","CER","score",":","rtype","float"]
code: def calculate_cer(self, seqs_hat, seqs_true):
      """Calculate sentence-level CER score.
  
      :param list seqs_hat: prediction
      :param list seqs_true: reference
      :return: average sentence-level CER score
      :rtype float
      """
      import editdistance
  
      char_eds, char_ref_lens = [], []
      for i, seq_hat_text in enumerate(seqs_hat):
          seq_true_text = seqs_true[i]
          hyp_chars = seq_hat_text.replace(" ", "")
          ref_chars = seq_true_text.replace(" ", "")
          char_eds.append(editdistance.eval(hyp_chars, ref_chars))
          char_ref_lens.append(len(ref_chars))
      return float(sum(char_eds)) / sum(char_ref_lens)
  
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 5 for calling the ErrorCalculator obj's underlying member method code with example usage: obj.calculate_cer(seqs_hat, seqs_true) and returns: unknown