rerank

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoneName                       = "none"
	JinaRerankerV2BaseMultilingual = "jina-reranker-v2-base-multilingual"
	JinaRerankerV1TinyEN           = "jina-reranker-v1-tiny-en"
	MxbaiRerankXsmallV1            = "mxbai-rerank-xsmall-v1"
)
View Source
const JinaTinyFT = "jina-tiny-ft"

JinaTinyFT is the locally fine-tuned jina-reranker-v1-tiny-en (CORE-Bench issue->edit pairs; no download URLs — produced by the local ft pipeline).

Variables

This section is empty.

Functions

func New

Types

type Config

type Config struct {
	ModelName      string
	CacheDir       string
	BatchSize      int
	MaxTokens      int
	MaxQueryTokens int
	Log            *slog.Logger
}

type OnnxReranker

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

func NewOnnxReranker

func NewOnnxReranker(_ context.Context, cfg Config) (*OnnxReranker, error)

func (*OnnxReranker) Close

func (r *OnnxReranker) Close() error

func (*OnnxReranker) Rerank

func (r *OnnxReranker) Rerank(ctx context.Context, query string, candidates []retrieve.ScoredResult) ([]retrieve.ScoredResult, error)

func (*OnnxReranker) ScoreTexts

func (r *OnnxReranker) ScoreTexts(ctx context.Context, query string, docs []string) ([]float32, error)

ScoreTexts implements retrieve.TextScorer so evidence-window selection can reuse the loaded cross-encoder on arbitrary spans of a body.

Jump to

Keyboard shortcuts

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