code: def process(
      src_path,
      tgt_path,
      schema_path,
      language="zh",
      task="RE",
      sample=-1,
      schema_num=-1,
  ):
      if os.path.exists(
          schema_path
      ):  # 加载该数据集的schema, schema_path文件内容参见utils.py FullSampler.read_from_file
          neg_sampler = Sampler.read_from_file(schema_path, negative=-1)
      else:  # 未指定schema_path, 则从数据集中统计得到schema
          raise FileNotFoundError
  
      if task == "EE":
          converter = EEConverter(language, NAN="NAN", prefix="")
      elif task == "RE":
          converter = REConverter(language, NAN="NAN", prefix="")
      elif task == "NER":
          converter = NERConverter(language, NAN="NAN", prefix="")
      elif task == "EET":
          converter = EETConverter(language, NAN="NAN", prefix="")
      elif task == "EEA":
          converter = EEAConverter(language, NAN="NAN", prefix="")
      else:
          raise KeyError
  
      writer = open(tgt_path, "w", encoding="utf-8")
      with open(src_path, "r", encoding="utf-8") as reader:
          for line in reader:
              record = json.loads(line)
              sinstruct = convert_ie(
                  sample,
                  task,
                  schema_num,
                  neg_sampler,
                  converter,
              )
              iid = stable_hash(record["input"])
              for i in range(0, len(sinstruct)):
                  new_record = {
                      "id": iid,
                      "split": i,
                      "instruction": sinstruct[i],
                      "input": record["input"],
                  }
                  writer.write(
                      json.dumps(new_record, ensure_ascii=False) + "\n"
                  )
  
file_path: DeepKE/example/llm/InstructKGC/kg2instruction/convert_test.py
imports: import sys
  import argparse
  import json
  import os
  import random
  from typing import Dict
  from convert.sampler import Sampler
  from convert.converter import NERConverter, REConverter, EEAConverter, EETConverter, EEConverter
  from utils import stable_hash
label_desc: Use image node_id 3 for calling a global function with example usage: process(src_path, tgt_path, schema_path, language, task, sample, schema_num) without return types