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:

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:

TextRepresentation

Returns:

a text representation from the triples factory