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) 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: TriplesFactory, for_entities: bool = True, **kwargs) TextRepresentation[source]

Prepare a text representations with labels from a triples factory.

Parameters:
Returns:

a text representation from the triples factory

Return type:

TextRepresentation