HazyResearch/KGEmb

How to do inferencing?

Risho92 opened this issue · 2 comments

I am new to knowledge graph. I trained and tested ATTE model and the results look promising. Is it possible to provide the instructions to use this for inferencing?

The test.py script has an example for how to do inferencing. The different steps are:

  1. Load the data in a KGDataset object (see datasets/kg_dataset.py)
  2. Create the KG model (see models/)
  3. Given a query (head, relation, ?) or (?, relation, tail), predict the rank of the missing entity and compute the evaluation metrics. The function compute_metrics does both prediction and evaluation at the same time:
    def compute_metrics(self, examples, filters, batch_size=500):

Thank you