Documentation
¶
Overview ¶
Package embed provides deterministic, dependency-free embedding helpers for demos, tests, and reliquary.Quickstart.
The hashing embedder maps text to normalized vectors with the signed feature hashing trick. It is useful for examples and local tests, but it is not a replacement for a production embedding model.
Package embed provides a deterministic, dependency-free embeddings.Embedder for demos, tests, and reliquary.Quickstart. It maps text to vectors with the signed feature-hashing trick, so callers obtain meaningful (non-trivial cosine) vectors without an ONNX runtime or API key.
It is a stand-in for a real embedding model, not a replacement: quality is suitable for examples and tests only, never production retrieval.
Index ¶
Examples ¶
Constants ¶
const DefaultHashingDim = 256
DefaultHashingDim is used when callers pass a non-positive dimension. It is intentionally small and deterministic for demos and tests, not production retrieval quality.
Variables ¶
This section is empty.
Functions ¶
func HashVector ¶
HashVector maps text to an L2-normalized []float32 via signed feature hashing. Non-positive dimensions use DefaultHashingDim.
Types ¶
type Hashing ¶
type Hashing struct {
Model embeddings.ModelRef
}
Hashing is a deterministic hashing-trick embedder implementing embeddings.Embedder.
func NewHashing ¶
NewHashing returns a Hashing embedder producing L2-normalized vectors of the given width. Non-positive dimensions use DefaultHashingDim.