CachedTextRepresentation
- class CachedTextRepresentation(identifiers: Sequence[str], cache: TextCache | None = None, **kwargs)[source]
Bases:
TextRepresentation
Textual representations for datasets with identifiers that can be looked up with a
TextCache
.Initialize the representation.
- Parameters:
identifiers (Sequence[str]) – the IDs to be resolved by the class, e.g., wikidata IDs. for
WikidataTextRepresentation
, biomedical entities represented as compact URIs (CURIEs) forBiomedicalCURIERepresentation
cache (TextCache | None) – a pre-instantiated text cache. If None,
cache_cls
is used to instantiate one.kwargs – additional keyword-based parameters passed to
TextRepresentation.__init__()
Methods Summary
from_triples_factory
(triples_factory[, ...])Prepare a text representations with labels from a triples factory.
Methods Documentation
- classmethod from_triples_factory(triples_factory: TriplesFactory, for_entities: bool = True, **kwargs) TextRepresentation [source]
Prepare a text representations with labels from a triples factory.
- Parameters:
triples_factory (TriplesFactory) – The triples factory.
for_entities (bool) – Whether to create the initializer for entities (or relations).
kwargs – Additional keyword-based arguments passed to
pykeen.nn.representation.TextRepresentation
- Returns:
a text representation from the triples factory
- Return type: