pub struct GraphBuilder { /* private fields */ }Expand description
Graph builder for constructing knowledge graphs from documents
Implementations§
Source§impl GraphBuilder
impl GraphBuilder
Sourcepub fn new(
chunk_size: usize,
chunk_overlap: usize,
min_confidence: f32,
similarity_threshold: f32,
max_connections: usize,
) -> Result<Self>
pub fn new( chunk_size: usize, chunk_overlap: usize, min_confidence: f32, similarity_threshold: f32, max_connections: usize, ) -> Result<Self>
Create a new graph builder
Sourcepub fn build_graph(
&mut self,
documents: Vec<Document>,
) -> Result<KnowledgeGraph>
pub fn build_graph( &mut self, documents: Vec<Document>, ) -> Result<KnowledgeGraph>
Build a knowledge graph from a collection of documents
Sourcepub fn add_entity_embeddings(
&mut self,
graph: &mut KnowledgeGraph,
embedding_fn: impl Fn(&str) -> Result<Vec<f32>>,
) -> Result<()>
pub fn add_entity_embeddings( &mut self, graph: &mut KnowledgeGraph, embedding_fn: impl Fn(&str) -> Result<Vec<f32>>, ) -> Result<()>
Add embeddings to entities
Sourcepub fn analyze_graph(&self, graph: &KnowledgeGraph) -> GraphStatistics
pub fn analyze_graph(&self, graph: &KnowledgeGraph) -> GraphStatistics
Analyze graph statistics
Auto Trait Implementations§
impl Freeze for GraphBuilder
impl RefUnwindSafe for GraphBuilder
impl Send for GraphBuilder
impl Sync for GraphBuilder
impl Unpin for GraphBuilder
impl UnsafeUnpin for GraphBuilder
impl UnwindSafe for GraphBuilder
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> 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