Dictionary-Based NER, also known as gazetteer-based NER, operates by scanning unstructured text for exact or fuzzy matches against a curated dictionary of entity names. Unlike statistical models, it requires no training data, making it ideal for domains with exhaustive, finite entity lists such as medical codes, chemical compounds, or known product SKUs where recall of the dictionary is paramount.
Glossary
Dictionary-Based NER

What is Dictionary-Based NER?
Dictionary-Based NER is a high-precision named entity recognition method that identifies entities by matching text substrings against a pre-compiled list of known entity names, often using efficient trie data structures.
The core mechanism relies on efficient string-matching algorithms, typically implemented using a trie (prefix tree) or Aho-Corasick automaton, to achieve linear-time complexity relative to text length. While this method guarantees perfect precision on dictionary terms, its primary limitation is poor recall for novel or misspelled entities, which is why it is frequently combined with machine learning-based NER in hybrid extraction pipelines.
Frequently Asked Questions
Clear, technical answers to the most common questions about dictionary-based named entity recognition, covering its mechanisms, performance trade-offs, and implementation patterns.
Dictionary-based NER is a high-precision entity extraction method that identifies named entities by matching text substrings against a pre-compiled list of known entity names called a gazetteer. The core mechanism involves loading a structured dictionary of entities—such as all known drug names, company tickers, or city names—into an efficient in-memory data structure, most commonly a trie (prefix tree) or Aho-Corasick automaton. During processing, the algorithm scans the input text character by character, traversing the trie to find the longest possible match without backtracking. When a terminal node is reached, the matched span is tagged with its corresponding entity type. Unlike machine learning-based NER, this approach requires no training data and guarantees that every extracted entity exists in the reference dictionary, making it ideal for domains with closed, well-defined entity sets such as medical coding systems (ICD-10, SNOMED CT) or financial instrument identifiers.
How Dictionary-Based NER Works
A high-precision named entity recognition method that identifies entities by matching text substrings against a pre-compiled list of known entity names.
Dictionary-based NER operates by scanning unstructured text for exact or fuzzy matches against a gazetteer—a structured dictionary of known entity names. The process typically loads the dictionary into a trie (prefix tree) or Aho-Corasick automaton data structure, enabling simultaneous, linear-time matching of thousands of entity strings against an input document without backtracking.
While offering high precision on known entities, this method suffers from low recall for unseen or variant spellings. To mitigate this, implementations often incorporate fuzzy matching using edit distance metrics like Levenshtein distance to catch typographical errors. The approach is frequently used as a high-precision feature in hybrid systems or as a source of weak supervision labels for training neural models.
Key Characteristics of Dictionary-Based NER
Dictionary-Based NER identifies entities by matching text substrings against a pre-compiled list of known entity names. This high-precision method relies on efficient data structures and string-matching algorithms to achieve deterministic, auditable results without requiring training data.
Deterministic Matching Logic
Unlike probabilistic machine learning models, dictionary-based systems operate on exact or fuzzy string matching against a curated gazetteer. This provides 100% reproducible results—the same input always produces the same output. The logic is fully auditable, making it ideal for regulated industries where every extraction decision must be explainable. There are no hidden weights, no training artifacts, and no hallucinated entities.
Trie-Based Indexing for Speed
Large dictionaries with millions of entries require efficient lookup structures. The trie (prefix tree) is the canonical data structure, enabling O(n) matching time where n is the length of the input text, regardless of dictionary size. Variants include:
- Aho-Corasick automaton: Simultaneously matches multiple patterns in a single pass
- Double-array trie: Minimizes memory footprint for massive gazetteers
- Suffix tries: Enables matching of multi-word entity spans from any starting position
Fuzzy Matching for Surface Form Variation
Real-world text contains typos, abbreviations, and morphological variants. Dictionary-based NER employs approximate string matching to handle these deviations:
- Levenshtein edit distance: Accounts for character insertions, deletions, and substitutions
- Phonetic algorithms like Soundex or Metaphone: Match entities by pronunciation
- Normalization pipelines: Apply stemming, lowercasing, and diacritic stripping before lookup
- Threshold tuning: Balances recall against false positives by setting minimum similarity scores
High Precision, Bounded Recall
The fundamental trade-off of dictionary-based NER is precision over recall. Every matched entity is correct by definition (assuming a clean gazetteer), yielding precision approaching 100%. However, recall is strictly bounded by dictionary coverage—any entity not in the gazetteer is invisible to the system. This makes the approach ideal for:
- Closed-domain extraction with a finite, known entity universe
- High-stakes applications where false positives are unacceptable
- Bootstrapping training data for machine learning models via distant supervision
Gazetteer Curation and Maintenance
The quality of extraction is entirely dependent on the quality of the underlying dictionary. Effective gazetteer management requires:
- Deduplication and canonicalization: Merging variant names into a single authoritative form
- Alias expansion: Adding common abbreviations, acronyms, and historical names
- Type tagging: Associating each entry with its entity type for classification
- Version control: Tracking additions, removals, and modifications over time
- Conflict resolution: Handling ambiguous names that map to multiple entity types
Integration with ML Pipelines
Dictionary-based NER rarely operates in isolation. It serves as a critical component in hybrid extraction architectures:
- Feature engineering: Gazetteer matches provide binary features for statistical NER models
- Candidate generation: Dictionaries propose entity spans that a neural re-ranker validates
- Weak supervision: Dictionary matches generate noisy labels for training deep learning models
- Post-processing: Dictionary lookups correct or augment the output of transformer-based extractors
Dictionary-Based NER vs. Statistical NER
A feature-level comparison of rule-based gazetteer matching against machine learning-driven entity extraction approaches.
| Feature | Dictionary-Based NER | Statistical NER | Hybrid NER |
|---|---|---|---|
Core Mechanism | Exact or fuzzy substring matching against a pre-compiled gazetteer | Probabilistic sequence labeling using models like CRF or fine-tuned transformers | Combines dictionary features as input signals to a statistical model |
Training Data Requirement | Zero labeled data; requires curated entity lists | Requires manually annotated corpora (e.g., CoNLL-2003) | Requires annotated data plus a high-quality gazetteer |
Handling Unseen Entities | |||
Precision on Known Entities | Very high (near 100% for exact matches) | High but may miss rare surface forms | Very high; dictionary boosts precision |
Recall on Novel Surface Forms | |||
Robustness to Typos | Low (requires fuzzy matching with edit distance thresholds) | High (contextual embeddings handle variations) | Moderate to high |
Domain Adaptation Effort | Low (swap the dictionary) | High (requires re-annotation or fine-tuning) | Moderate (update dictionary plus fine-tune) |
Computational Cost at Inference | Very low (O(n) with Aho-Corasick automaton) | High (GPU required for transformer forward pass) | Moderate to high |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Real-World Use Cases
Dictionary-based NER remains a critical component in high-precision, low-latency production systems where entity lists are known and exhaustive. Its deterministic nature makes it ideal for regulated industries and real-time applications.
Clinical Trial Patient Matching
Pharmaceutical companies use dictionary-based NER to scan unstructured electronic health records for specific medical codes, drug names, and genetic markers. By compiling gazetteers from UMLS Metathesaurus and DrugBank, systems achieve near-perfect precision when identifying eligible trial participants.
- Matches ICD-10 and SNOMED CT codes in clinical notes
- Links mentions to RxNorm identifiers for medication reconciliation
- Operates under strict HIPAA compliance with deterministic, auditable logic
Financial Compliance Screening
Banks and fintech platforms deploy dictionary-based NER to screen transactions and communications against sanctions lists, PEP databases, and internal watchlists. The deterministic matching guarantees no sanctioned entity escapes detection due to model uncertainty.
- Screens against OFAC SDN List and EU Consolidated List
- Uses fuzzy matching with configurable edit distance thresholds
- Generates immutable audit trails for regulatory reporting
E-Commerce Product Catalog Normalization
Marketplaces use dictionary-based NER to extract brand names, model numbers, and SKU identifiers from unstructured product titles and descriptions. A pre-compiled catalog gazetteer ensures consistent entity resolution across millions of seller listings.
- Normalizes 'iPhone 15 Pro Max 256GB' to canonical product ID
- Handles abbreviations and synonyms via alias expansion
- Powers faceted search filters and price comparison engines
Legal Contract Clause Extraction
Law firms and contract management platforms use dictionary-based NER to identify clause types, governing law jurisdictions, and obligation triggers in dense legal documents. Curated lexicons of legal terms of art ensure consistent extraction across varying drafting styles.
- Detects force majeure, indemnification, and termination clauses
- Extracts party names and effective dates with boundary rules
- Integrates with document assembly and obligation tracking systems
Cybersecurity Threat Intelligence
SOC teams use dictionary-based NER to extract CVE identifiers, threat actor names, malware families, and TTPs from unstructured threat reports and dark web forums. The deterministic approach ensures zero false negatives on known IOCs.
- Matches against MITRE ATT&CK framework entities
- Extracts IP addresses, domains, and file hashes via regex + dictionary
- Feeds SIEM and SOAR platforms with structured threat data
Biomedical Literature Curation
Research institutions use dictionary-based NER to extract gene names, protein identifiers, and disease mentions from PubMed abstracts. Gazetteers built from HGNC, UniProt, and MeSH enable high-throughput literature mining for systematic reviews.
- Resolves gene symbol ambiguity using contextual disambiguation rules
- Links entities to UniProt and Entrez Gene database identifiers
- Supports meta-analysis and drug repurposing research pipelines

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us