docstr: Returns
  -------
  A Dict per label containing following the span based metrics:
  precision : float
  recall : float
  f1-measure : float
  Additionally, an ``overall`` key is included, which provides the precision,
  recall and f1-measure for all spans.
docstr_tok: ["Returns","--","--","--","-","A","Dict","per","label","containing","following","the","span","based","metrics",":","precision",":","float","recall",":","float","f1-measure",":","float","Additionally",",","an","``","overall","``","key","is","included",",","which","provides","the","precision",",","recall","and","f1-measure","for","all","spans","."]
code: def get_metric(self, reset: bool = False):
      """
      Returns
      -------
      A Dict per label containing following the span based metrics:
      precision : float
      recall : float
      f1-measure : float
      Additionally, an ``overall`` key is included, which provides the precision,
      recall and f1-measure for all spans.
      """
      all_tags: Set[str] = set()
      all_tags.update(self._true_positives.keys())
      all_tags.update(self._false_positives.keys())
      all_tags.update(self._false_negatives.keys())
      all_metrics = {}
      for tag in all_tags:
          precision, recall, f1_measure = self._compute_metrics(
              self._true_positives[tag],
              self._false_positives[tag],
              self._false_negatives[tag],
          )
          precision_key = "precision" + "-" + tag
          recall_key = "recall" + "-" + tag
          f1_key = "f1-measure" + "-" + tag
          all_metrics[precision_key] = precision
          all_metrics[recall_key] = recall
          all_metrics[f1_key] = f1_measure
  
      # Compute the precision, recall and f1 for all spans jointly.
      sum_true_positives = sum(
          {v for k, v in self._true_positives.items() if k != "untyped"}
      )
      sum_false_positives = sum(
          {
              v
              for k, v in self._false_positives.items()
              if k != "untyped"
          }
      )
      sum_false_negatives = sum(
          {
              v
              for k, v in self._false_negatives.items()
              if k != "untyped"
          }
      )
      precision, recall, f1_measure = self._compute_metrics(
          sum_true_positives, sum_false_positives, sum_false_negatives
      )
      all_metrics["precision-overall"] = precision
      all_metrics["recall-overall"] = recall
      all_metrics["f1-measure-overall"] = f1_measure
      if reset:
          self.reset()
      return all_metrics
  
file_path: scispacy/scispacy/per_class_scorer.py
imports: from typing import Dict, List, Tuple, Set
  from collections import defaultdict
  import copy
label_desc: Use image node_id 3 for calling the PerClassScorer obj's underlying member method code with example usage: obj.get_metric(reset) and returns: all_metrics