GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing ct.rithul.dev — continuum.verifiers - Continuum Source code for continuum.verifiers"""Hit verifiers for the semantic cache tier. Similarity search finds the cached prompt *closest* to a new one; a verifier then decides whether that cached answer is actually *correct* for it. This second stage is what keeps near-miss edits ("enable" vs "disable" two-factor auth, "Australia" vs "Austria", "5" vs "50" euros) from being served the wrong answer: embedders score those pairs as high as true paraphrases. - :class:`~continuum._native.LexicalNearMissVerifier` (the default on every ``SemanticCacheIndex``) rejects minimal edits: swapped numbers, swapped content words with everything else unchanged, flipped polarity or negation. Fast and deterministic, but it cannot tell a synonym swap ("cancel" vs "end") from an antonym swap, so it also turns those down. - :class:`LLMJudgeVerifier` asks a chat model whether both prompts have the same answer. It understands synonyms and antonyms, at the cost of one model call per candidate hit (verdicts are cached). - :class:`AllOf` requires every verifier in a chain to accept. Note that chaining the lexical verifier in front of a judge keeps the lexical verifier's synonym rejections; use the judge alone when recall on rewordings matters. Use one with ``SemanticCacheIndex.set_verifier(...)``; ``None`` disables verification. Measurements: ``benchmarks/reports/semantic-false-hits.md``. """ from __future__ import annotations import json import urllib.request from collections.abc import Sequence from continuum._native import HitVerifier, LexicalNearMissVerifier __all__ = ["AllOf", "HitVerifier", "LLMJudgeVerifier", "LexicalNearMissVerifier"] JUDGE_PROMPT = ( "You decide whether a cached answer can be reused.\n" "Question A: {a}\n" "Question B: {b}\n" "Would one correct answer to A also be a correct and complete answer to B? " "Answer with exactly one word: YES or NO." ) |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |