pub struct NERAggregateMetrics {Show 18 fields
pub precision: MetricValue,
pub recall: MetricValue,
pub f1: MetricValue,
pub macro_precision: MetricValue,
pub macro_recall: MetricValue,
pub macro_f1: MetricValue,
pub precision_std: f64,
pub recall_std: f64,
pub f1_std: f64,
pub precision_ci_95: Option<(f64, f64)>,
pub recall_ci_95: Option<(f64, f64)>,
pub f1_ci_95: Option<(f64, f64)>,
pub per_type: HashMap<String, TypeMetrics>,
pub tokens_per_second: f64,
pub num_test_cases: usize,
pub total_found: usize,
pub total_expected: usize,
pub total_correct: usize,
}Expand description
Aggregated NER evaluation metrics with statistical measures.
Provides mean, standard deviation, and confidence intervals for comprehensive analysis.
§Micro vs Macro Averaging
By default, we compute micro-averaged metrics (total_correct / total_found), which is the standard for NER evaluation and matches seqeval’s default.
Macro-averaging (average of per-case metrics) can inflate scores when test cases have different sizes. A test case with 1 entity getting 100% F1 shouldn’t boost overall metrics as much as a case with 100 entities getting 50% F1.
Fields§
§precision: MetricValueMicro-averaged precision (total_correct / total_found)
recall: MetricValueMicro-averaged recall (total_correct / total_expected)
f1: MetricValueMicro-averaged F1 score
macro_precision: MetricValueMacro-averaged precision (for comparison)
macro_recall: MetricValueMacro-averaged recall (for comparison)
macro_f1: MetricValueMacro-averaged F1 (for comparison)
precision_std: f64Precision standard deviation (of per-case metrics)
recall_std: f64Recall standard deviation (of per-case metrics)
f1_std: f64F1 standard deviation (of per-case metrics)
precision_ci_95: Option<(f64, f64)>Precision 95% confidence interval (lower, upper)
recall_ci_95: Option<(f64, f64)>Recall 95% confidence interval (lower, upper)
f1_ci_95: Option<(f64, f64)>F1 95% confidence interval (lower, upper)
per_type: HashMap<String, TypeMetrics>Per-entity-type aggregated metrics (micro-averaged)
tokens_per_second: f64Mean tokens per second
num_test_cases: usizeNumber of test cases evaluated
total_found: usizeTotal entities found
total_expected: usizeTotal entities expected
total_correct: usizeTotal correct predictions
Trait Implementations§
Source§impl Clone for NERAggregateMetrics
impl Clone for NERAggregateMetrics
Source§fn clone(&self) -> NERAggregateMetrics
fn clone(&self) -> NERAggregateMetrics
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NERAggregateMetrics
impl Debug for NERAggregateMetrics
Source§impl<'de> Deserialize<'de> for NERAggregateMetrics
impl<'de> Deserialize<'de> for NERAggregateMetrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for NERAggregateMetrics
impl RefUnwindSafe for NERAggregateMetrics
impl Send for NERAggregateMetrics
impl Sync for NERAggregateMetrics
impl Unpin for NERAggregateMetrics
impl UnsafeUnpin for NERAggregateMetrics
impl UnwindSafe for NERAggregateMetrics
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more