nemoguardrails.library.sensitive_data_detection.actions
nemoguardrails.library.sensitive_data_detection.actions
Module Contents
Classes
Functions
Data
API
Bases: ThreadPoolExecutor
Keep Presidio work out of the event loop’s shared thread pool.
Offload work with the caller’s context and standard future cancellation.
Create an analyzer with the installed spaCy model.
Helper to compute the ad hoc recognizers for a config.
Reuse one analyzer per threshold, including concurrent cold starts.
Checks whether the provided text contains any sensitive data.
Args source: The source for the text, i.e. “input”, “output”, “retrieval”. text: The text to check. config: The rails configuration object.
Returns RailOutcome.block() if sensitive data has been detected, RailOutcome.allow() otherwise.
Checks whether the provided text contains any sensitive data.
Args source: The source for the text, i.e. “input”, “output”, “retrieval”. text: The text to check. config: The rails configuration object.
Returns RailOutcome.transform() with the altered text if it changed, RailOutcome.allow() otherwise.