BaseSparseEmbedding#
- class langchain_milvus.utils.sparse.BaseSparseEmbedding[source]#
Interface for Sparse embedding models.
You can inherit from it and implement your custom sparse embedding model.
By default, the asynchronous methods are implemented using the synchronous methods; however, implementations may choose to override the asynchronous methods with an async native implementation for performance reasons.
Methods
aembed_documents
(texts)Asynchronous Embed search docs.
aembed_query
(query)Asynchronous Embed query text.
embed_documents
(texts)Embed search docs.
embed_query
(query)Embed query text.
- async aembed_documents(
- texts: list[str],
Asynchronous Embed search docs.
- Parameters:
texts (list[str]) – List of text to embed.
- Returns:
List of embeddings.
- Return type:
List[Dict[int, float]]
- async aembed_query(
- query: str,
Asynchronous Embed query text.
- Parameters:
query (str) – Text to embed.
- Returns:
Embedding.
- Return type:
Dict[int, float]