stream.scoring¶
stream.scoring ¶
Post-extraction confidence scoring pass.
After a grounded-extraction run completes, score how well each freshly extracted
claim/finding is supported by its verbatim quote evidence and persist the result
onto the note's grounding (advisory governance — never a publish gate). The
score then lights up the dashboard note panel and the synthesis-matrix cells via
zettelkasten.tables.
The pass needs a logprob-capable scoring driver (e.g. a GptDriver pointed at
a local vLLM open-weight model). Without one it degrades gracefully: claims with
no numeric confidence are simply left unscored, and the matrix/UI show nothing
rather than a fabricated number.
score_sources ¶
score_sources(source_graphs: list[str], *, driver: Driver, model: str = '', fallback: Driver | None = None, rescore: bool = False) -> dict[str, Any]
Score + persist advisory confidence for claim/finding notes.
Iterates each source graph's claim/finding notes, resolves the supporting
quote (its evidence), asks the driver to judge support, and writes the
resulting probability onto the note via
:func:zettelkasten.server.set_note_confidence.
Already-scored notes are skipped unless rescore is set. Notes the scorer
could not produce a numeric confidence for (no logprobs anywhere) are left
untouched. Returns a summary {scored, skipped, graphs, ...}.
Source code in stream/scoring.py
score_run_prep ¶
score_run_prep(prep: dict[str, Any], *, driver: Driver, **kwargs: Any) -> dict[str, Any]
Convenience: score the source graphs recorded in a Run's prep.