pub struct FallbackExtractor<P, S> {
pub primary: P,
pub secondary: S,
}Expand description
Two-stage extractor: secondary runs only when primary.extract
succeeds with an empty Vec. Errors from primary propagate
unchanged — secondary is a recall-extension fallback, not an
error-handling retry path.
Default M2 wiring (Task 2.4.6): BuiltinExtractor → LlmEntityExtractor.
The cheap regex primary handles known typed-prefix IDs synchronously;
the LLM secondary only fires on truly free-form text.
Fields§
§primary: PFirst-pass extractor — usually a cheap, deterministic recogniser.
secondary: SRecall-extension extractor — runs only when primary returned Ok(vec![]).
Implementations§
Source§impl<P, S> FallbackExtractor<P, S>
impl<P, S> FallbackExtractor<P, S>
Trait Implementations§
Source§impl<P, S> EntityExtractor for FallbackExtractor<P, S>where
P: EntityExtractor,
S: EntityExtractor,
impl<P, S> EntityExtractor for FallbackExtractor<P, S>where
P: EntityExtractor,
S: EntityExtractor,
Source§fn extract<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
hints: &'life2 [EntityRef],
) -> Pin<Box<dyn Future<Output = Result<Vec<EntityRef>, MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn extract<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
hints: &'life2 [EntityRef],
) -> Pin<Box<dyn Future<Output = Result<Vec<EntityRef>, MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl<P, S> Freeze for FallbackExtractor<P, S>
impl<P, S> RefUnwindSafe for FallbackExtractor<P, S>where
P: RefUnwindSafe,
S: RefUnwindSafe,
impl<P, S> Send for FallbackExtractor<P, S>
impl<P, S> Sync for FallbackExtractor<P, S>
impl<P, S> Unpin for FallbackExtractor<P, S>
impl<P, S> UnsafeUnpin for FallbackExtractor<P, S>where
P: UnsafeUnpin,
S: UnsafeUnpin,
impl<P, S> UnwindSafe for FallbackExtractor<P, S>where
P: UnwindSafe,
S: UnwindSafe,
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