evaluation

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package evaluation scores owner-labelled extraction observations offline. It does not infer semantic truth, invoke providers, or approve a model.

Index

Constants

View Source
const MaxInputBytes = 16 << 20
View Source
const Schema = "facts-extraction-evaluation-v1"

Variables

View Source
var ErrInvalid = errors.New("invalid evaluation inputs")

Functions

This section is empty.

Types

type Case

type Case struct {
	ID                  string   `json:"id"`
	Category            string   `json:"category"`
	SupportedAssertions []string `json:"supported_assertions"`
	RequiredAssertions  []string `json:"required_assertions"`
	ExpectedConflicts   []string `json:"expected_conflicts"`
}

type CategorySummary

type CategorySummary struct {
	Category string  `json:"category"`
	Summary  Summary `json:"summary"`
}

type Dataset

type Dataset struct {
	Schema  string `json:"schema"`
	Version string `json:"version"`
	Cases   []Case `json:"cases"`
}

type Observation

type Observation struct {
	ID                 string   `json:"id"`
	Outcome            string   `json:"outcome"`
	RequestDigest      string   `json:"request_digest"`
	ResponseDigest     string   `json:"response_digest,omitempty"`
	ProposedAssertions []string `json:"proposed_assertions"`
	DetectedConflicts  []string `json:"detected_conflicts"`
}

type Rate

type Rate struct {
	Numerator   int      `json:"numerator"`
	Denominator int      `json:"denominator"`
	Value       *float64 `json:"value"`
}

type Report

type Report struct {
	Schema         string            `json:"schema"`
	DatasetVersion string            `json:"dataset_version"`
	DatasetDigest  string            `json:"dataset_digest"`
	RunDigest      string            `json:"run_digest"`
	ProfileDigest  string            `json:"profile_digest"`
	ModelIdentity  string            `json:"model_identity"`
	Total          Summary           `json:"total"`
	Categories     []CategorySummary `json:"categories"`
}

func Evaluate

func Evaluate(datasetJSON, runJSON []byte) (Report, error)

Evaluate requires one observation for every dataset case, including failures. Assertion digests and conflict IDs must be assigned under the owner's fixed labelling convention. Digests bind files; they do not attest their truth.

type Run

type Run struct {
	Schema        string        `json:"schema"`
	DatasetDigest string        `json:"dataset_digest"`
	ProfileDigest string        `json:"profile_digest"`
	ModelIdentity string        `json:"model_identity"`
	Cases         []Observation `json:"cases"`
}

type Summary

type Summary struct {
	Cases                 int  `json:"cases"`
	FailedCases           int  `json:"failed_cases"`
	UnsupportedAssertions Rate `json:"unsupported_assertion_rate"`
	MissedConflicts       Rate `json:"missed_conflict_rate"`
	MissedAssertions      Rate `json:"missed_required_assertion_rate"`
	FalseConflicts        Rate `json:"false_conflict_rate"`
}

Jump to

Keyboard shortcuts

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