Embedder

Classes

BatchEmbedder

class BatchEmbedder(ConceptEmbedder):
   embedding_model: SentenceTransformer,
   template: Template,

A ConceptEmbedder that can take a template and an embeddings model to produce concepts and their embeddings.

ParameterTypeDescription
embedding_modelSentenceTransformerThe SentenceTransformer used to produce embeddings
templateTemplateA jinja2 template to render strings for the embedding model to encode
PropertyDescription
dimensionThe embedding dimension of the attached model

Methods

embed_concepts
def embed_concepts(self, concepts: list[Concept]) -> list[EmbeddedConcept]:

Render the strings, encode the strings

ParameterTypeDescription
conceptslist[Concept]A list of concepts to encode
Returns list[EmbeddedConcepts]

A list of encoded concepts