batch

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	HumanLabel  string   // "pass", "review", "fail" — empty = not provided
	HumanScore  *float64 // 0.0–1.0 — nil = not provided
	HumanReason string   // free-text explanation from annotator — empty = not provided
}

Annotation holds human-provided ground truth for a single conversation.

type ConfusionMatrixResult

type ConfusionMatrixResult struct {
	Labels []string `json:"labels"`
	Matrix [][]int  `json:"matrix"` // [true][predicted]
}

ConfusionMatrixResult is a 3-class confusion matrix for fail/review/pass.

type ConversationExecutor

type ConversationExecutor interface {
	Execute(ctx context.Context, req models.ConversationEvaluationRequest) models.ConversationEvaluationResult
}

ConversationExecutor runs conversation-level evaluation.

type ConversationInputRecord

type ConversationInputRecord struct {
	LineNumber  int
	Request     models.ConversationEvaluationRequest
	HumanLabel  string   // optional: "pass", "review", "fail"
	HumanScore  *float64 // optional: 0.0–1.0
	HumanReason string   // optional: free-text explanation from annotator
	Error       error
}

ConversationInputRecord is a single conversation record read from a JSONL input file.

type ConversationProcessor

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

ConversationProcessor processes conversation records concurrently.

func NewConversationProcessor

func NewConversationProcessor(exec ConversationExecutor, workers int, logger *zerolog.Logger) *ConversationProcessor

func (*ConversationProcessor) Process

type ConversationReader

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

ConversationReader reads conversation evaluation records from a JSONL file.

func NewConversationReader

func NewConversationReader(file io.Reader, logger *zerolog.Logger) *ConversationReader

func (*ConversationReader) ReadAll

type ConversationSummaryStats

type ConversationSummaryStats struct {
	Total             int                `json:"total"`
	VerdictCounts     map[string]int     `json:"verdict_counts"`
	CorrelationReport *CorrelationReport `json:"correlation_report,omitempty"`
}

ConversationSummaryStats holds aggregate statistics for a batch of conversation evaluations.

type ConversationSummaryWriter

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

ConversationSummaryWriter accumulates conversation evaluation results and writes aggregate stats.

func NewConversationSummaryWriter

func NewConversationSummaryWriter(output io.Writer, logger *zerolog.Logger) *ConversationSummaryWriter

func (*ConversationSummaryWriter) Close

func (w *ConversationSummaryWriter) Close() error

func (*ConversationSummaryWriter) SetCorrelationReport

func (w *ConversationSummaryWriter) SetCorrelationReport(r *CorrelationReport)

SetCorrelationReport attaches a pre-computed correlation report to be included in the summary output.

func (*ConversationSummaryWriter) Write

type CorrelationReport

type CorrelationReport struct {
	AnnotatedCount  int                    `json:"annotated_count"`
	KendallTau      *float64               `json:"kendall_tau,omitempty"`
	WeightedKappa   *float64               `json:"weighted_kappa,omitempty"`
	ConfusionMatrix *ConfusionMatrixResult `json:"confusion_matrix,omitempty"`
	Disagreements   []DisagreementEntry    `json:"disagreements,omitempty"`
}

CorrelationReport holds all computed correlation metrics.

func ComputeCorrelationReport

func ComputeCorrelationReport(results []models.ConversationEvaluationResult, annotations map[string]Annotation) CorrelationReport

ComputeCorrelationReport joins results with annotations by ConversationID and computes correlation metrics between Themis scores/verdicts and human-provided ground truth.

type DisagreementEntry

type DisagreementEntry struct {
	ConversationID string   `json:"conversation_id"`
	HumanLabel     string   `json:"human_label"`
	ThemisLabel    string   `json:"themis_label"`
	HumanScore     *float64 `json:"human_score,omitempty"`
	ThemisScore    float64  `json:"themis_score"`
}

DisagreementEntry records a single per-conversation label mismatch between the human annotator and Themis.

Jump to

Keyboard shortcuts

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