screening

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 13 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

func ExportCSV

func ExportCSV(path string, events []DecisionEvent) error

func PrioritizeActiveLearning

func PrioritizeActiveLearning(paperIDs []string) []string

PrioritizeActiveLearning is a deterministic scaffold for future ASReview-style ranking.

Types

type ActiveLearningPolicyResult

type ActiveLearningPolicyResult struct {
	Policy      BalancedPolicy         `json:"policy"`
	RankedCount int                    `json:"rankedCount"`
	Simulation  RecallEffortSimulation `json:"simulation"`
	Score       float64                `json:"score"`
}

type ActiveLearningRun

type ActiveLearningRun struct {
	SchemaVersion       string                 `json:"schemaVersion"`
	RunID               string                 `json:"runId"`
	Stage               Stage                  `json:"stage"`
	InputHash           string                 `json:"inputHash"`
	DecisionHash        string                 `json:"decisionHash"`
	RankingMethod       string                 `json:"rankingMethod"`
	SeedDecisions       []DecisionEvent        `json:"seedDecisions"`
	RankedOutput        []PrioritizedRecord    `json:"rankedOutput"`
	ReviewerProgress    ProgressReport         `json:"reviewerProgress"`
	StoppingDiagnostics StoppingRecommendation `json:"stoppingDiagnostics"`
	AdjudicationState   AdjudicationState      `json:"adjudicationState"`
}

func BuildActiveLearningRun

func BuildActiveLearningRun(input ActiveLearningRunInput) (ActiveLearningRun, error)

type ActiveLearningRunInput

type ActiveLearningRunInput struct {
	RunID         string
	Records       []ScreeningRecord
	Events        []DecisionEvent
	Stage         Stage
	RankingMethod string
	TargetRecall  float64
}

type ActiveLearningSensitivityInput

type ActiveLearningSensitivityInput struct {
	Records          []ScreeningRecord
	Events           []DecisionEvent
	Stage            Stage
	RelevantPaperIDs []string
	Policies         []BalancedPolicy
	TargetRecalls    []float64
}

type ActiveLearningSensitivityReport

type ActiveLearningSensitivityReport struct {
	SchemaVersion  string                       `json:"schemaVersion"`
	Stage          Stage                        `json:"stage"`
	InputHash      string                       `json:"inputHash"`
	DecisionHash   string                       `json:"decisionHash"`
	SelectedPolicy string                       `json:"selectedPolicy"`
	PolicyResults  []ActiveLearningPolicyResult `json:"policyResults"`
}

type AdjudicatedItem

type AdjudicatedItem struct {
	PaperID  string        `json:"paperId"`
	Decision DecisionEvent `json:"decision"`
}

type AdjudicationState

type AdjudicationState struct {
	Conflicts        int      `json:"conflicts"`
	ConflictPaperIDs []string `json:"conflictPaperIds"`
	Adjudicated      int      `json:"adjudicated"`
	Pending          int      `json:"pending"`
}

type BalancedPolicy

type BalancedPolicy struct {
	Name               string  `json:"name"`
	ExploitationWeight float64 `json:"exploitationWeight"`
	ExplorationWeight  float64 `json:"explorationWeight"`
}

func DefaultBalancedPolicies

func DefaultBalancedPolicies() []BalancedPolicy

type ConflictAdjudicationPanel

type ConflictAdjudicationPanel struct {
	Stage       Stage             `json:"stage"`
	Conflicts   []ConflictItem    `json:"conflicts"`
	Adjudicated []AdjudicatedItem `json:"adjudicated"`
}

func BuildConflictAdjudicationPanel

func BuildConflictAdjudicationPanel(events []DecisionEvent, stage Stage) ConflictAdjudicationPanel

type ConflictItem

type ConflictItem struct {
	PaperID   string          `json:"paperId"`
	Decisions []DecisionEvent `json:"decisions"`
}

type Decision

type Decision string
const (
	DecisionInclude   Decision = "include"
	DecisionExclude   Decision = "exclude"
	DecisionUncertain Decision = "uncertain"
)

type DecisionEvent

type DecisionEvent struct {
	PaperID     string
	Stage       Stage
	Decision    Decision
	Reason      string
	Reviewer    string
	Adjudicated bool
}

func ImportCSV

func ImportCSV(path string) ([]DecisionEvent, error)

func NormalizeDecisionEvent added in v0.1.18

func NormalizeDecisionEvent(event DecisionEvent) DecisionEvent

type DecisionInput

