embeddings.ObjectEmbedding
vector_search.embeddings.ObjectEmbedding()
Abstract class that can be used to create embeddings for Objects of a specific format.
Methods
Name | Description |
---|---|
dimensions | Returns the number of dimensions of the embedding vectors. |
embed | Creates embedding vectors for objects. Returns a numpy array of embedding vectors. |
init_kwargs | Returns a dictionary containing kwargs that can be used to re-initialize the ObjectEmbedding. |
load | Loads the model in order to be ready for embedding objects. |
vector_type | Returns the datatype of the embedding vectors. |
dimensions
vector_search.embeddings.ObjectEmbedding.dimensions()
Returns the number of dimensions of the embedding vectors.
embed
vector_search.embeddings.ObjectEmbedding.embed(objects, metadata)
Creates embedding vectors for objects. Returns a numpy array of embedding vectors. There is no enforced restriction on the object format. ObjectReaders and ObjectEmbeddings should use compatible object and metadata formats.
Parameters
Name | Type | Description | Default |
---|---|---|---|
objects |
OrderedDict | An OrderedDict, containing the object data, having structure similar to TileDB-Py read results. | required |
metadata |
OrderedDict | An OrderedDict, containing the object metadata, having structure similar to TileDB-Py read results. | required |
init_kwargs
vector_search.embeddings.ObjectEmbedding.init_kwargs()
Returns a dictionary containing kwargs that can be used to re-initialize the ObjectEmbedding.
This is used to serialize the ObjectEmbedding and pass it as argument to UDF tasks.
load
vector_search.embeddings.ObjectEmbedding.load()
Loads the model in order to be ready for embedding objects.
This method will be called once per worker to avoid loading the model multiple times.
vector_type
vector_search.embeddings.ObjectEmbedding.vector_type()
Returns the datatype of the embedding vectors.