pyrdf2vec.embedders.embedder module

class pyrdf2vec.embedders.embedder.Embedder

Bases: object

Base class of the embedding techniques.

abstract fit(corpus, is_update=False)

Fits a model based on the provided corpus.

Parameters

corpus (List[List[Tuple[str, ...]]]) – The corpus to fit the model.

Return type

Embedder

Returns

The fitted model according to an embedding technique.

Raises

NotImplementedError – If this method is called, without having provided an implementation.

abstract transform(entities)

Constructs a features vector of the provided entities.

Parameters

entities (List[str]) – The entities including test entities to create the embeddings. Since RDF2Vec is unsupervised, there is no label leakage.

Return type

List[str]

Returns

The features vector of the provided entities.

Raises

NotImplementedError – If this method is called, without having provided an implementation.