code: def _combine_and_format(subtokens, start, end, raw_text):
      """
      Combine predictions on many subtokens into a single token prediction.
      Currently only valid for GPT.
      """
      result = {"start": start, "end": end}
      result["text"] = raw_text[result["start"] : result["end"]]
      probabilities = {}
      keys = subtokens[0]["probabilities"].keys()
      for k in keys:
          probabilities[k] = np.mean(
              [token["probabilities"][k] for token in subtokens]
          )
      result["probabilities"] = probabilities
      max_response = max(probabilities.items(), key=lambda x: x[1])
      result["label"] = max_response[0]
      result["confidence"] = max_response[1]
      return result
  
imports: import copy
  import os
  from collections import Counter, defaultdict
  import math
  from typing import Dict, List, Tuple, Union
  import tensorflow
  import numpy
  from finetune.base import BaseModel
  from finetune.encoding.target_encoders import SequenceLabelingEncoder, SequenceMultiLabelingEncoder
  from finetune.nn.target_blocks import sequence_labeler
  from finetune.nn.crf import sequence_decode
  from finetune.encoding.sequence_encoder import finetune_to_indico_sequence
  from finetune.encoding.input_encoder import get_spacy
  from finetune.input_pipeline import BasePipeline
  from finetune.util.metrics import sequences_overlap
  from finetune.encoding.input_encoder import tokenize_context
label_desc: Use image node_id 1 for calling a global function with example usage: _combine_and_format(subtokens, start, end, raw_text) and returns: result