CachedTextRepresentation
- class CachedTextRepresentation(identifiers: Sequence[str], cache: TextCache | None = None, **kwargs)[source]
Bases:
TextRepresentationTextual 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) forBiomedicalCURIERepresentationcache (TextCache | None) – a pre-instantiated text cache. If None,
cache_clsis 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
TextRepresentation.__init__()
- Returns:
a text representation from the triples factory
- Return type: