GraphPlusPyKEENModel
- class mowl.models.GraphPlusPyKEENModel(*args, device='cpu', **kwargs)[source]
Bases:
KGEModel
This is a wrapper class of
pykeen.models.ERModel
that allows to use the PyKEEN models in the mOWL framework.Added in version 0.2.0.
Attributes Summary
Returns a dictionary with class names as keys and class embeddings as values.
Returns the evaluation model.
Returns a dictionary with individual names as keys and individual embeddings as values.
Returns a dictionary with object property names as keys and object property embeddings as values.
The triples factory of the model.
Methods Summary
add_axioms
(*axioms)This method adds axioms to the dataset contained in the model and reorders the embedding information for each entity accordingly.
from_pretrained
(model)This method loads a pretrained model from a file.
set_kge_method
(kge_method, *args, **kwargs)Set the KGE method of the model.
train
([epochs])Triggers the PyKEEN training process.
Attributes Documentation
- class_embeddings
- evaluation_model
- individual_embeddings
- object_property_embeddings
- triples_factory
The triples factory of the model.
- Return type:
Methods Documentation
- add_axioms(*axioms)[source]
This method adds axioms to the dataset contained in the model and reorders the embedding information for each entity accordingly. New entites are initalized with random embedding.
- Parameters:
axioms (org.semanticweb.owlapi.model.OWLAxiom) – Axioms to be added to the dataset.
Added in version 0.2.0.
- from_pretrained(model)[source]
This method loads a pretrained model from a file.
- Parameters:
file_name (str) – Path to the pretrained model file.
Added in version 0.2.0.
- set_kge_method(kge_method, *args, **kwargs)[source]
Set the KGE method of the model.
- Parameters:
kge_method (
pykeen.models.ERModel
) – The KGE method.