search

package
v0.0.0-...-16eb04b Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Neighbor

type Neighbor struct {
	Word       string
	Rank       uint
	Similarity float64
}

Neighbor stores the word with cosine similarity value on the target.

type Neighbors

type Neighbors []Neighbor

func (Neighbors) Describe

func (neighbors Neighbors) Describe()

type Searcher

type Searcher struct {
	Items embedding.Embeddings
}

func New

func New(embs ...embedding.Embedding) (*Searcher, error)

func (*Searcher) Search

func (s *Searcher) Search(query embedding.Embedding, k int, ignoreWord ...string) (Neighbors, error)

func (*Searcher) SearchInternal

func (s *Searcher) SearchInternal(word string, k int) (Neighbors, error)

func (*Searcher) SearchVector

func (s *Searcher) SearchVector(query []float64, k int) (Neighbors, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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