pub struct ContextConfig {
pub words_before: usize,
pub words_after: usize,
pub single_hit_boost: f64,
pub multi_hit_boost: f64,
pub code_context_penalty: f64,
}Expand description
Configuration for context-aware confidence scoring.
§Examples
use cloakrs_core::ContextConfig;
let config = ContextConfig::default();
assert_eq!(config.words_before, 5);Fields§
§words_before: usizeNumber of words to inspect before the match.
words_after: usizeNumber of words to inspect after the match.
single_hit_boost: f64Boost for one positive context hit.
multi_hit_boost: f64Boost for two or more positive context hits.
code_context_penalty: f64Penalty when code-like context is detected.
Trait Implementations§
Source§impl Clone for ContextConfig
impl Clone for ContextConfig
Source§fn clone(&self) -> ContextConfig
fn clone(&self) -> ContextConfig
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 ContextConfig
impl Debug for ContextConfig
Source§impl Default for ContextConfig
impl Default for ContextConfig
Source§impl<'de> Deserialize<'de> for ContextConfig
impl<'de> Deserialize<'de> for ContextConfig
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
Source§impl PartialEq for ContextConfig
impl PartialEq for ContextConfig
Source§fn eq(&self, other: &ContextConfig) -> bool
fn eq(&self, other: &ContextConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ContextConfig
impl Serialize for ContextConfig
impl StructuralPartialEq for ContextConfig
Auto Trait Implementations§
impl Freeze for ContextConfig
impl RefUnwindSafe for ContextConfig
impl Send for ContextConfig
impl Sync for ContextConfig
impl Unpin for ContextConfig
impl UnsafeUnpin for ContextConfig
impl UnwindSafe for ContextConfig
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