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.
Implementors§
impl LocaleAwareModel for KijiDistilbertSafetyNet
Available on crate features
safety-net and safety-net-kiji only.impl LocaleAwareModel for OpenAiFilterSafetyNet
Available on crate features
safety-net and safety-net-openai only.