code: def main(cfg, model_path):
      dataset = KinshipDataset(
          root_dir="examples/pytorch/kg_completion/data/{}".format(
              cfg["dataset"]
          ),
          topology_subdir="kgc",
      )
      # data = []
      # rows = []
      # columns = []
      num_entities = len(dataset.vocab_model.in_word_vocab)
      num_relations = len(dataset.vocab_model.out_word_vocab)
  
      graph_path = (
          "examples/pytorch/kg_completion/data/{}/processed/kgc/"
          "KG_graph.pt".format(cfg["dataset"])
      )
      KG_graph = torch.load(graph_path)
  
      if cfg["cuda"] is True:
          KG_graph = KG_graph.to("cuda")
      else:
          KG_graph = KG_graph.to("cpu")
  
      model = KGC(cfg, num_entities, num_relations)
  
      model_params = torch.load(model_path)
      model.load_state_dict(model_params)
      model.eval()
  
      model.graph_name = None
      model.vocab_model = dataset.vocab_model
  
      inference_tool = ClassifierInferenceWrapper(
          cfg=cfg,
          model=model,
          dataset=KGCompletionDataset,
          data_item=KGCompletionDataItem,
          lower_case=True,
      )
  
      if cfg["cuda"] is True:
          model.cuda()
  
      # for kinship
      raw_contents = [
          (
              '{"e1": "person84", "e2": "person85", "rel": "term21", '
              '"rel_eval": "term21_reverse", "e2_multi1": "person85",'
              '"e2_multi2": "person84 person55 person74 person57 '
              'person66 person96"}',
              KG_graph,
          )
      ]
      # for wn18rr
      # raw_contents = ['{"e1": "12400489", "e2": "12651821",
      #  "rel": "_hypernym", "rel_eval": "_hypernym_reverse",
      #  "e2_multi1": "12651821", "e2_multi2": "12333053 12300840 12332218
      #  12717644 12774641 12190869 11693981 12766043 12333771 12400924
      #  12644902 12628986 12629666 12745564 12641413 12651611 12333530
      #  12366675 12775717 12707781 11706761 12765846 12327528 12345280
      #  12640607 12648045 12370174 12400720 12400489 12625003 12771192
      #  12399132 12633638 12648196 12744387 12636224 12744850 12761284
      #  12373100 12667406 12638218 12742290 12745386 12743352"}']
      inference_tool.predict(
          raw_contents=raw_contents, batch_size=cfg["test_batch_size"]
      )
  
file_path: graph4nlp/examples/pytorch/kg_completion/inference.py
imports: import argparse
  import os
  import numpy
  import torch
  import torch.backends.cudnn
  from graph4nlp.pytorch.data.dataset import KGCompletionDataItem, KGCompletionDataset
  from graph4nlp.pytorch.datasets.kinship import KinshipDataset
  from graph4nlp.pytorch.inference_wrapper.classifier_inference_wrapper import ClassifierInferenceWrapper
  from graph4nlp.pytorch.modules.utils.config_utils import get_yaml_config
  from main import KGC
label_desc: Use image node_id 2 for calling a global function with example usage: main(cfg, model_path) without return types