#[non_exhaustive]pub struct NlpFact {
pub head: usize,
pub tail: usize,
pub relation: String,
pub margin: f32,
pub polarity: FactPolarity,
pub modality: FactModality,
pub holder: Option<usize>,
pub time: Option<usize>,
}Expand description
One extracted fact: a relation between two entities, with its attributes.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.head: usizeIndex into NlpWindow::entities of the head (subject).
tail: usizeIndex into NlpWindow::entities of the tail (object).
relation: StringThe relation name, as given in ExtractionSchema::relations.
margin: f32Calibrated margin over the model’s keep threshold. Always > 0 for a
reported fact; larger is surer.
Not a probability. Map it to one with sigmoid if a confidence is
wanted, and tune a relation’s threshold through
NlpCalibrationOverrides::rel_offsets rather than by filtering on
the margin.
polarity: FactPolarityWhether the fact is asserted or denied.
modality: FactModalityHow the fact is held: asserted, planned, merely questioned, and so on.
holder: Option<usize>Index into NlpWindow::entities of whoever holds this belief, when
the model found one — the speaker for "I live in Lisbon", the
reporter for "Leon says I work at Northstar".
time: Option<usize>Index into NlpWindow::entities of a temporal entity anchoring the
fact. Only ever set when the schema has temporal entity types.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NlpFact
impl RefUnwindSafe for NlpFact
impl Send for NlpFact
impl Sync for NlpFact
impl Unpin for NlpFact
impl UnsafeUnpin for NlpFact
impl UnwindSafe for NlpFact
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more