Documentation
¶
Overview ¶
Package rerankings provides reranking functions for reordering search results by relevance.
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
}
RankedResult holds a single reranked item with its original index, content, and relevance score.
type RerankedChromaResults ¶
type RerankedChromaResults struct {
*chromago.QueryResultImpl
QueryTexts []string // Query texts used for reranking (not in V2 QueryResultImpl)
Ranks map[string][][]float32 // each reranker adds a rank for each result
}
RerankedChromaResults wraps query results with ranking information
type RerankingFunction ¶
type RerankingFunction interface {
ID() string
Rerank(ctx context.Context, query string, results []Result) (map[string][]RankedResult, error)
RerankResults(ctx context.Context, queryTexts []string, queryResults *chromago.QueryResultImpl) (*RerankedChromaResults, error)
}
RerankingFunction defines the interface for reranking search results.
type RerankingModel ¶
type RerankingModel string
RerankingModel represents the model identifier for a reranking function.
type Result ¶
Result wraps either a text string or an arbitrary object for reranking input.
func FromObject ¶
func FromObjects ¶
Click to show internal directories.
Click to hide internal directories.