type DecisionInput struct {
	PaperID     string
	Stage       Stage
	Decision    Decision
	Reason      string
	Reviewer    string
	Adjudicated bool
}

func NormalizeDecisionInput added in v0.1.18

func NormalizeDecisionInput(input DecisionInput) DecisionInput

type MemoryStore

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

func NewMemoryStore

func NewMemoryStore(workflow Workflow) *MemoryStore

func (*MemoryStore) Conflicts

func (s *MemoryStore) Conflicts(stage Stage) []string

func (*MemoryStore) Decide

func (s *MemoryStore) Decide(input DecisionInput) error

func (*MemoryStore) History

func (s *MemoryStore) History(paperID string) []DecisionEvent

func (*MemoryStore) PRISMACounts

func (s *MemoryStore) PRISMACounts() PRISMACounts

func (*MemoryStore) Queue

func (s *MemoryStore) Queue(filter QueueFilter) []string

type ModelMetadata

type ModelMetadata struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Method  string `json:"method"`
}

type Options

type Options struct{ ExclusionReasons []string }

type PRISMACounts

type PRISMACounts struct {
	Included  int
	Excluded  int
	Uncertain int
}

type PrioritizedRecord

type PrioritizedRecord struct {
	ID                string  `json:"id"`
	Score             float64 `json:"score"`
	Uncertainty       float64 `json:"uncertainty,omitempty"`
	ExploitationScore float64 `json:"exploitationScore,omitempty"`
	ExplorationScore  float64 `json:"explorationScore,omitempty"`
	Policy            string  `json:"policy,omitempty"`
}

PrioritizedRecord is an unscreened record plus its deterministic relevance score.

func PrioritizeActiveLearningRecords

func PrioritizeActiveLearningRecords(records []ScreeningRecord, events []DecisionEvent, stage Stage) []PrioritizedRecord

PrioritizeActiveLearningRecords is a deterministic ASReview-style scaffold: it ranks unscreened records higher when their title/abstract overlaps with included seed records and lower when they overlap with excluded seed records.

func PrioritizeBalancedRecords

func PrioritizeBalancedRecords(records []ScreeningRecord, events []DecisionEvent, stage Stage, policy BalancedPolicy) []PrioritizedRecord

func PrioritizeModelRecords

func PrioritizeModelRecords(records []ScreeningRecord, events []DecisionEvent, stage Stage) []PrioritizedRecord

PrioritizeModelRecords ranks unscreened records with a smoothed naive-Bayes text model.

func PrioritizeUncertaintyRecords

func PrioritizeUncertaintyRecords(records []ScreeningRecord, events []DecisionEvent, stage Stage) []PrioritizedRecord

PrioritizeUncertaintyRecords ranks unscreened records closest to the model boundary.

type ProgressReport

type ProgressReport struct {
	Stage           Stage              `json:"stage"`
	TotalRecords    int                `json:"totalRecords"`
	ScreenedRecords int                `json:"screenedRecords"`
	Remaining       int                `json:"remaining"`
	Conflicts       int                `json:"conflicts"`
	Reviewers       []ReviewerProgress `json:"reviewers"`
}

ProgressReport summarizes auditable human screening progress for one stage.

func Progress

func Progress(events []DecisionEvent, stage Stage, totalRecords int) ProgressReport

Progress computes deterministic reviewer progress metrics for a stage.

type QueueFilter

type QueueFilter struct {
	Stage    Stage
	Decision Decision
}

type RecallEffortPoint

type RecallEffortPoint struct {
	Screened int     `json:"screened"`
	Included int     `json:"included"`
	Recall   float64 `json:"recall"`
}

RecallEffortPoint records cumulative recall over screening effort.

func RecallEffortCurve

func RecallEffortCurve(events []DecisionEvent, stage Stage) []RecallEffortPoint

RecallEffortCurve computes a deterministic cumulative recall curve for one stage.

type RecallEffortSimulation

type RecallEffortSimulation struct {
	TotalRelevant int                  `json:"totalRelevant"`
	Points        []RecallEffortPoint  `json:"points"`
	Targets       []RecallTargetResult `json:"targets"`
}

func SimulateRecallEffort

func SimulateRecallEffort(ranked []PrioritizedRecord, relevantIDs []string, targets []float64) RecallEffortSimulation

type RecallTargetResult

type RecallTargetResult struct {
	TargetRecall float64 `json:"targetRecall"`
	ReachedAt    int     `json:"reachedAt"`
}

