pub struct EntityCluster {
pub id: IdentityId,
pub canonical_name: String,
pub entity_type: Option<TypeLabel>,
pub mentions: Vec<EntityMention>,
pub centroid: Option<Vec<f32>>,
pub confidence: f32,
}Expand description
A cluster of entity mentions.
Fields§
§id: IdentityIdCluster ID
canonical_name: StringCanonical name (best representative)
entity_type: Option<TypeLabel>Entity type (consensus)
mentions: Vec<EntityMention>All mentions in this cluster
centroid: Option<Vec<f32>>Centroid embedding (if embeddings are available)
confidence: f32Confidence score
Implementations§
Source§impl EntityCluster
impl EntityCluster
Sourcepub fn document_ids(&self) -> Vec<&str>
pub fn document_ids(&self) -> Vec<&str>
Get all unique document IDs in this cluster.
Sourcepub fn has_temporal_bounds(&self) -> bool
pub fn has_temporal_bounds(&self) -> bool
Check if any mention in this cluster has temporal bounds.
Sourcepub fn temporal_bounds(&self) -> (Option<DateTime<Utc>>, Option<DateTime<Utc>>)
pub fn temporal_bounds(&self) -> (Option<DateTime<Utc>>, Option<DateTime<Utc>>)
Get the aggregate temporal bounds for this cluster.
Returns the widest time span that includes all mentions:
valid_from: Earliestvalid_fromamong mentionsvalid_until: Latestvalid_untilamong mentions
Returns (None, None) if no mentions have temporal bounds.
Sourcepub fn observation_times(&self) -> Vec<DateTime<Utc>>
pub fn observation_times(&self) -> Vec<DateTime<Utc>>
Get all unique timestamps when mentions were observed.
Useful for tracking entity evolution over time.
Source§impl EntityCluster
impl EntityCluster
Sourcepub fn to_identity(&self) -> Identity
pub fn to_identity(&self) -> Identity
Convert this cluster to an anno_core::Identity.
Creates a global Identity from the cluster’s contents.
The source is set to CrossDocCoref with TrackRefs for all mentions
that have track_id set.
Trait Implementations§
Source§impl Clone for EntityCluster
impl Clone for EntityCluster
Source§fn clone(&self) -> EntityCluster
fn clone(&self) -> EntityCluster
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EntityCluster
impl RefUnwindSafe for EntityCluster
impl Send for EntityCluster
impl Sync for EntityCluster
impl Unpin for EntityCluster
impl UnsafeUnpin for EntityCluster
impl UnwindSafe for EntityCluster
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