Foresight.Reflect.EntailmentVerifiers.Bumblebee (Foresight v0.1.0)

Copy Markdown View Source

NLI entailment verifier (D4). Scores each (evidence, clause) pair with a dedicated MNLI cross-encoder — a calibrated, independent entailment signal, the strongest of the three verifier backends, for hosts with the ML headroom (e.g. DGX).

A clause is supported iff its MAX entailment probability over the cited evidence clears :entailment_nli_threshold (default 0.5). A clause with no cited evidence is unsupported (nothing can entail it).

The Nx.Serving call is isolated behind a scorer so the aggregation/threshold logic is pure and unit-testable; the real model (Foresight.ML.EntailmentServing, a Bumblebee.Text.text_classification NLI serving) runs only under the :ml lane. Faithful to the pipeline's ML isolation, an absent/unavailable/erroring serving degrades to all-supported — a broken verifier never blocks a reflect answer.

Scorer contract: fn [{premise, hypothesis}, ...] -> [entailment_prob_float], one prob per pair, in order.