pub struct NerCfg {
pub enabled: bool,
pub model_path: String,
pub tokenizer_path: String,
pub labels: Vec<String>,
pub threshold: f32,
pub max_seq_len: usize,
}Expand description
ML NER settings ([llm.dlp.ner]). Off by default. When enabled, the proxy must be built with
--features ner; otherwise startup fails with a clear error rather than running regex-only while
the operator believes ML coverage is active. The model is an ONNX token-classification (BIO) NER
network run through the pure-Rust [edgeguard_ner] crate.
Fields§
§enabled: boolTurn the NER family on. Requires the ner feature.
model_path: StringPath to the ONNX model file.
tokenizer_path: StringPath to the HuggingFace tokenizer.json.
labels: Vec<String>Per-class label list in model id order (e.g. ["O","B-PER","I-PER","B-LOC", …]). Used to map
argmax class ids back to entity labels.
threshold: f32Confidence floor in [0.0, 1.0]; spans below it are dropped. Default 0.5.
max_seq_len: usizeMax tokens fed to the model per scan (longer inputs are truncated). Default 256.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NerCfg
impl<'de> Deserialize<'de> for NerCfg
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NerCfg
impl RefUnwindSafe for NerCfg
impl Send for NerCfg
impl Sync for NerCfg
impl Unpin for NerCfg
impl UnsafeUnpin for NerCfg
impl UnwindSafe for NerCfg
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