Skip to main content

EntityExtractor

Trait EntityExtractor 

Source
pub trait EntityExtractor {
    type Entity;
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn extract(&self, text: &str) -> Result<Vec<Self::Entity>>;
    fn extract_with_confidence(
        &self,
        text: &str,
    ) -> Result<Vec<(Self::Entity, f32)>>;
    fn set_confidence_threshold(&mut self, threshold: f32);
}
Expand description

Entity extraction abstraction for identifying entities in text

§Synchronous Version

This trait provides synchronous operations for entity extraction.

Required Associated Types§

Source

type Entity

The entity type this extractor produces

Source

type Error: Error + Send + Sync + 'static

The error type returned by extraction operations

Required Methods§

Source

fn extract(&self, text: &str) -> Result<Vec<Self::Entity>>

Extract entities from text

Source

fn extract_with_confidence( &self, text: &str, ) -> Result<Vec<(Self::Entity, f32)>>

Extract entities with confidence scores

Source

fn set_confidence_threshold(&mut self, threshold: f32)

Set minimum confidence threshold

Implementors§