code: def count_ops(table):
      """Count the edit operations in the shortest edit path in edit op table.
  
      Walks back an edit operations table produced by table(a, b) and
      counts the number of insertions, deletions, and substitutions in the
      shortest edit path. This information is typically used in speech
      recognition to report the number of different error types separately.
  
      Arguments
      ----------
      table : list
          Edit operations table from ``op_table(a, b)``.
  
      Returns
      -------
      collections.Counter
          The counts of the edit operations, with keys:
  
          * "insertions"
          * "deletions"
          * "substitutions"
  
          NOTE: not all of the keys might appear explicitly in the output,
          but for the missing keys collections. The counter will return 0.
  
      Example
      -------
      >>> table = [['I', 'I', 'I', 'I'],
      ...          ['D', '=', 'I', 'I'],
      ...          ['D', 'D', '=', 'I'],
      ...          ['D', 'D', 'D', 'S']]
      >>> print(count_ops(table))
      Counter({'substitutions': 1})
      """
      edits = collections.Counter()
      # Walk back the table, gather the ops.
      i = len(table) - 1
      j = len(table[0]) - 1
      while not (i == 0 and j == 0):
          if i == 0:
              edits["insertions"] += 1
              j -= 1
          elif j == 0:
              edits["deletions"] += 1
              i -= 1
          else:
              if table[i][j] == EDIT_SYMBOLS["ins"]:
                  edits["insertions"] += 1
                  j -= 1
              elif table[i][j] == EDIT_SYMBOLS["del"]:
                  edits["deletions"] += 1
                  i -= 1
              else:
                  if table[i][j] == EDIT_SYMBOLS["sub"]:
                      edits["substitutions"] += 1
                  i -= 1
                  j -= 1
      return edits
  
file_path: speechbrain/speechbrain/utils/edit_distance.py
imports: import collections
label_desc: Use image node_id 5 for calling a global function with example usage: count_ops(table) and returns: edits