Help us shape the future of Go! Take the 2026 Go Developer Survey

intent

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWeight = 0.05

DefaultWeight scales the whole intent score before it is added to the ranking score.

DECISION(2026-08): the raw intent score reaches ~+4 (coverage 1.4 + constructor 2.0 + language 1.8) while the cross-encoder it is added to emits a 0..1 sigmoid — so an unscaled "prior" outranks the calibrated model by 4x and becomes the primary ranker. Measured consequence: on the gen corpus (queries written in code vocabulary, which the coverage term rewards) it looked like +0.05 Hit@1, but across 20 repos of docstring-prose queries it cost -0.24 Hit@1 — helping only on the corpus it was tuned on. Scaled to a tie-breaker it can still order near-ties without overriding the cross-encoder. Swept on both corpora (gen Hit@1/Hit@3, mean self-retrieval Hit@1 over 20 repos): 1.0 -> 0.65/0.87, 0.667; 0.15 -> 0.65/0.90, 0.839; 0.05 -> 0.64/0.90, 0.880; 0 -> 0.60/0.88, 0.904. 0.05 costs ONE gen case (inside the +/-1 noise floor) and buys ~100 rank-1s across the polyglot suite; going to 0 loses 4 gen cases, so the ranker does earn its place - it just must not outvote the model. REVISIT IF: the reranker changes scale (a different model or a logit output instead of a sigmoid).

Variables

This section is empty.

Functions

func Weight

func Weight() float32

Weight is the intent scale, overridable for experiments via CONTEXTMAXXER_INTENT_WEIGHT (a sweep knob, not a supported setting).

Types

type Profile

type Profile struct {
	Tokens               map[string]struct{}
	ActionHints          map[string]struct{}
	ConstructorLookup    bool
	ActionLookup         bool
	Language             string
	PreferImplementation bool
}

func Analyze

func Analyze(query string) Profile

type Ranker

type Ranker struct{}

func NewRanker

func NewRanker() *Ranker

func (*Ranker) IsIntentRanker

func (r *Ranker) IsIntentRanker()

func (*Ranker) Rank

func (r *Ranker) Rank(query string, candidates []retrieve.ScoredResult) []retrieve.ScoredResult

Jump to

Keyboard shortcuts

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