Fetch Concept Batches

Classes

BatchEmbeddingPipeline

class BatchEmbeddingPipeline(EmbeddingPipeline):
   self.reader = reader
   self.embedder = embedder
   self.store = store

An Embedding Pipeline that reads, embeds, and loads batches of concepts

ParameterTypeDescription
readerConceptReaderA ConceptReader that extracts concept records and can generate batches of Concepts
embedderConceptEmbedderA ConceptEmbedder that can take batches of Concepts and encode them, returning batches of EmbeddedConcepts
storeEmbeddingStoreAn EmbeddingStore that can take batches of Embedded concepts and store them somewhere

Methods

embed_batches
embed_batches() -> Generator[list[EmbeddedConcept]]:

Yields EmbeddedConcepts using the Concept Generator from the reader and passing them through the embedder

Yields list[EmbeddedConcept]

Generator for batches of EmbeddedConcepts

run_pipeline
run_pipeline() -> None:

Run the complete pipeline, loading batches of concepts to the store

AllConceptEmbeddingPipeline

class AllConceptEmbeddingPipeline(EmbeddingPipeline):
    reader: ConceptReader
    embedder: ConceptEmbedder
    store: EmbeddingStore

An Embedding Pipeline that reads, embeds, and loads a complete set of concepts

ParameterTypeDescription
readerConceptReaderA ConceptReader that extracts concept records and returns them as concepts
embedderConceptEmbedderA ConceptEmbedder that can take the list of Concepts and encode them, returning them as EmbeddedConcepts
storeEmbeddingStoreAn EmbeddingStore that can take the set of embedded concepts and store them somewhere

Methods

run_pipeline
run_pipeline() -> None:

Run the complete pipeline, extracting and loading the full set of concepts