pii_llm_suspect_mapper¶
LLM audit (and optional redaction) for possibly missed PII.
Writes JSON to meta[result_key] (default MetaKeys.pii_llm_suspect).
Set redaction_mode to evidence or whole_field to also modify
inspect_keys string fields (and messages when listed). Place
after pii_redaction_mapper.
Use gate_mode="heuristic" to call the API only when cheap patterns
suggest residual risk (long digit runs, @, secret-like keywords, etc.).
Pre-LLM extensions (still no API cost unless you enable spaCy):
heuristic_name_rules(default True): contextual CJK / English name cues so person-heavy text is not skipped when the base heuristic fires only on digits and secrets.spacy_ner_models: optional list of spaCy pipeline names (e.g.["zh_core_web_sm", "en_core_web_sm"]) so one job loads both and runs NER on the same text prefix until aPERSON/PERhit.spacy_ner_model: legacy single name; merged afterspacy_ner_models(deduped). Install withpython -m spacy download <name>.spacy_auto_download(default True): if the pipeline is missing, run spaCy's downloader beforespacy.load(needs network, uses pip). Disable in air-gapped jobs or set envPII_SPACY_AUTO_DOWNLOAD=0.
针对可能遗漏的 PII 进行 LLM 审计(及可选的脱敏处理)。
将 JSON 写入 meta[result_key](默认为 MetaKeys.pii_llm_suspect)。将 redaction_mode 设置为 evidence 或 whole_field 以同时修改 inspect_keys 字符串字段(以及列出时的 messages)。请放置在 pii_redaction_mapper 之后。
使用 gate_mode="heuristic" 仅在低成本模式提示存在残余风险(长串数字、@、类似密钥的关键字等)时调用 API。
LLM 前扩展(除非启用 spaCy,否则仍无 API 成本):
heuristic_name_rules(默认 True):上下文 CJK / 英文姓名线索,确保当基础启发式规则仅因数字和密钥触发时,不会跳过包含大量人名的文本。spacy_ner_models:可选的 spaCy pipeline 名称列表(例如["zh_core_web_sm", "en_core_web_sm"]),以便单个任务同时加载两者,并在同一文本前缀上运行 NER,直到命中PERSON/PER。spacy_ner_model:旧版单一名称;在spacy_ner_models之后合并(去重)。使用python -m spacy download <name>安装。spacy_auto_download(默认 True):如果缺少 pipeline,则在spacy.load之前运行 spaCy 的下载器(需要网络,使用 pip)。在物理隔离的任务中禁用,或设置环境变量PII_SPACY_AUTO_DOWNLOAD=0。
Type 算子类型: mapper
Tags 标签: cpu, api
🔧 Parameter Configuration 参数配置¶
name 参数名 |
type 类型 |
default 默认值 |
desc 说明 |
|---|---|---|---|
|
str |
|
|
|
Optional[List[str]] |
|
|
|
Optional[str] |
|
|
|
PositiveInt |
|
|
|
PositiveInt |
|
|
|
PositiveInt |
|
|
|
str |
|
|
|
str |
|
|
|
str |
|
|
|
bool |
|
|
|
Optional[str] |
|
|
|
Optional[str] |
|
|
|
Optional[str] |
|
|
|
str |
|
|
|
PositiveInt |
|
|
|
Optional[Dict] |
|
|
|
Optional[Dict] |
|
|
|
str |
|
|
|
bool |
|
|
|
Optional[str] |
|
|
|
Optional[List[str]] |
|
|
|
PositiveInt |
|
|
|
bool |
|
|
|
str |
|
|
|
str |
|
|
|
`` |