rerankings

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RankedResult

type RankedResult struct {
	Index  int // Index in the original input []string
	String string
	Rank   float32
}

type RerankedChromaResults

type RerankedChromaResults struct {
	chromago.QueryResults
	Ranks map[string][][]float32 // each reranker adds a rank for each result
}

type RerankingFunction

type RerankingFunction interface {
	ID() string
	Rerank(ctx context.Context, query string, results []Result) (map[string][]RankedResult, error)
	RerankResults(ctx context.Context, queryResults *chromago.QueryResults) (*RerankedChromaResults, error)
}

type Result

type Result struct {
	Text   *string
	Object *any
}

func FromObject

func FromObject(object any) Result

func FromObjects

func FromObjects(objects []any) []Result

func FromText

func FromText(text string) Result

func FromTexts

func FromTexts(texts []string) []Result

func (*Result) IsObject

func (r *Result) IsObject() bool

func (*Result) IsText

func (r *Result) IsText() bool

func (*Result) ToText

func (r *Result) ToText() (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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