CachedTextRepresentation

class CachedTextRepresentation(identifiers, cache=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) for BiomedicalCURIERepresentation

  • 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, for_entities=True, **kwargs)[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 TextRepresentation.__init__()

Return type:

ForwardRef

Returns:

a text representation from the triples factory