pub struct EmbeddingSimilarity<E: Embeddings> { /* private fields */ }Expand description
嵌入相似度评测器:用预测与参考答案的嵌入向量余弦相似度打分。
Implementations§
Source§impl<E: Embeddings> EmbeddingSimilarity<E>
impl<E: Embeddings> EmbeddingSimilarity<E>
Trait Implementations§
Source§impl<E: Embeddings> Evaluator for EmbeddingSimilarity<E>
impl<E: Embeddings> Evaluator for EmbeddingSimilarity<E>
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<E> Freeze for EmbeddingSimilarity<E>where
E: Freeze,
impl<E> RefUnwindSafe for EmbeddingSimilarity<E>where
E: RefUnwindSafe,
impl<E> Send for EmbeddingSimilarity<E>
impl<E> Sync for EmbeddingSimilarity<E>
impl<E> Unpin for EmbeddingSimilarity<E>where
E: Unpin,
impl<E> UnsafeUnpin for EmbeddingSimilarity<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for EmbeddingSimilarity<E>where
E: UnwindSafe,
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