pub struct StreamingResolver { /* private fields */ }Expand description
Streaming entity resolver using the Doubling Algorithm.
Implementations§
Source§impl StreamingResolver
impl StreamingResolver
Sourcepub fn new(config: StreamingConfig) -> Self
pub fn new(config: StreamingConfig) -> Self
Create a new streaming resolver.
Sourcepub fn add_mention(&mut self, mention: EntityMention) -> IdentityId
pub fn add_mention(&mut self, mention: EntityMention) -> IdentityId
Add an entity mention to the resolver.
This is the main entry point for streaming entity resolution. Returns the cluster ID that the mention was added to.
Sourcepub fn add_entity(
&mut self,
doc_id: impl Into<String>,
surface: impl Into<String>,
entity_type: Option<String>,
) -> IdentityId
pub fn add_entity( &mut self, doc_id: impl Into<String>, surface: impl Into<String>, entity_type: Option<String>, ) -> IdentityId
Add an entity with simple parameters.
Sourcepub fn clusters(&self) -> Vec<&EntityCluster>
pub fn clusters(&self) -> Vec<&EntityCluster>
Get all current clusters.
Sourcepub fn get_cluster(&self, id: IdentityId) -> Option<&EntityCluster>
pub fn get_cluster(&self, id: IdentityId) -> Option<&EntityCluster>
Get a cluster by ID.
Sourcepub fn num_clusters(&self) -> usize
pub fn num_clusters(&self) -> usize
Get the number of clusters.
Sourcepub fn num_mentions(&self) -> usize
pub fn num_mentions(&self) -> usize
Get the total number of mentions processed.
Sourcepub fn merge_clusters(&mut self)
pub fn merge_clusters(&mut self)
Manually trigger cluster merging.
Source§impl StreamingResolver
impl StreamingResolver
Sourcepub fn to_identities(&self) -> Vec<Identity>
pub fn to_identities(&self) -> Vec<Identity>
Convert all clusters to anno_core::Identity objects.
Returns a vector of Identities representing the current clustering state.
Useful for exporting streaming resolution results into the anno::core format.
Trait Implementations§
Source§impl Debug for StreamingResolver
impl Debug for StreamingResolver
Auto Trait Implementations§
impl Freeze for StreamingResolver
impl RefUnwindSafe for StreamingResolver
impl Send for StreamingResolver
impl Sync for StreamingResolver
impl Unpin for StreamingResolver
impl UnsafeUnpin for StreamingResolver
impl UnwindSafe for StreamingResolver
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