type ReviewerAssignment

type ReviewerAssignment struct {
	PaperID  string `json:"paperId"`
	Reviewer string `json:"reviewer"`
	Stage    Stage  `json:"stage"`
}

func AssignReviewers

func AssignReviewers(records []ScreeningRecord, reviewers []string, reviewersPerRecord int) []ReviewerAssignment

type ReviewerProgress

type ReviewerProgress struct {
	Reviewer  string `json:"reviewer"`
	Decisions int    `json:"decisions"`
	Included  int    `json:"included"`
	Excluded  int    `json:"excluded"`
	Uncertain int    `json:"uncertain"`
}

ReviewerProgress summarizes one reviewer's work for a screening stage.

type ScreeningAuditBundle

type ScreeningAuditBundle struct {
	SchemaVersion       string                    `json:"schemaVersion"`
	Stage               Stage                     `json:"stage"`
	InputHash           string                    `json:"inputHash"`
	DecisionHash        string                    `json:"decisionHash"`
	Assignments         []ReviewerAssignment      `json:"assignments"`
	Panel               ConflictAdjudicationPanel `json:"conflictAdjudicationPanel"`
	Uncertain           []UncertainQueueItem      `json:"uncertainQueue"`
	Progress            ProgressReport            `json:"progress"`
	ActiveRunRef        string                    `json:"activeRunRef,omitempty"`
	FrozenDataset       []ScreeningRecord         `json:"frozenDataset,omitempty"`
	SeedLabels          []DecisionEvent           `json:"seedLabels,omitempty"`
	RankingIterations   []PrioritizedRecord       `json:"rankingIterations,omitempty"`
	ReviewerActions     []DecisionEvent           `json:"reviewerActions,omitempty"`
	StoppingDiagnostics StoppingRecommendation    `json:"stoppingDiagnostics"`
	RandomSeeds         []string                  `json:"randomSeeds,omitempty"`
	ModelMetadata       ModelMetadata             `json:"modelMetadata"`
}

func BuildScreeningAuditBundle

func BuildScreeningAuditBundle(input ScreeningAuditBundleInput) ScreeningAuditBundle

type ScreeningAuditBundleInput

type ScreeningAuditBundleInput struct {
	Records     []ScreeningRecord
	Events      []DecisionEvent
	Assignments []ReviewerAssignment
	Stage       Stage
	ActiveRun   ActiveLearningRun
}

type ScreeningRecord

type ScreeningRecord struct {
	ID       string
	Title    string
	Abstract string
}

ScreeningRecord is the minimal text needed to prioritize records for human screening.

type Stage

type Stage string
const (
	StageTitleAbstract  Stage = "title_abstract"
	StageFullText       Stage = "full_text"
	StageFinalInclusion Stage = "final_inclusion"
)

type StoppingRecommendation

type StoppingRecommendation struct {
	Stage         Stage   `json:"stage"`
	TargetRecall  float64 `json:"targetRecall"`
	CurrentRecall float64 `json:"currentRecall"`
	Screened      int     `json:"screened"`
	Included      int     `json:"included"`
	Unscreened    int     `json:"unscreened"`
	CanStop       bool    `json:"canStop"`
	Reason        string  `json:"reason"`
}

StoppingRecommendation summarizes whether observed screening can stop at a recall target.

func StoppingCriteria

func StoppingCriteria(events []DecisionEvent, stage Stage, targetRecall float64, totalRecords int) StoppingRecommendation

StoppingCriteria evaluates a simple auditable recall threshold over observed decisions.

CurrentRecall is only ever measured over records already decided, so it reaches 1.0 as soon as a single Include exists — it is not an estimate of recall against the full candidate pool. totalRecords guards against recommending a stop while records outside "events" remain unscreened; richer recall estimation against an unscreened backlog is a deferred roadmap item (see opensource/inventory/asreview.md), not implemented here.

type UncertainQueueItem

type UncertainQueueItem struct {
	PaperID   string          `json:"paperId"`
	Decisions []DecisionEvent `json:"decisions"`
}

func UncertainQueue

func UncertainQueue(events []DecisionEvent, stage Stage) []UncertainQueueItem

type Workflow

type Workflow struct {
	Stages           []Stage
	Decisions        []Decision
	ExclusionReasons []string
}

func Configure

func Configure(options Options) (Workflow, error)

func (Workflow) ValidateReason

func (w Workflow) ValidateReason(reason string) error

Jump to

Keyboard shortcuts

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