pub struct CorefEvaluation {
pub muc: CorefScores,
pub b_cubed: CorefScores,
pub ceaf_e: CorefScores,
pub ceaf_m: CorefScores,
pub lea: CorefScores,
pub blanc: CorefScores,
pub conll_f1: f64,
pub chain_stats: Option<CorefChainStats>,
pub zero_anaphor: Option<ZeroAnaphorEvaluation>,
}Expand description
Complete coreference evaluation results.
Fields§
§muc: CorefScoresMUC metric.
b_cubed: CorefScoresB³ metric.
ceaf_e: CorefScoresCEAF entity-based (phi4).
ceaf_m: CorefScoresCEAF mention-based (phi3).
lea: CorefScoresLEA metric.
blanc: CorefScoresBLANC metric.
conll_f1: f64CoNLL F1 (average of MUC, B³, CEAFe).
chain_stats: Option<CorefChainStats>Chain-length stratified diagnostics.
zero_anaphor: Option<ZeroAnaphorEvaluation>Zero-anaphor (empty-node) evaluation, if zeros are present.
Implementations§
Source§impl CorefEvaluation
impl CorefEvaluation
Sourcepub fn compute(predicted: &[CorefChain], gold: &[CorefChain]) -> CorefEvaluation
pub fn compute(predicted: &[CorefChain], gold: &[CorefChain]) -> CorefEvaluation
Compute the full metric bundle.
use anno::core::coref::{CorefChain, Mention};
use anno::metrics::coref_metrics::CorefEvaluation;
let gold = vec![CorefChain::new(vec![
Mention::new("John", 0, 4),
Mention::new("he", 10, 12),
])];
let eval = CorefEvaluation::compute(&gold, &gold);
assert!((eval.conll_f1 - 1.0).abs() < 1e-9);
assert!((eval.muc.f1 - 1.0).abs() < 1e-9);Sourcepub fn compute_without_singletons(
predicted: &[CorefChain],
gold: &[CorefChain],
) -> CorefEvaluation
pub fn compute_without_singletons( predicted: &[CorefChain], gold: &[CorefChain], ) -> CorefEvaluation
Compute the full metric bundle with singletons excluded.
CRAC 2022-2025 shared tasks use this as the primary scoring mode: chains with only one mention are removed from both predicted and gold before computing B3, CEAF, LEA, and CoNLL scores.
Scores typically differ from the singleton-included variant because singletons inflate B3 precision/recall when correctly matched but contribute no signal to MUC (which already ignores them).
use anno::core::coref::{CorefChain, Mention};
use anno::metrics::coref_metrics::CorefEvaluation;
let gold = vec![
CorefChain::new(vec![
Mention::new("John", 0, 4),
Mention::new("he", 10, 12),
]),
CorefChain::singleton(Mention::new("Paris", 20, 25)),
];
let with = CorefEvaluation::compute(&gold, &gold);
let without = CorefEvaluation::compute_without_singletons(&gold, &gold);
// B3 F1 is 1.0 either way for identical input, but the chain_stats differ.
assert!(with.chain_stats.as_ref().unwrap().singleton_count == 1);
assert!(without.chain_stats.as_ref().unwrap().singleton_count == 0);Sourcepub fn all_f1_scores(&self) -> Vec<f64>
pub fn all_f1_scores(&self) -> Vec<f64>
Extract per-metric F1 scores.
Sourcepub fn average_f1(&self) -> f64
pub fn average_f1(&self) -> f64
Average F1 across all included metrics (diagnostic).
Sourcepub fn f1_std_dev(&self) -> f64
pub fn f1_std_dev(&self) -> f64
Standard deviation of F1 scores across metrics.
Trait Implementations§
Source§impl Clone for CorefEvaluation
impl Clone for CorefEvaluation
Source§fn clone(&self) -> CorefEvaluation
fn clone(&self) -> CorefEvaluation
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 CorefEvaluation
impl Debug for CorefEvaluation
Source§impl Default for CorefEvaluation
impl Default for CorefEvaluation
Source§fn default() -> CorefEvaluation
fn default() -> CorefEvaluation
Source§impl<'de> Deserialize<'de> for CorefEvaluation
impl<'de> Deserialize<'de> for CorefEvaluation
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CorefEvaluation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CorefEvaluation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for CorefEvaluation
impl Display for CorefEvaluation
Source§impl Serialize for CorefEvaluation
impl Serialize for CorefEvaluation
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for CorefEvaluation
impl RefUnwindSafe for CorefEvaluation
impl Send for CorefEvaluation
impl Sync for CorefEvaluation
impl Unpin for CorefEvaluation
impl UnsafeUnpin for CorefEvaluation
impl UnwindSafe for CorefEvaluation
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.