Skip to main content

Metric

Trait Metric 

Source
pub trait Metric:
    Send
    + Sync
    + 'static {
    // Required methods
    fn name(&self) -> &'static str;
    fn score(
        &self,
        input: &str,
        actual_output: &str,
        expected_keywords: &[&str],
    ) -> f64;
}
Expand description

Trait for evaluation metrics.

Required Methods§

Source

fn name(&self) -> &'static str

Metric name.

Source

fn score( &self, input: &str, actual_output: &str, expected_keywords: &[&str], ) -> f64

Score the actual output against the expected criteria.

Returns a score from 0.0 (worst) to 1.0 (best).

Implementors§