Documentation
¶
Overview ¶
Package accuracy measures how often the quality gate's and the side gate's answers agree with a person's placement. The label is a person's placement of an item that the gates sent to review first, as store.ReviewPlacement reads it from the item's decisions. A placement that no review came before labels nothing. Each done answer of the quality gate on a labeled item is one comparison, so an item that two prompt versions answered counts once under each.
An arm is the gate's prompt asked of another model, kept at its own stage. Each arm is reported by its model, beside the gate's answers to the same prompt on the same items, so two models compare over one set of labels.
A comparison reads the model's answer as it gave it, before any floor turns a drop or a guess into review, so the counts by confidence band show where a floor would sit. The quality gate's pass agrees with a placement on a side, and its drop with a person's drop. The side gate's guess agrees where it names the person's side, and a person's drop gives it nothing to compare. An unsure answer neither agrees nor disagrees.
The note band reads every note's draft by its confidence. A draft is kept where a person's placement took it, and rewritten where a person's note took its place. It is applied where it reached the floor and the read gate made it the read's note with no person, waiting where the item waits in review as note-unclear, and other where the item left a read by a model. Kept over kept and rewritten counts only what a person decided, so it shows where the note floor would sit.
Index ¶
- Constants
- func AnswersAt(outputs []store.Output, stage string) []store.Output
- func NoteOutcome(r store.ItemRecords) string
- func Outcomes(a qualitygate.Answer, label string) (verdict, side string)
- func Routes(st *store.Store, noteFloor float64, log *slog.Logger) server.Routes
- type Answers
- type Arm
- type Band
- type ByConnector
- type ByModel
- type ByPromptVersion
- type Counts
- type Gate
- type Labels
- type NoteBand
- type NoteCounts
- type NoteDrafts
- type Pair
- type Report
Constants ¶
const ( NoteKept = "kept" NoteApplied = "applied" NoteRewritten = "rewritten" NoteWaiting = "waiting" NoteOther = "other" )
How one draft fared.
const ( Agreed = "agreed" Disagreed = "disagreed" Unsure = "unsure" )
Outcomes of one comparison.
const SchemaVersion = 3
SchemaVersion is the version of schemas/gate-agreement.schema.json that a report holds to.
Variables ¶
This section is empty.
Functions ¶
func AnswersAt ¶ added in v0.28.0
AnswersAt is each done answer of the gate's prompt among outputs at stage, the quality gate's own or an arm's, that decodes.
func NoteOutcome ¶ added in v0.32.0
func NoteOutcome(r store.ItemRecords) string
NoteOutcome is how the item's draft fared, by its newest decisions.
Types ¶
type Arm ¶
type Arm struct {
Model string `json:"model"`
// Items counts the labeled items that the arm answered.
Items int `json:"items"`
// Arm is the arm's answers, and Gate the gate's answers to the same
// prompt versions on the same items.
Arm Answers `json:"arm"`
Gate Answers `json:"gate"`
}
Arm is one model's answers to the gate's prompt, beside the gate's own.
type Band ¶
Band is the comparisons whose answer's confidence lies from From up to To, To itself only in the top band.
type ByConnector ¶
ByConnector is the comparisons on the items that one connector sighted.
type ByPromptVersion ¶
ByPromptVersion is the comparisons on one prompt version's answers.
type Counts ¶
type Counts struct {
Comparisons int `json:"comparisons"`
Agreed int `json:"agreed"`
Disagreed int `json:"disagreed"`
Unsure int `json:"unsure"`
// Agreement is Agreed over Agreed and Disagreed, and nil where both are 0.
Agreement *float64 `json:"agreement"`
// Answers counts each pair of the model's answer and the person's
// placement.
Answers []Pair `json:"answers"`
}
Counts is how a set of comparisons came out.
type Gate ¶
type Gate struct {
// Floor is the confidence at or above which the gate acts on the answer
// alone: the quality gate's drop, or the side gate's guess.
Floor float64 `json:"floor"`
Overall Counts `json:"overall"`
ByConfidence []Band `json:"by_confidence"`
ByConnector []ByConnector `json:"by_connector"`
ByModel []ByModel `json:"by_model"`
ByPromptVersion []ByPromptVersion `json:"by_prompt_version"`
}
Gate is one gate's agreement overall and broken down.
type Labels ¶
type Labels struct {
Items int `json:"items"`
Personal int `json:"personal"`
Fleet int `json:"fleet"`
Drop int `json:"drop"`
}
Labels counts the labeled items, by where the person placed each.
type NoteBand ¶ added in v0.32.0
type NoteBand struct {
From float64 `json:"from"`
To float64 `json:"to"`
NoteCounts
}
NoteBand is the drafts whose confidence lies from From up to To, To itself only in the top band.
type NoteCounts ¶ added in v0.32.0
type NoteCounts struct {
Drafts int `json:"drafts"`
Kept int `json:"kept"`
Applied int `json:"applied"`
Rewritten int `json:"rewritten"`
Waiting int `json:"waiting"`
Other int `json:"other"`
KeptShare *float64 `json:"kept_share"`
}
NoteCounts is how a set of drafts fared, one draft to an item.
type NoteDrafts ¶ added in v0.32.0
type NoteDrafts struct {
Floor float64 `json:"floor"`
Overall NoteCounts `json:"overall"`
ByConfidence []NoteBand `json:"by_confidence"`
}
NoteDrafts is how the note stage's drafts fared against the floor at or above which a draft becomes the read's note.
func MeasureNotes ¶ added in v0.32.0
func MeasureNotes(records []store.ItemRecords, floor float64) NoteDrafts
MeasureNotes is how the newest done draft of each of records fared, under floor.
type Pair ¶
type Pair struct {
Answer string `json:"answer"`
Label string `json:"label"`
Count int `json:"count"`
}
Pair is how many comparisons paired one answer with one placement.
type Report ¶
type Report struct {
SchemaVersion int `json:"schema_version"`
Labels Labels `json:"labels"`
// Unanswered counts the labeled items that hold no done answer of the
// quality gate, which a quality replay with placed_by person answers.
Unanswered int `json:"unanswered"`
Quality Gate `json:"quality"`
Side Gate `json:"side"`
// Arms are each arm's answers by model, the first model first.
Arms []Arm `json:"arms"`
// Note is how each note's draft fared, overall and by its confidence.
Note NoteDrafts `json:"note"`
}
Report is what GET /api/v1/gates/agreement answers: schemas/gate-agreement.schema.json.