citeformer.verify.verifier¶
Top-level verification orchestrator.
Composes the three checks (existence, entailment, coverage) into one
VerificationReport. Users typically reach this via
GenerationResult.verify(sources=...) rather than constructing Verifier
directly, but the class is public so advanced users can plug in a custom
NLIModel or skip the NLI paths entirely.
Module Contents¶
Classes¶
Runs the three verification checks against a |
API¶
- class citeformer.verify.verifier.Verifier(*, threshold: float = 0.5, nli: citeformer.verify.nli.NLIModel | None = None)¶
Runs the three verification checks against a
GenerationResult.Attributes: threshold: Entailment probability above which a citation is
supportedand an uncited sentence isflagged. nli: The NLI backend. IfNone, a defaultNLIModelis created lazily on firstverify()call.Initialization
Construct a
Verifier.Args: threshold: Entailment cutoff for
supported/ flagging. nli: Preconstructed NLI model, or None to build a default on first use.- nli: citeformer.verify.nli.NLIModel | None¶
None
- verify(text: str, citations: list[citeformer.core.Citation], sources: list[citeformer.core.Source], *, run_coverage: bool = True, **_options: Any) citeformer.verify.report.VerificationReport¶
Run the full verification pipeline.
Args: text: The generated text (
GenerationResult.text). citations: Citations emitted in generation. sources: Sources that were in scope. run_coverage: If False, skip the NLI coverage check entirely. Useful on REQUIRED policy where grammar guarantees every sentence has a cite.Returns: A fully-populated
VerificationReport.