Imp.Embeddings behaviour (Imp v0.5.0)

Copy Markdown View Source

Embedding behaviour plus deterministic local bag-of-words embeddings.

Providers must return one numeric vector for each input text, in the same order. Imp validates that shape at this boundary so retrieval code does not silently pair a query or document with the wrong vector.

Summary

Callbacks

embed(list, keyword)

@callback embed([String.t()], keyword()) :: {:ok, [[number()]]} | {:error, term()}

Functions

embed(embedder, texts, opts \\ [])