code: def _handle_relation_data(relation_data: List[Dict]) -> Dict:
      """
      处理关系数据，每一个关系有index，head_type,tail_type三个属性
      Args:
          relation_data (List[Dict]) : 所需要处理的关系数据
      Return :
          rels (Dict) : 处理之后的结果
      """
      rels = OrderedDict()
      relation_data = sorted(
          relation_data, key=lambda i: int(i["index"])
      )
      for d in relation_data:
          rels[d["relation"]] = {
              "index": int(d["index"]),
              "head_type": d["head_type"],
              "tail_type": d["tail_type"],
          }
  
      return rels
  
file_path: DeepKE/src/deepke/relation_extraction/standard/tools/preprocess.py
imports: import os
  import logging
  from collections import OrderedDict
  from typing import List, Dict
  from transformers import BertTokenizer
  from .serializer import Serializer
  from .vocab import Vocab
  import sys
  from utils import save_pkl, load_csv
label_desc: Use image node_id 7 for calling a global function with example usage: _handle_relation_data(relation_data) and returns: rels