embedding

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package embedding provides text embedding capabilities using ONNX models via hugot.

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 provides text embedding capabilities using hugot's pure Go ONNX backend.

func New

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

New creates a new Embedder with the given ONNX model directory path.

func (*Embedder) Close

func (e *Embedder) Close() error

Close releases resources held by the embedder.

func (*Embedder) Embed

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

Embed returns the L2-normalized embedding vector for a single text string.

func (*Embedder) EmbedBatch added in v0.2.0

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

EmbedBatch returns L2-normalized embedding vectors for multiple texts.

Jump to

Keyboard shortcuts

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