code: def _get_predict_instance(cfg):
      flag = input("是否使用范例[y/n]，退出请输入: exit .... ")
      flag = flag.strip().lower()
      if flag == "y" or flag == "yes":
          sentence = "张冬梅，女，汉族，1968年2月生，河南淇县人，1988年7月加入中国共产党，1989年9月参加工作，中央党校经济管理专业毕业，中央党校研究生学历"
          entity = "张冬梅"
          attribute_value = "汉族"
      elif flag == "n" or flag == "no":
          sentence = input("请输入句子：")
          entity = input("请输入句中需要预测的实体：")
          attribute_value = input("请输入句中需要预测的属性值：")
      elif flag == "exit":
          sys.exit(0)
      else:
          print("please input yes or no, or exit!")
          _get_predict_instance(cfg)
  
      instance = dict()
      instance["sentence"] = sentence.strip()
      instance["entity"] = entity.strip()
      instance["attribute_value"] = attribute_value.strip()
      instance["entity_offset"] = sentence.find(entity)
      instance["attribute_value_offset"] = sentence.find(
          attribute_value
      )
  
      return instance
  
file_path: DeepKE/example/ae/standard/predict.py
imports: import os
  import sys
  import torch
  import logging
  import hydra
  from hydra import utils
  from deepke.attribution_extraction.standard.tools import Serializer
  from deepke.attribution_extraction.standard.tools import _serialize_sentence, _convert_tokens_into_index, _add_pos_seq, _handle_attribute_data, _lm_serialize
  import matplotlib.pyplot
  from deepke.attribution_extraction.standard.utils import load_pkl, load_csv
  import deepke.attribution_extraction.standard.models
label_desc: Use image node_id 2 for calling a global function with example usage: _get_predict_instance(cfg) and returns: instance