Configurable embedding boundary for Spectre classifier artifacts.
Encoder calls are adapter-driven so tests and host applications can inject a fake or hosted embedding provider without changing classifier training or runtime code.
Summary
Functions
Returns the default embedding model used by the lightweight classifier.
Downloads/loads the embedding model and returns its vector dimensions.
Embeds one text value with the loaded model.
Loads the embedding model and returns its vector dimensions.
Types
@type embedding() :: [float()]
Functions
@spec default_model() :: String.t()
Returns the default embedding model used by the lightweight classifier.
@spec download( String.t(), keyword() ) :: {:ok, pos_integer()} | {:error, term()}
Downloads/loads the embedding model and returns its vector dimensions.
{:ok, dimensions} = Spectre.Classifier.Encoder.download()
Embeds one text value with the loaded model.
{:ok, vector} = Spectre.Classifier.Encoder.embed("hello")
@spec load( String.t(), keyword() ) :: {:ok, pos_integer()} | {:error, term()}
Loads the embedding model and returns its vector dimensions.
{:ok, dimensions} = Spectre.Classifier.Encoder.load("intfloat/multilingual-e5-small")