Skip to main content

RelationshipExtractor

Trait RelationshipExtractor 

Source
pub trait RelationshipExtractor: Send + Sync {
    // Required methods
    fn extract<'life0, 'life1, 'async_trait>(
        &'life0 self,
        chunk: &'life1 KnowledgeChunk,
    ) -> Pin<Box<dyn Future<Output = Result<ExtractionResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn extract_from_text<'life0, 'life1, 'async_trait>(
        &'life0 self,
        text: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<ExtractionResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn name(&self) -> &'static str;
}
Expand description

Strategy for extracting entities and relationships from text.

Required Methods§

Source

fn extract<'life0, 'life1, 'async_trait>( &'life0 self, chunk: &'life1 KnowledgeChunk, ) -> Pin<Box<dyn Future<Output = Result<ExtractionResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Extract entities and relationships from a knowledge chunk.

Source

fn extract_from_text<'life0, 'life1, 'async_trait>( &'life0 self, text: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<ExtractionResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Extract from raw text (convenience method).

Source

fn name(&self) -> &'static str

Get the name of this extraction strategy.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§