Lexical matching is an ontology alignment technique that identifies candidate mappings by computing the string similarity between the names, synonyms, and labels of concepts from different code systems such as SNOMED CT and ICD-10-CM. It operates on the principle that concepts with highly similar surface forms are likely to be semantically related, serving as a high-recall first pass before more computationally expensive logical reasoning is applied.
Glossary
Lexical Matching

What is Lexical Matching?
Lexical matching is a foundational string-based technique for identifying potential semantic correspondences between concepts in different ontologies by directly comparing their textual labels.
Common algorithms include edit-distance metrics like Levenshtein distance, token-based methods like Jaccard similarity, and phonetic comparisons. While fast and straightforward to implement, lexical matching is inherently limited by synonymy and polysemy, often requiring subsequent semantic matching or human-in-the-loop validation to resolve false positives and ensure accurate equivalence mapping.
Key Characteristics of Lexical Matching
Lexical matching forms the foundational layer of ontology alignment by comparing the surface forms of concept names and synonyms. These techniques are computationally efficient but require careful normalization to overcome terminological variance.
Exact String Matching
The simplest form of lexical matching that identifies mappings only when two concept labels are character-for-character identical after preprocessing. This technique is highly precise but suffers from low recall due to minor orthographic variations.
- Normalization required: Case folding, whitespace trimming, and punctuation removal
- Use case: Matching
Diabetes MellitustoDiabetes Mellitusacross systems - Limitation: Fails on
Type 2 DMvsDiabetes Mellitus Type 2
Normalization-Based Matching
Enhances exact matching by applying a standardization pipeline to both source and target labels before comparison. This addresses systematic differences in casing, punctuation, and stop word usage that otherwise prevent direct alignment.
- Steps: Lowercasing → diacritic removal → stop word filtering → punctuation stripping
- Example:
Diabetes Mellitus, Type IInormalizes todiabetes mellitus type ii - Strength: Catches trivial formatting mismatches without semantic analysis
Edit Distance Algorithms
Quantifies string similarity by calculating the minimum number of single-character operations required to transform one string into another. The Levenshtein distance is the most common variant, counting insertions, deletions, and substitutions.
- Levenshtein:
SNOMED→SNOMED CThas a distance of 3 (space, C, T) - Damerau-Levenshtein: Adds transposition operations for common typos
- Thresholding: Mappings accepted only when normalized distance falls below a configured cutoff
Token-Based Similarity
Decomposes concept labels into individual word tokens and compares sets rather than character sequences. This approach is robust to word reordering and partial matches, making it suitable for multi-word clinical terms.
- Jaccard Similarity: Intersection over union of token sets
- Dice Coefficient: Twice the intersection divided by total token count
- Example:
Acute Myocardial InfarctionandMyocardial Infarction, Acuteyield a Jaccard score of 1.0 after tokenization
N-gram Fingerprinting
Generates overlapping character subsequences of length n from each label and compares the resulting fingerprint sets. This technique captures sub-word similarities and is resilient to spelling variations and morphological differences.
- Common n: Bigrams (2) and trigrams (3) for clinical terminology
- Advantage: Detects similarity between
HypertensionandHypertensivevia shared trigrams - Application: Often used as a fast pre-filter before more expensive semantic matching
Phonetic Algorithm Matching
Encodes strings based on their pronunciation patterns to identify mappings between labels that sound alike but are spelled differently. This is particularly valuable for reconciling drug names and clinician dictation errors.
- Metaphone & Double Metaphone: Produce phonetic hashes for English-language terms
- Example:
FurosemideandFrusemidegenerate identical phonetic codes - Limitation: Language-specific; requires adaptation for multilingual terminology servers
Frequently Asked Questions
Clear, technical answers to the most common questions about lexical matching techniques in medical ontology alignment, designed for clinical informaticists and data scientists.
Lexical matching is an ontology alignment technique that identifies potential semantic correspondences between concepts by computing the string similarity of their names, synonyms, and textual labels. The process operates on the principle that concepts with similar surface forms are likely to represent the same real-world entity. A lexical matcher typically preprocesses labels through tokenization, lowercasing, and stop word removal, then applies string distance metrics such as Levenshtein distance, Jaro-Winkler similarity, or n-gram overlap to generate a similarity score between 0 and 1. For example, the SNOMED CT term "Essential hypertension" and the ICD-10-CM term "Essential (primary) hypertension" would yield a high lexical similarity score due to significant token overlap, flagging this pair as a candidate mapping for further review.
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.
Lexical Matching vs. Semantic Matching
A comparison of string-based and logic-based approaches to identifying concept correspondences between medical terminologies.
| Feature | Lexical Matching | Semantic Matching | Hybrid Approach |
|---|---|---|---|
Core Mechanism | String similarity on labels, synonyms, and variants | Formal logic, hierarchical context, and axiom-based reasoning | Combines string metrics with structural graph features |
Handles Synonyms | |||
Handles Homonyms | |||
Requires Label Overlap | |||
Uses Ontology Structure | |||
Typical Precision | 0.85-0.92 | 0.94-0.98 | 0.93-0.97 |
Typical Recall | 0.70-0.85 | 0.60-0.78 | 0.82-0.92 |
Computational Cost | Low | High | Medium |
Related Terms
Lexical matching is one of several computational strategies for establishing semantic correspondences between medical terminologies. The following concepts represent the broader ecosystem of ontology alignment and interoperability.
Semantic Matching
An ontology alignment technique that leverages the formal semantics, hierarchical context, and logical axioms of concepts to determine similarity, rather than relying solely on string comparison.
- Uses description logic and OWL axioms to infer equivalence
- Considers subsumption relationships (parent-child hierarchies)
- Employs reasoners to detect logical inconsistencies in proposed mappings
- More computationally intensive but yields higher precision than lexical methods
Equivalence Mapping
A type of ontology alignment that asserts a relationship of logical equality or interchangeability between a concept in a source code system and a concept in a target code system.
- Defines mappings as
equivalent,wider,narrower, orunmatched - Critical for bidirectional mapping where round-trip translation must preserve meaning
- Represented in FHIR via the ConceptMap resource with
equivalenceproperty values - Requires domain expert validation for clinical safety in high-stakes contexts
Concept Normalization
The task of linking disparate textual mentions of a clinical entity to a single, unique concept identifier in a standard terminology.
- Resolves variations like 'heart attack', 'MI', and 'myocardial infarction' to a single SNOMED CT code
- Often uses BERT-based alignment with contextual embeddings to capture semantic nuance
- Essential preprocessing step for clinical entity linking and cohort identification
- Outputs include a confidence score indicating mapping reliability
Terminology Server
A software application providing a central repository and API for storing, querying, and distributing standardized medical code systems and value sets.
- Hosts terminologies like SNOMED CT, ICD-10-CM, LOINC, and RxNorm
- Exposes FHIR Terminology Service endpoints for code validation and translation
- Manages version migration when terminologies release updates with deprecated or retired concepts
- Enables real-time canonicalization of clinical data at enterprise scale
Semantic Similarity
A computational measure of the closeness of meaning between two concepts, often calculated based on their distance and properties within an ontological graph.
- Path-based measures count edges between concepts in the hierarchy
- Information content measures weight concepts by their specificity and frequency
- Used to rank candidate mappings and set thresholds for automated alignment
- Complements lexical matching by adding structural context from the ontology graph
Human-in-the-Loop Validation
A workflow where a domain expert reviews, accepts, or rejects algorithmically generated ontology mappings to ensure final accuracy and clinical safety.
- Triggered when confidence scores fall below a defined threshold
- Generates mapping provenance metadata for audit trails and governance
- Essential for high-risk mappings involving medication codes (RxNorm) or diagnoses (ICD-10-CM)
- Balances automation efficiency with the clinical imperative of zero-error tolerance

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