EmbeddingsRankBasedEvaluator
- class mowl.evaluation.EmbeddingsRankBasedEvaluator(class_embeddings, testing_set, eval_method_class, score_func=None, training_set=None, relation_embeddings=None, head_entities=None, tail_entities=None, device='cpu')[source]
Bases:
RankBasedEvaluator
This class corresponds to evaluation based on raking where the embedding information are just vectors and are not part of a model.
- Parameters:
class_embeddings (dict(str, numpy.ndarray)) – The embeddings of the classes.
testing_set (list(mowl.projection.edge.Edge)) – Set of triples that are true positives.
eval_method_class (
mowl.evaluation.base.EvaluationMethod
) – Class that contains placeholders for class and relation embeddings.score_func – The function used to compute the score. Defaults to None. This function will be inserted into the
eval_method_class
.training_set (list(mowl.projection.edge.Edge)) – Set of triples that are true positives but exist in the training set. This is used to compute filtered metrics.
relation_embeddings (dict(str, numpy.ndarray), optional) – The embeddings of the relations. Defaults to None.
head_entities (list(str)) – List of entities that are used as head entities in the testing set.
tail_entities (list(str)) – List of entities that are used as tail entities in the testing set.
device (str) – Use cpu or cuda