#[non_exhaustive]pub struct NlpCalibration {
pub rel_offsets: HashMap<String, f32>,
pub unseen_offset: f32,
pub offset: f32,
pub rel_top: usize,
pub span_offset: f32,
pub coref_link_bias: f32,
pub ent_o_bias: f32,
pub entity_coref: String,
}Expand description
The decoding thresholds a model ships in calibration.json.
These are not hyperparameters of the graphs; they were tuned on dev data
and are what the published quality figures were measured with. Override
them per request via NlpRequest::calibration only against a labelled
sample.
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.rel_offsets: HashMap<String, f32>Per-relation offsets, by relation name. A fact is kept when its raw
margin exceeds -offset.
unseen_offset: f32The offset applied to relations the model was not calibrated for,
as -unseen_offset.
offset: f32A global offset added to every relation threshold.
rel_top: usizeHow many facts to keep per entity pair.
span_offset: f32Subtracted from entity-type span margins.
coref_link_bias: f32Added to the “no antecedent” coreference score. Higher links less.
ent_o_bias: f32Added to the O column of the default entity head.
entity_coref: StringHow coreference groups entity mentions: "none", "compatible" or
"all". Both kniv v7 models ship "none" — chains merge mentions
too eagerly and cost end-to-end relation F1.
Implementations§
Source§impl NlpCalibration
impl NlpCalibration
Sourcepub fn with_overrides(&self, overrides: &NlpCalibrationOverrides) -> Self
pub fn with_overrides(&self, overrides: &NlpCalibrationOverrides) -> Self
This calibration with overrides applied.
Trait Implementations§
Source§impl Clone for NlpCalibration
impl Clone for NlpCalibration
Source§fn clone(&self) -> NlpCalibration
fn clone(&self) -> NlpCalibration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NlpCalibration
impl Debug for NlpCalibration
Source§impl Default for NlpCalibration
impl Default for NlpCalibration
Source§fn default() -> NlpCalibration
fn default() -> NlpCalibration
Source§impl PartialEq for NlpCalibration
impl PartialEq for NlpCalibration
impl StructuralPartialEq for NlpCalibration
Auto Trait Implementations§
impl Freeze for NlpCalibration
impl RefUnwindSafe for NlpCalibration
impl Send for NlpCalibration
impl Sync for NlpCalibration
impl Unpin for NlpCalibration
impl UnsafeUnpin for NlpCalibration
impl UnwindSafe for NlpCalibration
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