Named Entity Recognition in Free Text#
GLiNER-PII finds names, locations, and other PII within sentences and paragraphs using AI-powered Named Entity Recognition. It understands context, so it can distinguish between “John Smith works at Apple” (person and company) versus “John likes apple pie” (person and food).
Note
Like any entity detection model, GLiNER-PII is not 100% accurate. It is possible that some entities will go undetected, get properly detected but incorrectly labeled, or get incorrectly detected when no PII was present.
When to Use Named Entity Recognition#
Named Entity Recognition works best when:
You have unstructured text such as document paragraphs, emails, or chat logs
Sensitive entities like names and addresses appear within sentences and paragraphs
You need context-aware detection (“Apple the company” vs “apple the fruit”)
Examples#
# Input text
text = "John Smith called Apple Inc. yesterday about the new iPhone release."
# GLiNER-PII will detect:
# - "John Smith" as PERSON
# - "Apple Inc." as ORGANIZATION
# - "yesterday" as DATE
# Input email content
email = "Dear Sarah Johnson, Please contact our support team at support@company.com or call (555) 123-4567."
# GLiNER-PII will detect:
# - "Sarah Johnson" as PERSON
# - "support@company.com" as EMAIL
# - "(555) 123-4567" as PHONE_NUMBER