DataLoader
- class openbiolink.evaluation.dataLoader.DataLoader(root='dataset', name='HQ_DIR', entity_to_id_path=None, relation_to_id_path=None)[source]
- Parameters
root (
str
) – Pathlike string to directory in which dataset files should be stored
- filter_scores(batch, scores, filter_col, filter_val=nan)[source]
Filters true positive .
- Parameters
batch – Batch of triples. Shape (batch_size,3)
scores – Batch of triples. Shape (batch_size,num_entities)
filter_col – Batch of triples. Shape (batch_size,num_entities)
filter_val – Batch of triples. Shape (batch_size,num_entities), default NaN
- Returns
filtered_scores: torch.tensor where the value at [i,j] is the score of the triple (j, batch[i][1], batch[i][2]). Shape (batch_size, num_entities)