code: def generate_senetence_given_labels(
      positive_label_list, negative_label_list, text
  ):
      label_to_positions = {}
  
      label_list = negative_label_list + positive_label_list
  
      random.shuffle(label_list)
  
      pheso_caption = ""
  
      label_remap_dict = {}
      for index, label in enumerate(label_list):
          start_index = len(pheso_caption)
  
          pheso_caption += clean_name(text[str(label)])
  
          end_index = len(pheso_caption)
  
          if label in positive_label_list:
              label_to_positions[index] = [[start_index, end_index]]
              label_remap_dict[int(label)] = index
  
          # if index != len(label_list) - 1:
          #     pheso_caption += '. '
          pheso_caption += ". "
  
      return label_to_positions, pheso_caption, label_remap_dict
  
file_path: mmdetection/mmdet/datasets/transforms/text_transformers.py
imports: import json
  from mmcv.transforms import BaseTransform
  from mmdet.registry import TRANSFORMS
  from mmdet.structures.bbox import BaseBoxes
  import random
  import re
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: generate_senetence_given_labels(positive_label_list, negative_label_list, text) and returns: label_to_positions,  pheso_caption,  label_remap_dict