vectordb

package module
v0.0.0-...-83ee790 Latest Latest
Warning

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

Go to latest
Published: May 27, 2023 License: MIT Imports: 4 Imported by: 1

README

semantic-search-go

Text similarity search for Go

2x faster than sentence-transformers on 500×10000

Installation

go get github.com/acheong08/vectordb

Example usage

Semantic search

Client

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SemanticSearch

func SemanticSearch(query []string, corpus []string, results int, sorted bool) ([][]typings.SearchResult, error)

Types

type Client

type Client struct {
	DB *database.Database
}

func NewClient

func NewClient(filePath string) (*Client, error)

func (*Client) Add

func (c *Client) Add(text string) error

func (*Client) Query

func (c *Client) Query(queries []string, topK int, sorted bool) ([][]typings.SearchResult, error)

func (*Client) RemoveByIndex

func (c *Client) RemoveByIndex(i int) error

func (*Client) RemoveByText

func (c *Client) RemoveByText(text string) error

func (*Client) Save

func (c *Client) Save() error

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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