Skip to content

Commit b5973e4

Browse files
committed
restric import
1 parent fc1a992 commit b5973e4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ads/opctl/operator/lowcode/pii/model/factory.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ class SpacyDetector(PiiBaseDetector):
4141
@runtime_dependency(module="scrubadub", install_from=OptionalDependency.PII)
4242
@runtime_dependency(module="scrubadub_spacy", install_from=OptionalDependency.PII)
4343
def construct(cls, entity, model, **kwargs):
44-
import scrubadub
44+
from scrubadub.filth import Filth
4545
from scrubadub_spacy.detectors.spacy import SpacyEntityDetector
46+
4647
spacy_entity_detector = SpacyEntityDetector(
4748
named_entities=[entity],
4849
name=f"spacy_{uuid.uuid4()}",
@@ -51,7 +52,7 @@ def construct(cls, entity, model, **kwargs):
5152
if entity.upper() not in cls.DEFAULT_SPACY_NAMED_ENTITIES:
5253
filth_cls = type(
5354
construct_filth_cls_name(entity),
54-
(scrubadub.filth.Filth,),
55+
(Filth,),
5556
{"type": entity.upper()},
5657
)
5758
spacy_entity_detector.filth_cls_map[entity.upper()] = filth_cls

0 commit comments

Comments
 (0)