class_docstr: A class for tracking error rates (e.g., WER, PER).
  
  Arguments
  ---------
  merge_tokens : bool
      Whether to merge the successive tokens (used for e.g.,
      creating words out of character tokens).
      See ``speechbrain.dataio.dataio.merge_char``.
  split_tokens : bool
      Whether to split tokens (used for e.g. creating
      characters out of word tokens).
      See ``speechbrain.dataio.dataio.split_word``.
  space_token : str
      The character to use for boundaries. Used with ``merge_tokens``
      this represents character to split on after merge.
      Used with ``split_tokens`` the sequence is joined with
      this token in between, and then the whole sequence is split.
  keep_values : bool
      Whether to keep the values of the concepts or not.
  extract_concepts_values : bool
      Process the predict and target to keep only concepts and values.
  tag_in : str
      Start of the concept ('<' for exemple).
  tag_out : str
      End of the concept ('>' for exemple).
  
  Example
  -------
  >>> cer_stats = ErrorRateStats()
  >>> i2l = {0: 'a', 1: 'b'}
  >>> cer_stats.append(
  ...     ids=['utterance1'],
  ...     predict=torch.tensor([[0, 1, 1]]),
  ...     target=torch.tensor([[0, 1, 0]]),
  ...     target_len=torch.ones(1),
  ...     ind2lab=lambda batch: [[i2l[int(x)] for x in seq] for seq in batch],
  ... )
  >>> stats = cer_stats.summarize()
  >>> stats['WER']
  33.33...
  >>> stats['insertions']
  0
  >>> stats['deletions']
  0
  >>> stats['substitutions']
  1
docstr: Add stats to the relevant containers.
  
  * See MetricStats.append()
  
  Arguments
  ---------
  ids : list
      List of ids corresponding to utterances.
  predict : torch.tensor
      A predicted output, for comparison with the target output
  target : torch.tensor
      The correct reference output, for comparison with the prediction.
  predict_len : torch.tensor
      The predictions relative lengths, used to undo padding if
      there is padding present in the predictions.
  target_len : torch.tensor
      The target outputs' relative lengths, used to undo padding if
      there is padding present in the target.
  ind2lab : callable
      Callable that maps from indices to labels, operating on batches,
      for writing alignments.
docstr_tok: ["Add","stats","to","the","relevant","containers",".","*","See","MetricStats.append","(",")","Arguments","--","--","--","--","-","ids",":","list","List","of","ids","corresponding","to","utterances",".","predict",":","torch.tensor","A","predicted","output",",","for","comparison","with","the","target","output","target",":","torch.tensor","The","correct","reference","output",",","for","comparison","with","the","prediction",".","predict_len",":","torch.tensor","The","predictions","relative","lengths",",","used","to","undo","padding","if","there","is","padding","present","in","the","predictions",".","target_len",":","torch.tensor","The","target","outputs","'","relative","lengths",",","used","to","undo","padding","if","there","is","padding","present","in","the","target",".","ind2lab",":","callable","Callable","that","maps","from","indices","to","labels",",","operating","on","batches",",","for","writing","alignments","."]
code: def append(
      self,
      ids,
      predict,
      target,
      predict_len=None,
      target_len=None,
      ind2lab=None,
  ):
      """Add stats to the relevant containers.
  
      * See MetricStats.append()
  
      Arguments
      ---------
      ids : list
          List of ids corresponding to utterances.
      predict : torch.tensor
          A predicted output, for comparison with the target output
      target : torch.tensor
          The correct reference output, for comparison with the prediction.
      predict_len : torch.tensor
          The predictions relative lengths, used to undo padding if
          there is padding present in the predictions.
      target_len : torch.tensor
          The target outputs' relative lengths, used to undo padding if
          there is padding present in the target.
      ind2lab : callable
          Callable that maps from indices to labels, operating on batches,
          for writing alignments.
      """
      self.ids.extend(ids)
  
      if predict_len is not None:
          predict = undo_padding(predict, predict_len)
  
      if target_len is not None:
          target = undo_padding(target, target_len)
  
      if ind2lab is not None:
          predict = ind2lab(predict)
          target = ind2lab(target)
  
      if self.merge_tokens:
          predict = merge_char(predict, space=self.space_token)
          target = merge_char(target, space=self.space_token)
  
      if self.split_tokens:
          predict = split_word(predict, space=self.space_token)
          target = split_word(target, space=self.space_token)
  
      if self.extract_concepts_values:
          predict = extract_concepts_values(
              predict,
              self.keep_values,
              self.tag_in,
              self.tag_out,
              space=self.space_token,
          )
          target = extract_concepts_values(
              target,
              self.keep_values,
              self.tag_in,
              self.tag_out,
              space=self.space_token,
          )
  
      scores = wer_details_for_batch(ids, target, predict, True)
  
      self.scores.extend(scores)
  
imports: import torch
  from joblib import Parallel, delayed
  from speechbrain.utils.data_utils import undo_padding
  from speechbrain.utils.edit_distance import wer_summary, wer_details_for_batch
  from speechbrain.dataio.dataio import merge_char, split_word, extract_concepts_values
  from speechbrain.dataio.wer import print_wer_summary, print_alignments
label_desc: Use image node_id 2 for calling the ErrorRateStats obj's underlying member method code with example usage: obj.append(ids, predict, target, predict_len, target_len, ind2lab) without return types