buildCompromiseDetectors
Build NLP-powered person and place detectors.
Usage
import { createMasker } from '@pii-mask/core';
import { buildCompromiseDetectors } from '@pii-mask/nlp';
const nlpDetectors = buildCompromiseDetectors({
entities: ['Person', 'Place'],
confidence: 0.7,
});
const masker = createMasker({
mode: 'mask',
extend: nlpDetectors,
});
const { result } = masker.maskString('Emeka Okafor lives in Lagos');Options
| Option | Type | Default | Description |
|---|---|---|---|
entities | Array<'Person' | 'Place' | 'Organization'> | ['Person', 'Place'] | Entity types to detect |
confidence | number | 0.5 | Minimum confidence threshold |
customLexicon | Record<string, string> | {} | Custom words to add to the NLP model |