code: def _get_so_head(en_pair, tokenizer, text_tokens):
      sub = tokenizer.tokenize(en_pair[0])
      obj = tokenizer.tokenize(en_pair[1])
      sub_head = find_head_idx(source=text_tokens, target=sub)
      if sub == obj:
          obj_head = find_head_idx(
              source=text_tokens[sub_head + len(sub) :], target=obj
          )
          if obj_head != -1:
              obj_head += sub_head + len(sub)
          else:
              obj_head = sub_head
      else:
          obj_head = find_head_idx(source=text_tokens, target=obj)
      return sub_head, obj_head, sub, obj
  
file_path: DeepKE/src/deepke/triple_extraction/PRGC/dataloader_utils.py
imports: import json
  import random
  from multiprocessing import Pool
  import functools
  import numpy
  from collections import defaultdict
  from itertools import chain
  import os
  from .util import Label2IdxSub, Label2IdxObj
label_desc: Use image node_id 3 for calling a global function with example usage: _get_so_head(en_pair, tokenizer, text_tokens) and returns: sub_head,  obj_head,  sub,  obj