code: def decode_preds(preds, raw_texts):
      all_groups = []
      for raw_text, pred in zip(raw_texts, preds):
          if not type(pred) == list:
              all_groups.append([])
              continue
          doc_groups = []
          for json_group in pred:
              if not type(json_group) == list:
                  continue
              # json_group is a lists of spans, represented as strings
              group_spans = []
              for span_text in json_group:
                  if not type(span_text) == str:
                      continue
                  # Can't generate \n's, appear as a single n instead
                  span_text = span_text.replace(" n ", " \n ")
                  span_start = raw_text.find(span_text)
                  span_end = span_start + len(span_text)
                  group_spans.append(
                      {
                          "start": span_start,
                          "end": span_end,
                          "text": span_text,
                      }
                  )
              doc_groups.append({"spans": group_spans, "label": None})
          all_groups.append(doc_groups)
      return all_groups
  
imports: from abc import ABCMeta
  import logging
  import json
  import numpy
  from finetune.encoding.target_encoders import BaseEncoder, Seq2SeqLabelEncoder, SequenceLabelingEncoder
label_desc: Use image node_id 3 for calling the GroupLabelingTextEncoder obj's underlying member method code with example usage: obj.decode_preds(preds, raw_texts) and returns: all_groups