link_predict¶
- pybind11_ke.config.link_predict(batch: dict[str, Union[dgl.DGLGraph, torch.Tensor]], model: Model, prediction: str = 'all') tuple[torch.Tensor, ...][源代码]¶
进行链接预测。
- 参数:
batch (dict[str, Union[dgl.DGLGraph, torch.Tensor]]) – 测试数据
model (pybind11_ke.module.model.Model) – KGE 模型
prediction (str) – ‘all’, ‘head’, ‘tail’
- 返回:
正确三元组的排名
- 返回类型:
tuple[torch.Tensor, …]