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§
Sourcefn native_locales(&self) -> &[LocaleTag]
fn native_locales(&self) -> &[LocaleTag]
Locales this backend natively supports.
Sourcefn infer(
&self,
input: ModelInput,
hints: ModelHints,
) -> Result<Vec<ModelSpan>, ModelError>
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§
impl LocaleAwareModel for KijiDistilbertSafetyNet
Available on crate features
safety-net-kiji and safety-net only.impl LocaleAwareModel for OpenAiFilterSafetyNet
Available on crate features
safety-net-openai and safety-net only.