code: def decode_preds(preds, raw_texts):
      all_labels = []
      for raw_text, pred in zip(raw_texts, preds):
          if not type(pred) == list:
              all_labels.append([])
              continue
          doc_labels = []
          for json_label in pred:
              # json_label is a list of dictionaries of the form {key: text}
              if not type(json_label) == dict:
                  continue
              tag, text = list(json_label.items())[0]
              # Can't generate \n's, appear as a single n instead
              text = text.replace(" n ", " \n ")
              label_start = raw_text.find(text)
              label_end = label_start + len(text)
              doc_labels.append(
                  {
                      "label": tag,
                      "start": label_start,
                      "end": label_end,
                      "text": text,
                  }
              )
          all_labels.append(doc_labels)
      return all_labels
  
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 SequenceLabelingTextEncoder obj's underlying member method code with example usage: obj.decode_preds(preds, raw_texts) and returns: all_labels