Skip to main content
The NER (Named Entity Recognition) model enables detection of soft PII like person names, organizations, and locations that can’t be captured by regex patterns.

Model Modes

Basic Setup

Download Progress

Track model download progress:
Output during first initialization:

Confidence Thresholds

NER entities have confidence scores (0.0-1.0). Configure minimum thresholds:
Lower thresholds → more detections (potentially more false positives) Higher thresholds → fewer detections (may miss some entities)

Case Fallback

The NER model is case-sensitive — it works best on properly capitalized text. This means lowercase names like "tom" or "sarah" can be missed. Enable caseFallback to run a second NER pass on title-cased text and merge any new detections:
Without caseFallback, neither "tom" nor "sarah" would be detected.

How it works

  1. The primary NER pass runs on the original text
  2. A second pass runs on title-cased text (e.g. "tom""Tom")
  3. New detections from the fallback pass that don’t overlap with primary detections are merged in
  4. Fallback detections keep the original lowercase text and character offsets
  5. A confidence penalty is applied to fallback detections to reduce false positives

Confidence penalty

Fallback detections receive a confidence penalty (multiplied by caseFallbackPenalty, default 0.85) since title-casing can introduce false positives. You can tune this:
Enabling caseFallback doubles NER inference time since it runs two passes. Use it when your input text contains informal or uncapitalized names (chat messages, transcripts, etc.).

Auto-Download Control

By default, models are downloaded automatically. To disable:

Manual Model Management

Pre-download models or manage cache:

Inference Server Backend

For batch processing or GPU acceleration, offload NER inference to a remote server:
This sends tokenized text to the server for inference instead of running ONNX locally. The server must accept the same input format and return logits in the expected shape.

Custom Models

Use your own ONNX model:
Custom models must follow the same input/output format as the default models. See the model training guide for details.

Cache Locations

Models are cached locally for offline use:

Node.js

Browser

In browsers, models are stored using:
  • Origin Private File System (OPFS) for large model files
  • IndexedDB for metadata
Data persists across page reloads and browser sessions.

NER-Detected Types

Disabling Specific NER Types

Detect only certain entity types:

Performance Tips

Model loading is expensive. Create once and reuse:
The quantized model is ~95% as accurate but 4x smaller:
If you only need emails, phones, IBANs, etc.:

Next Steps

Semantic Enrichment

Add gender and location attributes

Custom Recognizers

Add domain-specific detection patterns