embed

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2026 License: GPL-3.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package embed provides an ONNX embedding wrapper using hugot. It is used to generate vector embeddings from text for semantic search.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedder

type Embedder struct {
	// contains filtered or unexported fields
}

Embedder wraps a hugot feature extraction pipeline.

func New

func New(modelPath string) (*Embedder, error)

New creates an Embedder backed by the ONNX model at modelPath. modelPath must be a directory containing model.onnx and tokenizer files.

func (*Embedder) Close

func (e *Embedder) Close()

Close releases all resources associated with the embedder.

func (*Embedder) Embed

func (e *Embedder) Embed(texts []string) ([][]float32, error)

Embed returns one L2-normalised embedding vector per input text. Normalisation is applied by the hugot pipeline so that L2 distance on the stored unit vectors is equivalent to cosine distance, matching the expectation in the page_embeddings schema.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL