# `Sting.Sparse`
[🔗](https://github.com/dkuku/sting/blob/v0.1.0/lib/sting/sparse.ex#L1)

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.

# `repository`

```elixir
@type repository() :: Bumblebee.repository()
```

# `encode`

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.

# `load_model`

```elixir
@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.

# `load_tokenizer`

```elixir
@spec load_tokenizer(repository(), keyword()) :: {:ok, term()} | {:error, String.t()}
```

Loads the tokenizer used by the first sparse pipeline module.

# `semantic_search`

Returns the highest dot-product matches for each sparse query vector.

# `similarity`

Computes sparse-vector dot-product similarities.

# `text_embedding`

Builds a serving that returns unnormalized sparse vocabulary vectors in
`%{embedding: tensor}` result maps.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
