Loading and model construction for SentenceTransformers sparse encoders.
The supported pipeline is an MLM transformer followed by SpladePooling, or
a SparseStaticEmbedding lookup table. SPLADE applies log1p(relu(logits))
token-wise and then pools each vocabulary dimension with :max or :sum.
Sparse vectors remain unnormalized vocabulary-space tensors; use dot-product
similarity for retrieval.
Summary
Functions
Encodes one text or a list of texts with a sparse embedding serving. Returns
one %{embedding: rank_1_tensor} map or a list of maps.
Loads an MLMTransformer or SparseStaticEmbedding sparse pipeline. These are the supported sparse base modules; other saved module types return an error.
Loads the tokenizer used by the first sparse pipeline module.
Returns the highest dot-product matches for each sparse query vector.
Computes sparse-vector dot-product similarities.
Builds a serving that returns unnormalized sparse vocabulary vectors in
%{embedding: tensor} result maps.
Types
@type repository() :: Bumblebee.repository()
Functions
Encodes one text or a list of texts with a sparse embedding serving. Returns
one %{embedding: rank_1_tensor} map or a list of maps.
@spec load_model(repository(), keyword()) :: {:ok, map()} | {:error, String.t()}
Loads an MLMTransformer or SparseStaticEmbedding sparse pipeline. These are the supported sparse base modules; other saved module types return an error.
@spec load_tokenizer(repository(), keyword()) :: {:ok, term()} | {:error, String.t()}
Loads the tokenizer used by the first sparse pipeline module.
Returns the highest dot-product matches for each sparse query vector.
Computes sparse-vector dot-product similarities.
Builds a serving that returns unnormalized sparse vocabulary vectors in
%{embedding: tensor} result maps.