pub enum ScriptedNliClassifier {
Fifo {
verdicts: Mutex<Vec<Result<NliResult, ProviderError>>>,
calls: Mutex<Vec<(String, String)>>,
},
Match {
resolver: Box<dyn Fn(&str, &str) -> Result<NliResult, ProviderError> + Send + Sync>,
calls: Mutex<Vec<(String, String)>>,
},
}Expand description
Scripted NLI classifier with two modes:
ScriptedNliClassifier::new(FIFO): each call pops the next verdict from the queue. Use when the test controls call order.ScriptedNliClassifier::matching(Match): each call dispatches to the supplied closure. Use when pending iteration order is not deterministic (HashMaporder) and the test keys verdicts on the candidate text.
Both modes record every (premise, hypothesis) pair so tests can assert on the exact set of pairs the use case asked about.
Variants§
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ScriptedNliClassifier
impl !RefUnwindSafe for ScriptedNliClassifier
impl !UnwindSafe for ScriptedNliClassifier
impl Send for ScriptedNliClassifier
impl Sync for ScriptedNliClassifier
impl Unpin for ScriptedNliClassifier
impl UnsafeUnpin for ScriptedNliClassifier
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