Skip to content

factory

factory

Classes:

Name Description
PredictorFilter

Used to filter predictors that should be included in the NER.

NERFactory
NERBundle

Bundle that contains all of the NER-related information that the code running NER may need.

PredictorFilter

Bases: ABC

Used to filter predictors that should be included in the NER.

NERFactory(custom_predictors=None, *, parallel=True, use_nlp=False, regex_only=False, ner_max_runtime_seconds=None)

Bases: NERFactoryBase

Source code in src/nemo_safe_synthesizer/pii_replacer/ner/factory.py
def __init__(
    self,
    custom_predictors: Optional[list[Predictor]] = None,
    *,
    parallel: bool = True,
    use_nlp: bool = False,
    regex_only: bool = False,
    ner_max_runtime_seconds: int = None,
):
    if custom_predictors is None:
        custom_predictors = []

    self._custom_predictors = custom_predictors
    self._parallel = parallel
    self._ner_pipeline_type = NERPipelineType.from_flags(use_nlp=use_nlp, regex_only=regex_only)
    self._ner_max_runtime_seconds = ner_max_runtime_seconds

NERBundle(factory=NERFactory(), custom_labels=list(), field_label_condition=FieldLabelCondition()) dataclass

Bundle that contains all of the NER-related information that the code running NER may need.