pub struct Parameters {
pub threshold: f32,
pub flat_ner: bool,
pub dup_label: bool,
pub multi_label: bool,
pub max_width: usize,
pub max_length: Option<usize>,
}Expand description
Represents the set of parameters for the whole pipeline
- pre-processing
- post-processing
The easiest way to instanciate sound parameters is to use the
default() constructor and then use individual setters as needed.
Fields§
§threshold: f32Probability threshold (default: 0.5)
flat_ner: boolSetting this parameter to true means that no entity can overlap with another one (default: true)
dup_label: boolIf flat_ner=false, setting this parameter to true means that overlapping spans can belong to the same class (default: false)
multi_label: boolIf flat_ner=false, setting this parameter to true means that overlapping spans can belong to different classes (default: false)
max_width: usizeFor span mode, maximum span width (default: 12)
max_length: Option<usize>Maximum sequence length (default: 512)
Implementations§
Source§impl Parameters
impl Parameters
Sourcepub fn new(
threshold: f32,
max_width: usize,
max_length: Option<usize>,
flat_ner: bool,
dup_label: bool,
multi_label: bool,
) -> Self
pub fn new( threshold: f32, max_width: usize, max_length: Option<usize>, flat_ner: bool, dup_label: bool, multi_label: bool, ) -> Self
New configuration specifying every parameter
pub fn with_threshold(self, threshold: f32) -> Self
pub fn with_max_width(self, max_width: usize) -> Self
pub fn with_max_length(self, max_length: Option<usize>) -> Self
pub fn with_flat_ner(self, flat_ner: bool) -> Self
pub fn with_dup_label(self, dup_label: bool) -> Self
pub fn with_multi_label(self, multi_label: bool) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Parameters
impl RefUnwindSafe for Parameters
impl Send for Parameters
impl Sync for Parameters
impl Unpin for Parameters
impl UnwindSafe for Parameters
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
Converts
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>
Converts
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