pyseekdb.utils.embedding_functions.Text2VecEmbeddingFunction
- class pyseekdb.utils.embedding_functions.Text2VecEmbeddingFunction(model_name: str = 'shibing624/text2vec-base-chinese', device: str = 'cpu', normalize_embeddings: bool = False, **kwargs: Any)[source]
Bases:
EmbeddingFunction[str|list[str]]An embedding function using text2vec with a specific model.
Text2Vec provides multilingual embeddings (supports 100+ languages) with various pretrained models.
- __init__(model_name: str = 'shibing624/text2vec-base-chinese', device: str = 'cpu', normalize_embeddings: bool = False, **kwargs: Any)[source]
Initialize Text2VecEmbeddingFunction.
Methods
__init__([model_name, device, ...])Initialize Text2VecEmbeddingFunction.
build_from_config(config)Build Text2VecEmbeddingFunction from configuration dictionary.
Get configuration dictionary for serialization.
name()Return the embedding function name identifier.
support_persistence(embedding_function)Check if the embedding function supports persistence.
Attributes
Get the dimension of embeddings produced by this function.
models- static build_from_config(config: dict[str, Any]) Text2VecEmbeddingFunction[source]
Build Text2VecEmbeddingFunction from configuration dictionary.
- property dimension: int
Get the dimension of embeddings produced by this function.