pub struct BackendRegistry { /* private fields */ }Expand description
Registry for NER backends to evaluate.
Implementations§
Source§impl BackendRegistry
impl BackendRegistry
Sourcepub fn register(
&mut self,
name: impl Into<String>,
description: impl Into<String>,
model: Box<dyn Model>,
)
pub fn register( &mut self, name: impl Into<String>, description: impl Into<String>, model: Box<dyn Model>, )
Register a backend for evaluation.
Sourcepub fn register_defaults(&mut self)
pub fn register_defaults(&mut self)
Register default zero-dependency backends.
Sourcepub fn register_onnx(&mut self)
pub fn register_onnx(&mut self)
Register ONNX backends if feature enabled.
Sourcepub fn register_candle(&mut self)
pub fn register_candle(&mut self)
Register Candle backends if feature enabled.
Sourcepub fn register_gliner_multitask(&mut self, model_id: &str)
pub fn register_gliner_multitask(&mut self, model_id: &str)
Register GLiNER multi-task model.
Loads knowledgator/gliner-multitask-large-v0.5 (Stepanov & Shtopko 2024,
arXiv:2406.12925), which extends GLiNER v1 to multiple tasks via task-conditioned
label prompts:
- Zero-shot NER with arbitrary entity types
- Text classification (single/multi-label)
- Hierarchical structure extraction
Note: this is NOT the fastino-ai GLiNER2 architecture (Zaratiana et al. 2025,
arXiv:2507.18546). fastino/gliner2-* models will not load through this backend
(different special tokens, different head structure). See issue #17.
Requires either onnx or candle feature.
Sourcepub fn register_gliner_multitask_default(&mut self)
pub fn register_gliner_multitask_default(&mut self)
Register GLiNER multi-task with the default model
(onnx-community/gliner-multitask-large-v0.5).
Sourcepub fn register_stack(
&mut self,
name: impl Into<String>,
layer_names: &[&str],
strategy: ConflictStrategy,
)
pub fn register_stack( &mut self, name: impl Into<String>, layer_names: &[&str], strategy: ConflictStrategy, )
Register a custom stacked combination of backends.
§Example
use anno_eval::eval::harness::BackendRegistry;
use anno::backends::stacked::ConflictStrategy;
let mut registry = BackendRegistry::new();
registry.register_stack(
"custom_stack",
&["RegexNER", "HeuristicNER"],
ConflictStrategy::HighestConf,
);Sourcepub fn register_all_combinations(&mut self)
pub fn register_all_combinations(&mut self)
Register all possible combinations of base backends.
This creates:
- Individual backends (RegexNER, HeuristicNER)
- Two-layer stacks (Pattern->Heuristic, Heuristic->Pattern)
- Different conflict strategies
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BackendRegistry
impl !UnwindSafe for BackendRegistry
impl Freeze for BackendRegistry
impl Send for BackendRegistry
impl Sync for BackendRegistry
impl Unpin for BackendRegistry
impl UnsafeUnpin for BackendRegistry
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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>
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>
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