pub struct EntityMemory { /* private fields */ }Expand description
Entity memory for incremental coreference.
Stores active clusters and handles eviction based on memory policy.
Implementations§
Source§impl EntityMemory
impl EntityMemory
Sourcepub fn new(policy: MemoryPolicy) -> Self
pub fn new(policy: MemoryPolicy) -> Self
Create a new entity memory with the given policy.
Sourcepub fn find_best_match(
&self,
mention_text: &str,
mention_type: MentionType,
similarity_threshold: f64,
use_exact_match: bool,
use_substring_match: bool,
) -> Option<u64>
pub fn find_best_match( &self, mention_text: &str, mention_type: MentionType, similarity_threshold: f64, use_exact_match: bool, use_substring_match: bool, ) -> Option<u64>
Find the best matching cluster for a mention.
Sourcepub fn advance_window(&mut self)
pub fn advance_window(&mut self)
Advance to next window.
Sourcepub fn to_chains(&self) -> Vec<CorefChain>
pub fn to_chains(&self) -> Vec<CorefChain>
Get all clusters as coreference chains.
Sourcepub fn cluster_count(&self) -> usize
pub fn cluster_count(&self) -> usize
Get number of active clusters.
Sourcepub fn mention_count(&self) -> usize
pub fn mention_count(&self) -> usize
Get total mention count across all clusters.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EntityMemory
impl RefUnwindSafe for EntityMemory
impl Send for EntityMemory
impl Sync for EntityMemory
impl Unpin for EntityMemory
impl UnsafeUnpin for EntityMemory
impl UnwindSafe for EntityMemory
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
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>
Converts
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>
Converts
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