Skip to main content

StreamingResolver

Struct StreamingResolver 

Source
pub struct StreamingResolver { /* private fields */ }
Expand description

Streaming entity resolver using the Doubling Algorithm.

Implementations§

Source§

impl StreamingResolver

Source

pub fn new(config: StreamingConfig) -> Self

Create a new streaming resolver.

Source

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.

Source

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.

Source

pub fn clusters(&self) -> Vec<&EntityCluster>

Get all current clusters.

Source

pub fn get_cluster(&self, id: IdentityId) -> Option<&EntityCluster>

Get a cluster by ID.

Source

pub fn num_clusters(&self) -> usize

Get the number of clusters.

Source

pub fn num_mentions(&self) -> usize

Get the total number of mentions processed.

Source

pub fn merge_clusters(&mut self)

Manually trigger cluster merging.

Source§

impl StreamingResolver

Source

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.

Source

pub fn add_track( &mut self, doc_id: impl Into<String>, track: &Track, ) -> IdentityId

Add entities from a Track.

Convenience method that extracts relevant information from an anno_core::Track and adds it to the resolver.

Trait Implementations§

Source§

impl Debug for StreamingResolver

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StreamingResolver

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V