class_docstr: Computes statistics pertaining to multi-label
  classification tasks, as well as tasks that can be loosely interpreted as such for the purpose of
  evaluations
  
  Example
  -------
  >>> import sys
  >>> from speechbrain.utils.metric_stats import ClassificationStats
  >>> cs = ClassificationStats()
  >>> cs.append(
  ...     ids=["ITEM1", "ITEM2", "ITEM3", "ITEM4"],
  ...     predictions=[
  ...         "M EY K AH",
  ...         "T EY K",
  ...         "B AE D",
  ...         "M EY K",
  ...     ],
  ...     targets=[
  ...         "M EY K",
  ...         "T EY K",
  ...         "B AE D",
  ...         "M EY K",
  ...     ],
  ...     categories=[
  ...         "make",
  ...         "take",
  ...         "bad",
  ...         "make"
  ...     ]
  ... )
  >>> cs.write_stats(sys.stdout)
  Overall Accuracy: 75%
  <BLANKLINE>
  Class-Wise Accuracy
  -------------------
  bad -> B AE D : 1 / 1 (100.00%)
  make -> M EY K: 1 / 2 (50.00%)
  take -> T EY K: 1 / 1 (100.00%)
  <BLANKLINE>
  Confusion
  ---------
  Target: bad -> B AE D
    -> B AE D   : 1 / 1 (100.00%)
  Target: make -> M EY K
    -> M EY K   : 1 / 2 (50.00%)
    -> M EY K AH: 1 / 2 (50.00%)
  Target: take -> T EY K
    -> T EY K   : 1 / 1 (100.00%)
  >>> summary = cs.summarize()
  >>> summary['accuracy']
  0.75
  >>> summary['classwise_stats'][('bad', 'B AE D')]
  {'total': 1.0, 'correct': 1.0, 'accuracy': 1.0}
  >>> summary['classwise_stats'][('make', 'M EY K')]
  {'total': 2.0, 'correct': 1.0, 'accuracy': 0.5}
  >>> summary['keys']
  [('bad', 'B AE D'), ('make', 'M EY K'), ('take', 'T EY K')]
  >>> summary['predictions']
  ['B AE D', 'M EY K', 'M EY K AH', 'T EY K']
  >>> summary['classwise_total']
  {('bad', 'B AE D'): 1.0, ('make', 'M EY K'): 2.0, ('take', 'T EY K'): 1.0}
  >>> summary['classwise_correct']
  {('bad', 'B AE D'): 1.0, ('make', 'M EY K'): 1.0, ('take', 'T EY K'): 1.0}
  >>> summary['classwise_accuracy']
  {('bad', 'B AE D'): 1.0, ('make', 'M EY K'): 0.5, ('take', 'T EY K'): 1.0}
docstr: Summarize the classification metric scores
  
  The following statistics are computed:
  
  accuracy: the overall accuracy (# correct / # total)
  confusion_matrix: a dictionary of type
      {(target, prediction): num_entries} representing
      the confusion matrix
  classwise_stats: computes the total number of samples,
      the number of correct classifications and accuracy
      for each class
  keys: all available class keys, which can be either target classes
      or (category, target) tuples
  predictions: all available predictions all predicions the model
      has made
  
  Arguments
  ---------
  field : str
      If provided, only returns selected statistic. If not,
      returns all computed statistics.
  
  Returns
  -------
  float or dict
      Returns a float if ``field`` is provided, otherwise
      returns a dictionary containing all computed stats.
docstr_tok: ["Summarize","the","classification","metric","scores","The","following","statistics","are","computed",":","accuracy",":","the","overall","accuracy","(","#","correct","\/","#","total",")","confusion_matrix",":","a","dictionary","of","type","{","(","target",",","prediction",")",":","num_entries","}","representing","the","confusion","matrix","classwise_stats",":","computes","the","total","number","of","samples",",","the","number","of","correct","classifications","and","accuracy","for","each","class","keys",":","all","available","class","keys",",","which","can","be","either","target","classes","or","(","category",",","target",")","tuples","predictions",":","all","available","predictions","all","predicions","the","model","has","made","Arguments","--","--","--","--","-","field",":","str","If","provided",",","only","returns","selected","statistic",".","If","not",",","returns","all","computed","statistics",".","Returns","--","--","--","-","float","or","dict","Returns","a","float","if","``","field","``","is","provided",",","otherwise","returns","a","dictionary","containing","all","computed","stats","."]
code: def summarize(self, field=None):
      """Summarize the classification metric scores
  
      The following statistics are computed:
  
      accuracy: the overall accuracy (# correct / # total)
      confusion_matrix: a dictionary of type
          {(target, prediction): num_entries} representing
          the confusion matrix
      classwise_stats: computes the total number of samples,
          the number of correct classifications and accuracy
          for each class
      keys: all available class keys, which can be either target classes
          or (category, target) tuples
      predictions: all available predictions all predicions the model
          has made
  
      Arguments
      ---------
      field : str
          If provided, only returns selected statistic. If not,
          returns all computed statistics.
  
      Returns
      -------
      float or dict
          Returns a float if ``field`` is provided, otherwise
          returns a dictionary containing all computed stats.
      """
  
      self._build_lookups()
      confusion_matrix = self._compute_confusion_matrix()
      self.summary = {
          "accuracy": self._compute_accuracy(),
          "confusion_matrix": confusion_matrix,
          "classwise_stats": self._compute_classwise_stats(
              confusion_matrix
          ),
          "keys": self._available_keys,
          "predictions": self._available_predictions,
      }
      for stat in ["total", "correct", "accuracy"]:
          self.summary[f"classwise_{stat}"] = {
              key: key_stats[stat]
              for key, key_stats in self.summary[
                  "classwise_stats"
              ].items()
          }
      if field is not None:
          return self.summary[field]
      else:
          return self.summary
  
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 3 for calling the ClassificationStats obj's underlying member method code with example usage: obj.summarize(field) and returns: self, self