word2vec

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "word2vec/v0.1.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(opts ...Option) (*Client, error)

Creates word2vec embeddings client.

It requires configuration of the path to trained model

The client is configurable using

WithModel(path string)
WithVectorSize(size int)

func (*Client) ConsumedTokens

func (c *Client) ConsumedTokens() int

Number of tokens consumed within the session

func (*Client) Embedding

func (c *Client) Embedding(ctx context.Context, text string) ([]float32, error)

Calculates embedding vector

type Option

type Option func(*Client)

func WithModel

func WithModel(path string) Option

func WithVectorSize

func WithVectorSize(size int) Option

Jump to

Keyboard shortcuts

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