pub struct ChainFeatures {Show 18 fields
pub canonical_form: String,
pub variations: Vec<String>,
pub chain_length: usize,
pub entity_type: Option<String>,
pub first_mention_position: usize,
pub last_mention_position: usize,
pub mention_spread: usize,
pub relative_spread: f64,
pub named_count: usize,
pub nominal_count: usize,
pub pronominal_count: usize,
pub pronoun_ratio: f64,
pub mean_position: f64,
pub positional_entropy: f64,
pub mean_confidence: f64,
pub min_confidence: f64,
pub max_confidence: f64,
pub centroid_embedding: Option<Vec<f32>>,
}Expand description
Aggregate features for a coreference chain (group of mentions referring to same entity).
Fields§
§canonical_form: StringCanonical/representative surface form.
variations: Vec<String>All surface form variations observed.
chain_length: usizeNumber of mentions in the chain.
entity_type: Option<String>Entity type (from first/canonical mention).
first_mention_position: usizePosition of first mention (character offset).
last_mention_position: usizePosition of last mention (character offset).
mention_spread: usizeSpread: distance from first to last mention.
relative_spread: f64Spread as fraction of document length.
named_count: usizeCount of named mentions.
nominal_count: usizeCount of nominal mentions.
pronominal_count: usizeCount of pronominal mentions.
pronoun_ratio: f64Fraction of mentions that are pronominal.
mean_position: f64Mean position of mentions.
positional_entropy: f64Positional entropy (how spread out are mentions?).
mean_confidence: f64Mean confidence across mentions.
min_confidence: f64Min confidence.
max_confidence: f64Max confidence.
centroid_embedding: Option<Vec<f32>>Centroid embedding (mean of mention embeddings, if available).
Implementations§
Source§impl ChainFeatures
impl ChainFeatures
Sourcepub fn from_mentions(mentions: &[&Entity], text_len: usize) -> Self
pub fn from_mentions(mentions: &[&Entity], text_len: usize) -> Self
Compute chain features from a group of related entity mentions.
Sourcepub fn with_centroid(self, embedding: Vec<f32>) -> Self
pub fn with_centroid(self, embedding: Vec<f32>) -> Self
Set the centroid embedding.
Sourcepub fn is_singleton(&self) -> bool
pub fn is_singleton(&self) -> bool
Is this a singleton chain (single mention)?
Sourcepub fn is_mostly_pronominal(&self) -> bool
pub fn is_mostly_pronominal(&self) -> bool
Is this chain mostly pronominal?
Sourcepub fn variation_count(&self) -> usize
pub fn variation_count(&self) -> usize
Number of unique surface form variations.
Trait Implementations§
Source§impl Clone for ChainFeatures
impl Clone for ChainFeatures
Source§fn clone(&self) -> ChainFeatures
fn clone(&self) -> ChainFeatures
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ChainFeatures
impl RefUnwindSafe for ChainFeatures
impl Send for ChainFeatures
impl Sync for ChainFeatures
impl Unpin for ChainFeatures
impl UnsafeUnpin for ChainFeatures
impl UnwindSafe for ChainFeatures
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,
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