BaseRankingEvaluator

class mowl.evaluation.BaseRankingEvaluator(heads, tails, batch_size, device)[source]

Bases: object

Base class for ranking evaluation of ontology embedding methods.

Methods Summary

compute_ranking_metrics(evaluation_model, ...)

Compute the ranking metrics for the evaluation model on the test data.

get_expanded_scores(evaluation_model, batch, ...)

get_scores(evaluation_model, batch)

update_filtering_labels(data)

Methods Documentation

compute_ranking_metrics(evaluation_model, test_data, filter_data=None, mode='head_centric')[source]

Compute the ranking metrics for the evaluation model on the test data. :param evaluation_model: The evaluation model. :type evaluation_model: torch.nn.Module :param test_data: The test data containing the indices of the embeddings :type test_data: torch.Tensor :param filter_data: The filter data containing the indices of the embeddings :type filter_data: torch.Tensor :param mode: The mode of the evaluation. :type mode: str :return: The computed ranking metrics. :rtype: dict

get_expanded_scores(evaluation_model, batch, mode)[source]
get_scores(evaluation_model, batch)[source]
update_filtering_labels(data)[source]