pub struct ContainsKeyword { /* private fields */ }Expand description
Keyword-contains evaluator: checks whether the prediction contains the given keywords.
all_required = true (default) requires all keywords to score; false scores on any.
Implementations§
Source§impl ContainsKeyword
impl ContainsKeyword
Sourcepub fn case_sensitive(self, v: bool) -> Self
pub fn case_sensitive(self, v: bool) -> Self
Case sensitive (case-insensitive by default)
Sourcepub fn all_required(self, v: bool) -> Self
pub fn all_required(self, v: bool) -> Self
true=all keywords must be contained to score (default); false=any one scores
Trait Implementations§
Source§impl Evaluator for ContainsKeyword
impl Evaluator for ContainsKeyword
Source§fn eval<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_input: &'life1 str,
prediction: &'life2 str,
_reference: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Score, EvalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn eval<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_input: &'life1 str,
prediction: &'life2 str,
_reference: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Score, EvalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Scores a single prediction
Auto Trait Implementations§
impl Freeze for ContainsKeyword
impl RefUnwindSafe for ContainsKeyword
impl Send for ContainsKeyword
impl Sync for ContainsKeyword
impl Unpin for ContainsKeyword
impl UnsafeUnpin for ContainsKeyword
impl UnwindSafe for ContainsKeyword
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