code: def setUp(self):
      text = (
          "five percent (5%) \n "
          + "fifty percent (50%) \n "
          + "two percent (2%) \n "
          + "nine percent (9%) \n "
          + "three percent (3%) \n "
      )
      self.base_groups = [
          {
              "spans": [
                  {"start": 0, "end": 17, "text": "five percent (5%)"},
                  {"start": 61, "end": 78, "text": "nine percent (9%)"},
              ],
              "label": "class1",
          },
          {
              "spans": [
                  {"start": 42, "end": 58, "text": "two percent (2%)"},
              ],
              "label": "class1",
          },
          {
              "spans": [
                  {
                      "start": 81,
                      "end": 99,
                      "text": "three percent (3%)",
                  },
              ],
              "label": "class2",
          },
      ]
      self.incorrect_groups = [
          {
              "spans": [
                  {"start": 0, "end": 17, "text": "five percent (5%)"},
              ],
              "label": "class1",
          },
      ]
      # Overpredict one class
      self.overpredict_groups = self.base_groups + self.incorrect_groups
      # Underpredict one class
      self.underpredict_groups = self.base_groups[1:]
      # Overpredict one class, underpredict the other
      self.under_over_predict_groups = deepcopy(self.overpredict_groups)
      self.under_over_predict_groups[1]["label"] = "class2"
      self.under_over_predict_groups[3]["label"] = "class2"
  
      self.incorrect_label_groups = deepcopy(self.base_groups)
      for group in self.incorrect_label_groups:
          if group["label"] == "class1":
              group["label"] = "class2"
          else:
              group["label"] = "class1"
      self.new_label_groups = deepcopy(self.base_groups)
      for group in self.new_label_groups:
          group["label"] = "class3"
  
      self.correct_expected = {
          "per_class_metrics": {
              "class1": {
                  "precision": 1,
                  "recall": 1,
                  "f1-score": 1,
                  "support": 20,
                  "true_positives": 20,
                  "false_positives": 0,
                  "false_negatives": 0,
              },
              "class2": {
                  "precision": 1,
                  "recall": 1,
                  "f1-score": 1,
                  "support": 10,
                  "true_positives": 10,
                  "false_positives": 0,
                  "false_negatives": 0,
              },
          },
          "avg_f1": {
              "micro": 1,
              "macro": 1,
              "weighted": 1,
          },
      }
  
      self.entities = [
          # 0, Match span exactly, in group
          {"start": 0, "end": 17, "label": "a"},
          # 1, Overlap span
          {"start": 70, "end": 85, "label": "b"},
          # 2, Supserset span
          {"start": 38, "end": 62, "label": "a"},
          # 3, Subset span, in group
          {"start": 44, "end": 54, "label": "b"},
          # 4, Not in span
          {"start": 18, "end": 30, "label": "a"},
      ]
      self.joint_base_groups = deepcopy(self.base_groups)
      self.joint_base_groups[0]["entities"] = [self.entities[0]]
      self.joint_base_groups[1]["entities"] = [self.entities[3]]
      self.joint_base_groups[2]["entities"] = []
  
imports: import unittest
  from copy import deepcopy
  from finetune.util.group_metrics import get_count_fn, calc_group_assignment, create_joint_groups, get_metrics, group_metrics, joint_metrics
label_desc: Use image node_id 1 for calling the TestGroupMetrics obj's underlying member method code with example usage: obj.setUp() without return types