Skip to main content
Semantic enrichment adds contextual attributes to PII placeholders, helping translation systems maintain grammatical correctness across languages.

Why Semantic Attributes?

Many languages have grammatical gender agreement. Without knowing the gender of a person, translation quality suffers:

Enable Semantic Enrichment

Semantic Attributes

Person Gender

Location Scope

Semantic Data

Semantic enrichment uses lookup databases (~4 MB total):
  • Name database: 40K+ first names with gender associations (from gender-guesser)
  • City database: 25K+ cities from GeoNames (population > 15K)
  • Country database: Country names and ISO codes
  • Region database: First-level administrative divisions

First-Use Download

Manual Data Management

Title Extraction

When semantic enrichment is enabled, honorific titles are extracted and kept visible:
Supported titles:
  • Academic: Dr., Prof., PhD
  • Honorific: Mr., Mrs., Ms., Miss
  • Professional: Rev., Hon.
  • German: Herr, Frau, Dr.
  • French: M., Mme., Mlle.
  • And many more…
Titles remain visible because they’re often important for translation and don’t reveal the person’s identity on their own.

Excluding Location Scopes

When semantic enrichment is enabled, you can selectively skip anonymization of locations by their scope. This is useful when you want to keep country and region names visible while still anonymizing cities and addresses.
You can also apply this as a per-call override:
Available scopes to exclude:
This option requires semantic: { enabled: true } because scope classification depends on the GeoNames lookup database. Without semantic enrichment, excludeLocationScopes is silently ignored.

Locale Hints

Improve detection accuracy with locale hints:
The locale helps with:
  • Name gender inference (culture-specific names)
  • Title recognition (Mr. vs Herr vs M.)

Configuration Options

Cache Locations

Semantic data is cached locally:

Node.js

Browser

Uses IndexedDB for cross-session persistence.

Use Cases

German, French, Spanish, and many other languages have grammatical gender. Semantic attributes help MT systems:
Different location types use different prepositions:
The scope attribute helps translation systems choose correctly.
Beyond translation, semantic attributes enable:
  • Gender-aware text generation
  • Location-based content filtering
  • Name normalization

Next Steps

Browser Usage

Using semantic enrichment in browsers

Sessions & Storage

Persist enriched PII maps