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§
Required Methods§
Sourcefn extract_with_confidence(
&self,
text: &str,
) -> Result<Vec<(Self::Entity, f32)>>
fn extract_with_confidence( &self, text: &str, ) -> Result<Vec<(Self::Entity, f32)>>
Extract entities with confidence scores
Sourcefn set_confidence_threshold(&mut self, threshold: f32)
fn set_confidence_threshold(&mut self, threshold: f32)
Set minimum confidence threshold