LiteralModel

class LiteralModel(triples_factory: TriplesNumericLiteralsFactory, interaction: str | Interaction[Tensor, Tensor, Tensor] | type[Interaction[Tensor, Tensor, Tensor]] | None, entity_representations: str | Representation | type[Representation] | None | Sequence[str | Representation | type[Representation] | None] = None, entity_representations_kwargs: Mapping[str, Any] | None | Sequence[Mapping[str, Any] | None] = None, combination: str | Combination | type[Combination] | None = None, combination_kwargs: Mapping[str, Any] | None = None, **kwargs)[source]

Bases: ERModel[tuple[Tensor, Tensor], Tensor, tuple[Tensor, Tensor]]

Base class for models with entity literals that uses combinations from pykeen.nn.combinations.

Initialize the model.

Parameters:
  • triples_factory (TriplesNumericLiteralsFactory) – the (training) triples factory

  • interaction (Interaction) – the interaction function

  • entity_representations (Sequence[Representation]) – the entity representations (excluding the ones from literals)

  • entity_representations_kwargs (Mapping[str, Any] | None | Sequence[Mapping[str, Any] | None]) – the entity representations keyword-based parameters (excluding the ones from literals)

  • combination (str | Combination | type[Combination] | None) – the combination for entity and literal representations

  • combination_kwargs (Mapping[str, Any] | None) – keyword-based parameters for instantiating the combination

  • kwargs – additional keyword-based parameters passed to ERModel.__init__()