vectorizer

package
v1.24.24 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClassSettings

func NewClassSettings(cfg moduletools.ClassConfig) *classSettings

Types

type ClassSettings

type ClassSettings interface {
	ImageField(property string) bool
	ImageFieldsWeights() ([]float32, error)
	TextField(property string) bool
	TextFieldsWeights() ([]float32, error)
	InferenceURL() string
}

type Client

type Client interface {
	Vectorize(ctx context.Context,
		texts, images []string, config ent.VectorizationConfig) (*ent.VectorizationResult, error)
}

type Vectorizer

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

func New

func New(client Client) *Vectorizer

func (*Vectorizer) Texts

func (v *Vectorizer) Texts(ctx context.Context, inputs []string,
	cfg moduletools.ClassConfig,
) ([]float32, error)

func (*Vectorizer) VectorizeImage

func (v *Vectorizer) VectorizeImage(ctx context.Context, id, image string, cfg moduletools.ClassConfig) ([]float32, error)

Jump to

Keyboard shortcuts

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