Documentation
¶
Index ¶
- func DumpRankingDiagnostics(path string, results []Result) error
- func Summarize(results []Result) (recallAt5, recallAt10, mrr float64)
- func SummarizeByTag(results []Result) (map[string]Summary, map[string]int)
- type DiagnosticCandidate
- type DiagnosticRow
- type GlobalSummary
- type Manifest
- type ManifestProject
- type ProjectSummary
- type QueryCase
- type Result
- func RunEval(ctx context.Context, retriever *retrieve.Retriever, cases []QueryCase, ...) []Result
- func RunEvalAlpha(ctx context.Context, retriever *retrieve.Retriever, cases []QueryCase, ...) []Result
- func RunEvalAlphaRerankK(ctx context.Context, retriever *retrieve.Retriever, cases []QueryCase, ...) []Result
- func RunEvalAlphaRerankKAdaptive(ctx context.Context, retriever *retrieve.Retriever, cases []QueryCase, ...) []Result
- func RunEvalFull(ctx context.Context, retriever *retrieve.Retriever, cases []QueryCase, ...) []Result
- func RunEvalFullDPP(ctx context.Context, retriever *retrieve.Retriever, cases []QueryCase, ...) []Result
- func RunEvalFullWithAlphaSet(ctx context.Context, retriever *retrieve.Retriever, cases []QueryCase, ...) []Result
- type Summary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpRankingDiagnostics ¶
Types ¶
type DiagnosticCandidate ¶
type DiagnosticRow ¶
type DiagnosticRow struct {
QueryID string `json:"query_id"`
Mode string `json:"mode"`
Expected []string `json:"expected"`
EffectiveAlpha float32 `json:"effective_alpha"`
Candidates []DiagnosticCandidate `json:"candidates"`
}
type GlobalSummary ¶
func SummarizeGlobal ¶
func SummarizeGlobal(projects []ProjectSummary) GlobalSummary
type Manifest ¶
type Manifest struct {
Projects []ManifestProject `json:"projects"`
}
func LoadManifest ¶
type ManifestProject ¶
type ProjectSummary ¶
type ProjectSummary struct {
Project string
QueryCount int
Vector Summary
Hybrid Summary
AvgLatency time.Duration
}
func BuildProjectSummary ¶
func BuildProjectSummary(project string, vector, hybrid []Result) ProjectSummary
type QueryCase ¶
type QueryCase struct {
ID string `json:"id"`
Query string `json:"query"`
Expected []string `json:"expected"`
// MinHits is the minimum number of `Expected` symbols that must appear in
// top-K for RecallAt5/RecallAt10 to be true. Default 1 (any-of semantics).
// Used for multi-hop queries where we want "find 3 of 4 flow stages in top-5".
MinHits int `json:"min_hits,omitempty"`
// NotExpected lists symbols that are lexical/semantic traps. If any of these
// appear in top-5, TrapsHit is incremented. Doesn't affect Recall directly,
// reported as a separate precision-against-traps metric.
NotExpected []string `json:"not_expected,omitempty"`
// Category is informational: paraphrastic|multi-hop|intent-vs-def|negative|cross-language.
Category string `json:"category,omitempty"`
// Tags label eval slices (sibling-ambiguous, constructor, layer-conflict, ...).
// Used for per-slice metric aggregation; a case may carry several tags.
Tags []string `json:"tags,omitempty"`
}
type Result ¶
type Result struct {
QueryID string
Mode string
Expected []string
TopK []string
Symbols []retrieve.ScoredResult
Hits []int
RecallAt5 bool
RecallAt10 bool
MRR float64
Latency time.Duration
Stats retrieve.Stats
// HitsAt5/HitsAt10: count of Expected symbols in top-K (for multi-hop scoring).
HitsAt5 int
HitsAt10 int
// MinHits used for this case (0 means default 1 was applied).
MinHits int
// TrapsAt5: count of NotExpected symbols that appear in top-5.
TrapsAt5 int
// Tags copied from the QueryCase for per-slice aggregation.
Tags []string
// TotalTokens is the packed response size (information-per-token metric).
TotalTokens int
}
func RunEvalAlpha ¶
func RunEvalAlphaRerankK ¶
func RunEvalFull ¶
func RunEvalFullDPP ¶
Click to show internal directories.
Click to hide internal directories.