Skip to main content

LocaleAwareModel

Trait LocaleAwareModel 

Source
pub trait LocaleAwareModel: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn native_locales(&self) -> &[LocaleTag];
    fn infer(
        &self,
        input: ModelInput,
        hints: ModelHints,
    ) -> Result<Vec<ModelSpan>, ModelError>;
}
Expand description

Locale-aware model backend for Pass-2 NER and Pass-3 safety-net inference.

Required Methods§

Source

fn name(&self) -> &str

Stable backend name used in diagnostics and audit trails.

Source

fn native_locales(&self) -> &[LocaleTag]

Locales this backend natively supports.

Source

fn infer( &self, input: ModelInput, hints: ModelHints, ) -> Result<Vec<ModelSpan>, ModelError>

Run inference for the supplied text and locale hints.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl LocaleAwareModel for KijiDistilbertSafetyNet

Available on crate features safety-net-kiji and safety-net only.
Source§

impl LocaleAwareModel for OpenAiFilterSafetyNet

Available on crate features safety-net-openai and safety-net only.