Struct nnsplit::NNSplitOptions
source · pub struct NNSplitOptions {
pub threshold: f32,
pub stride: usize,
pub max_length: usize,
pub padding: usize,
pub length_divisor: usize,
pub batch_size: usize,
}
Expand description
Options for splitting text.
Fields§
§threshold: f32
Threshold from 0 to 1 above which predictions will be considered positive.
stride: usize
How much to move the window after each prediction (comparable to stride of 1d convolution).
max_length: usize
The maximum length of each cut (comparable to kernel size of 1d convolution).
padding: usize
How much to zero pad the text on both sides.
length_divisor: usize
Total length will be padded until it is divisible by this number. Allows some additional optimizations.
batch_size: usize
Batch size to use.
Trait Implementations§
source§impl Default for NNSplitOptions
impl Default for NNSplitOptions
source§impl<'de> Deserialize<'de> for NNSplitOptions
impl<'de> Deserialize<'de> for NNSplitOptions
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for NNSplitOptions
impl Send for NNSplitOptions
impl Sync for NNSplitOptions
impl Unpin for NNSplitOptions
impl UnwindSafe for NNSplitOptions
Blanket Implementations§
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.