pub struct ContainsKeyword { /* private fields */ }Expand description
关键词包含评测器:检查预测是否包含指定关键词。
all_required = true(默认)需全部包含才得分;false 包含任一即得分。
Implementations§
Source§impl ContainsKeyword
impl ContainsKeyword
pub fn new(keywords: Vec<String>) -> Self
Sourcepub fn case_sensitive(self, v: bool) -> Self
pub fn case_sensitive(self, v: bool) -> Self
大小写敏感(默认不敏感)
Sourcepub fn all_required(self, v: bool) -> Self
pub fn all_required(self, v: bool) -> Self
true=全部包含才得分(默认);false=包含任一即得分
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,
对单条预测打分
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