pub struct SemanticEntityMerger { /* private fields */ }Expand description
Entity merger using semantic similarity and optional LLM
Implementations§
Source§impl SemanticEntityMerger
impl SemanticEntityMerger
Sourcepub fn with_llm_client(self, client: OllamaClient) -> Self
pub fn with_llm_client(self, client: OllamaClient) -> Self
Add an LLM client for intelligent merging
Sourcepub fn with_max_tokens(self, max_tokens: usize) -> Self
pub fn with_max_tokens(self, max_tokens: usize) -> Self
Set maximum tokens for entity descriptions
Sourcepub async fn group_similar_entities(
&self,
entities: &[Entity],
) -> Result<Vec<Vec<Entity>>>
pub async fn group_similar_entities( &self, entities: &[Entity], ) -> Result<Vec<Vec<Entity>>>
Group entities by semantic similarity for potential merging
Sourcepub async fn decide_merge(
&self,
entity_group: &[Entity],
) -> Result<EntityMergeDecision>
pub async fn decide_merge( &self, entity_group: &[Entity], ) -> Result<EntityMergeDecision>
Use LLM to decide if entities should be merged and how
Sourcepub fn merge_entities(
&self,
entities: Vec<Entity>,
decision: &EntityMergeDecision,
) -> Result<Entity>
pub fn merge_entities( &self, entities: Vec<Entity>, decision: &EntityMergeDecision, ) -> Result<Entity>
Perform the actual entity merging based on decision
Sourcepub fn get_statistics(&self) -> MergingStatistics
pub fn get_statistics(&self) -> MergingStatistics
Get merging statistics
Trait Implementations§
Source§impl Clone for SemanticEntityMerger
impl Clone for SemanticEntityMerger
Source§fn clone(&self) -> SemanticEntityMerger
fn clone(&self) -> SemanticEntityMerger
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 SemanticEntityMerger
impl !RefUnwindSafe for SemanticEntityMerger
impl Send for SemanticEntityMerger
impl Sync for SemanticEntityMerger
impl Unpin for SemanticEntityMerger
impl UnsafeUnpin for SemanticEntityMerger
impl !UnwindSafe for SemanticEntityMerger
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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