pub struct ExtractionPipeline { /* private fields */ }Expand description
The extraction pipeline orchestrates NER, relation extraction, and temporal parsing.
Created once and reused across multiple episodes. Model loading happens at construction time (~100-500ms), but subsequent inference calls are fast (<15ms).
Implementations§
Source§impl ExtractionPipeline
impl ExtractionPipeline
Sourcepub fn new(
schema: ExtractionSchema,
models_dir: &Path,
confidence_threshold: f64,
) -> Result<Self, PipelineError>
pub fn new( schema: ExtractionSchema, models_dir: &Path, confidence_threshold: f64, ) -> Result<Self, PipelineError>
Create a new extraction pipeline.
schema: Entity/relation type definitions.models_dir: Directory containing ONNX model files.confidence_threshold: Minimum confidence to keep an extraction (default: 0.5).
Sourcepub fn with_defaults(models_dir: &Path) -> Result<Self, PipelineError>
pub fn with_defaults(models_dir: &Path) -> Result<Self, PipelineError>
Create a pipeline with default settings.
Uses ExtractionSchema::default() and 0.5 confidence threshold.
Sourcepub fn extract(
&self,
text: &str,
reference_time: DateTime<Utc>,
) -> Result<ExtractionResult, PipelineError>
pub fn extract( &self, text: &str, reference_time: DateTime<Utc>, ) -> Result<ExtractionResult, PipelineError>
Extract entities, relations, and temporal expressions from text.
Sourcepub fn schema(&self) -> &ExtractionSchema
pub fn schema(&self) -> &ExtractionSchema
Get the schema used by this pipeline.
Sourcepub fn confidence_threshold(&self) -> f64
pub fn confidence_threshold(&self) -> f64
Get the confidence threshold.
Auto Trait Implementations§
impl !Freeze for ExtractionPipeline
impl !RefUnwindSafe for ExtractionPipeline
impl Send for ExtractionPipeline
impl Sync for ExtractionPipeline
impl Unpin for ExtractionPipeline
impl UnsafeUnpin for ExtractionPipeline
impl !UnwindSafe for ExtractionPipeline
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