#[non_exhaustive]pub struct TokenPruningConfig {
pub tokens_freq_ratio_threshold: Option<i32>,
pub tokens_weight_threshold: Option<f32>,
pub only_score_pruned_tokens: Option<bool>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.tokens_freq_ratio_threshold: Option<i32>Tokens whose frequency is more than this threshold times the average frequency of all tokens in the specified field are considered outliers and pruned.
tokens_weight_threshold: Option<f32>Tokens whose weight is less than this threshold are considered nonsignificant and pruned.
only_score_pruned_tokens: Option<bool>Whether to only score pruned tokens, vs only scoring kept tokens.
Implementations§
Source§impl TokenPruningConfig
impl TokenPruningConfig
Sourcepub fn new() -> TokenPruningConfig
pub fn new() -> TokenPruningConfig
A TokenPruningConfig with its required properties set.
Source§impl TokenPruningConfig
impl TokenPruningConfig
Sourcepub fn tokens_freq_ratio_threshold(self, value: i32) -> TokenPruningConfig
pub fn tokens_freq_ratio_threshold(self, value: i32) -> TokenPruningConfig
Sets tokens_freq_ratio_threshold.
Sourcepub fn tokens_weight_threshold(self, value: f32) -> TokenPruningConfig
pub fn tokens_weight_threshold(self, value: f32) -> TokenPruningConfig
Sets tokens_weight_threshold.
Sourcepub fn only_score_pruned_tokens(self, value: bool) -> TokenPruningConfig
pub fn only_score_pruned_tokens(self, value: bool) -> TokenPruningConfig
Sets only_score_pruned_tokens.
Trait Implementations§
Source§impl Clone for TokenPruningConfig
impl Clone for TokenPruningConfig
Source§fn clone(&self) -> TokenPruningConfig
fn clone(&self) -> TokenPruningConfig
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 TokenPruningConfig
impl Debug for TokenPruningConfig
Source§impl<'de> Deserialize<'de> for TokenPruningConfig
impl<'de> Deserialize<'de> for TokenPruningConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TokenPruningConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TokenPruningConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TokenPruningConfig
impl PartialEq for TokenPruningConfig
Source§impl Serialize for TokenPruningConfig
impl Serialize for TokenPruningConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for TokenPruningConfig
Auto Trait Implementations§
impl Freeze for TokenPruningConfig
impl RefUnwindSafe for TokenPruningConfig
impl Send for TokenPruningConfig
impl Sync for TokenPruningConfig
impl Unpin for TokenPruningConfig
impl UnsafeUnpin for TokenPruningConfig
impl UnwindSafe for TokenPruningConfig
Blanket Implementations§
impl<T> Allocation for T
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