pub struct CDCRResolver { /* private fields */ }Expand description
Cross-Document Coreference Resolver.
Clusters entity mentions across multiple documents into unified clusters representing the same real-world entities.
§Algorithm
- Blocking (LSH): Generate candidate pairs from all mentions
- Comparison: Compute similarity for candidate pairs (uses ClusterEncoder if available)
- Clustering: Agglomerative clustering with single-link
§Scalability
With LSH blocking, CDCR scales to millions of mentions:
- Without blocking: O(n²) comparisons
- With blocking: O(n × average_block_size)
§Cluster Encoder Integration
When a ClusterEncoder is provided in the config, CDCR uses learned
cluster embeddings for similarity scoring instead of string similarity.
This enables more accurate cross-document linking based on semantic
similarity rather than surface form matching.
Implementations§
Source§impl CDCRResolver
impl CDCRResolver
Sourcepub fn with_config(config: CDCRConfig) -> Self
pub fn with_config(config: CDCRConfig) -> Self
Create with configuration.
Sourcepub fn with_cluster_encoder(self, encoder: Arc<dyn ClusterEncoder>) -> Self
pub fn with_cluster_encoder(self, encoder: Arc<dyn ClusterEncoder>) -> Self
Set cluster encoder for learned similarity scoring.
When a cluster encoder is provided, CDCR will use learned embeddings for similarity computation instead of string similarity. This enables more accurate cross-document entity linking.
Sourcepub fn resolve(&self, documents: &[Document]) -> Vec<CrossDocCluster>
pub fn resolve(&self, documents: &[Document]) -> Vec<CrossDocCluster>
Resolve cross-document coreference.
Trait Implementations§
Source§impl Clone for CDCRResolver
impl Clone for CDCRResolver
Source§fn clone(&self) -> CDCRResolver
fn clone(&self) -> CDCRResolver
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 CDCRResolver
impl Debug for CDCRResolver
Source§impl Default for CDCRResolver
impl Default for CDCRResolver
Source§fn default() -> CDCRResolver
fn default() -> CDCRResolver
Auto Trait Implementations§
impl !RefUnwindSafe for CDCRResolver
impl !UnwindSafe for CDCRResolver
impl Freeze for CDCRResolver
impl Send for CDCRResolver
impl Sync for CDCRResolver
impl Unpin for CDCRResolver
impl UnsafeUnpin for CDCRResolver
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> 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 more