pub struct FaithfulnessScore {
pub precision: f32,
pub polarity_match: bool,
pub unentailed: Vec<String>,
pub polarity_drift: Vec<PolarityDrift>,
}Expand description
A faithfulness score for a rendered hypothesis against its source.
Fields§
§precision: f32Fraction of hypothesis content tokens entailed by source. [0.0, 1.0].
polarity_match: boolTrue iff polarity-token multisets match exactly between source and hypothesis.
unentailed: Vec<String>Hypothesis content tokens not entailed by source (hallucinated words).
polarity_drift: Vec<PolarityDrift>Polarity tokens whose counts differ between hypothesis and source.
Empty iff polarity_match is true.
Implementations§
Source§impl FaithfulnessScore
impl FaithfulnessScore
Sourcepub fn is_faithful(&self) -> bool
pub fn is_faithful(&self) -> bool
True iff precision == 1.0 AND polarity_match. Use this for strict
template conformance tests where zero hallucination is required.
Trait Implementations§
Source§impl Clone for FaithfulnessScore
impl Clone for FaithfulnessScore
Source§fn clone(&self) -> FaithfulnessScore
fn clone(&self) -> FaithfulnessScore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FaithfulnessScore
impl Debug for FaithfulnessScore
Source§impl PartialEq for FaithfulnessScore
impl PartialEq for FaithfulnessScore
Source§fn eq(&self, other: &FaithfulnessScore) -> bool
fn eq(&self, other: &FaithfulnessScore) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FaithfulnessScore
Auto Trait Implementations§
impl Freeze for FaithfulnessScore
impl RefUnwindSafe for FaithfulnessScore
impl Send for FaithfulnessScore
impl Sync for FaithfulnessScore
impl Unpin for FaithfulnessScore
impl UnsafeUnpin for FaithfulnessScore
impl UnwindSafe for FaithfulnessScore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more