pub struct GraphQueryExpander { /* private fields */ }Expand description
Graph-based query expander
Implementations§
Source§impl GraphQueryExpander
impl GraphQueryExpander
Sourcepub fn new(graph: KnowledgeGraph, config: ExpansionConfig) -> Self
pub fn new(graph: KnowledgeGraph, config: ExpansionConfig) -> Self
Create a new graph query expander
Sourcepub async fn update_graph(&mut self, graph: KnowledgeGraph)
pub async fn update_graph(&mut self, graph: KnowledgeGraph)
Update the knowledge graph
Trait Implementations§
Source§impl QueryExpander for GraphQueryExpander
impl QueryExpander for GraphQueryExpander
Source§fn expand_query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
options: &'life2 ExpansionOptions,
) -> Pin<Box<dyn Future<Output = RragResult<ExpansionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn expand_query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
options: &'life2 ExpansionOptions,
) -> Pin<Box<dyn Future<Output = RragResult<ExpansionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Expand a text query using the knowledge graph
Source§fn expand_terms<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
terms: &'life1 [String],
options: &'life2 ExpansionOptions,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn expand_terms<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
terms: &'life1 [String],
options: &'life2 ExpansionOptions,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Expand query terms using graph structure
Find related entities for query expansion
Source§fn get_suggestions<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
max_suggestions: usize,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_suggestions<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
max_suggestions: usize,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get expansion suggestions for a query
Auto Trait Implementations§
impl !Freeze for GraphQueryExpander
impl !RefUnwindSafe for GraphQueryExpander
impl Send for GraphQueryExpander
impl Sync for GraphQueryExpander
impl Unpin for GraphQueryExpander
impl !UnwindSafe for GraphQueryExpander
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