Entity Resolution and Disambiguation: Building a Reliable Foundation for Knowledge Graphs
This article explains how to build the entity resolution layer that underpins a trustworthy knowledge graph, using person data as a running example. Starting from a single short biography, it surfaces the core challenges—non-unique names, inconsistent granularity, multi-valued attributes, and conflicting sources—and clarifies the difference between record-level and entity-level data. It then walks through the complete workflow: data modeling with stable identifiers separated from business keys, extraction and normalization, and a five-step pipeline (blocking, field-level similarity, match decisions with hard constraints, constrained clustering, and conflict resolution). It also covers special handling for Chinese and cross-lingual scenarios, quality evaluation and continuous governance, a cloud engineering architecture, and a checklist of common pitfalls.
1. Why Entity Resolution Is Hard: A Look at a Single Biography
Assume you have a short biography to process. In sequence, it gives the person’s common stage name, legal name, date of birth, birth city and district, ethnicity, and multiple occupations—singer, songwriter, actor, and music producer. The text is under a hundred words yet densely packed. Turning it into usable knowledge-graph data immediately exposes several structural problems:
- Names are not unique: One person may be known by different names. The bio provides both the legal name and the better-known stage name. If you use the name as the primary key, records that mention only one of these names will be treated as a different person.
- Granularity is inconsistent: A birth date may be precise to the day in one record and only to the year in another; a birth place may be given only as a city, or narrowed down to a district.
- Attributes are multi-valued: Occupation is not a single value but a set.
- Sources are diverse: The same person may come from encyclopedia entries, concert listings, filmography records, media coverage, and social media, which may contradict each other on the same attribute.
The essence of these problems is the gap between “record-level data” and “entity-level data”: a record describes what a piece of text says, while an entity describes the same real person in the world.
Entity Resolution is the task of identifying and merging records that point to the same real-world object; Entity Disambiguation is determining which candidate entity a given mention refers to. When a task requires linking the names, aliases, pronouns, and other referring expressions that appear in text to existing entities, it is called Entity Linking.
All three share the same foundation: stable entity identifiers, normalized attribute values, and reliable matching and conflict-handling mechanisms. Using person data as the main thread, this article systematically explains how to model, compute, and engineer entity resolution for the foundation of a knowledge graph.
2. Data Modeling: First Define “What Counts as the Same Person”
The quality of entity resolution is largely determined by the data model. At the modeling stage, you need to settle several things.
2.1 Separate Stable Identifiers from Business Keys
Assign each entity a globally unique internal identifier, such as an ID of the form “entity-type prefix + sequence number,” like P-0001. This identifier is used only inside the system, and once it is referenced by external data, it must remain unchanged when entities are merged.
At the same time, maintain a business key composed of “canonical name + birth date + birth place.” It is used for indexing and blocking, but not as a decision criterion, because names can change and birth dates and birth places can be recorded incorrectly.
2.2 Layer Primary Attributes and Aliases
If you stuff stage names, legal names, transliterated names, and so on into a single name field, you can neither distinguish primary from secondary nor express the source and trustworthiness of one alias relative to another. A more sensible approach:
- Establish a preferred name as the first choice for display and matching;
- Store aliases separately, recording for each its type (legal name / stage name / transliteration variant, etc.), language, source, and confidence;
- When matching, compare the whole “name set” formed by the preferred name and the aliases, rather than a single field.
2.3 Establish Provenance and Versioning
Attach a source identifier, fetch time, and confidence to every attribute value. Use append-only versioning for attribute updates rather than in-place overwrites, leaving room for later conflict resolution, auditing, and rollback.
2.4 Expression Example
An illustrative attribute structure is shown below:
{"entity_id": "P-0001","entity_type": "Person","attributes": {"name": {"value": "<common stage name>", "role": "preferred", "language": "en"},"aliases": [{"value": "<legal name>", "alias_type": "legal_name", "source": "ref_001"},{"value": "<transliteration of the stage name>", "alias_type": "transliteration", "language": "zh"},{"value": "<original form of the stage name>", "alias_type": "original_form", "language": "en"}],"birth_date": {"value": "1986-03-28", "granularity": "day", "source": "ref_001"},"birth_place": {"value": "<city and district>", "code": "ADM3_000000", "source": "ref_001"},"occupations": ["singer", "songwriter", "actor", "music producer"]},"provenance": {"source_id": "ref_001", "fetched_at": "2025-01-01T00:00:00Z", "confidence": 0.95}}
This structure expresses “one entity” and “the individual facts about it” separately. Each time a new source arrives, you simply append a set of attributes with provenance, and the entity’s own identifier is unaffected.
3. Information Extraction and Normalization: Making Data Comparable
Before matching begins, raw text goes through two stages: extraction and normalization.
Extraction identifies entity mentions, attribute values, and the pointing relationships between attributes in the text. For example, from “born on [date], in [city, district], [country],” extract the birth date and birth place. Extraction results are typically represented as triples:
(P-0001, birth_date, "1986-03-28")(P-0001, birth_place, "<city and district>")(P-0001, occupation, "singer")
Normalization converges different representations of the same meaning into a unified form, which is a prerequisite for whether subsequent comparison works. The main tasks include:
- Dates: Unify to ISO 8601 format and mark the precision (day / month / year).
- Place names: Map the birth place to a unified administrative-region coding system, preserving the hierarchy from country, province/state, city, down to district.
- Occupations: Map free-form expressions such as “singer-songwriter,” “songwriting,” and “singer and producer” into controlled-vocabulary categories such as “songwriter.”
- Text: Unify case, strip extra whitespace, and normalize full-width and half-width characters.
Normalization is not a one-time effort. The controlled vocabulary and coding mappings themselves need versioning; when the vocabulary changes, historical data must be reprocessed once to keep old and new data comparable.
4. The Entity Resolution Pipeline: Five Steps to Merging
4.1 Step 1: Blocking to Narrow the Candidate Set
The core of entity resolution is deciding whether two records point to the same entity. If you compare all records pairwise, the complexity is O(n²), which is infeasible for large-scale data. Blocking first partitions records into “blocks” by certain keys, and comparison happens only within a block.
Common blocking keys for person data include:
- Strong keys: normalized full name, aliases, birth date;
- Weak keys: first character of the name + birth year, birth-place code, occupation category.
Practical points:
- Multi-pass blocking with a union of results: Different sources have different field completeness, so a single blocking key easily causes missed recall.
- Strong keys first: High-distinctiveness keys such as aliases and birth dates produce small blocks with low comparison cost and accurate hits.
- Control block size: Broad keys like “birth year” produce huge blocks; set an upper bound. Once exceeded, refine with a finer secondary key, or keep only the strong-key candidate pairs.
Illustrative pseudocode:
def build_blocks(records):# Multi-pass blocking: a record can enter multiple blocksblocks = defaultdict(list)for r in records:blocks[("name_year", r.norm_name, r.birth_year)].append(r) # weak keyif r.norm_name:blocks[("name", r.norm_name)].append(r) # strong keyfor alias in r.normalized_aliases:blocks[("alias", alias)].append(r)# Refine oversized blocks or limit the comparison scopereturn {k: refine(v) if len(v) > MAX_BLOCK_SIZE else vfor k, v in blocks.items()}
4.2 Step 2: Field-Level Similarity
Compare candidate pairs field by field, normalizing the different similarities into [0, 1].
- Name: In order, check exact match (1.0), containment relations such as abbreviation vs. full form (0.8–0.9), and a normalized edit distance. For cross-lingual cases, compare after romanization.
- Alias: If one side’s name set has an exact hit against the other side’s alias set, give a high-confidence signal; it can be set to 1.0.
- Birth date: Identical is 1.0; a partial score can be given when a known year range on one side contains the other’s year; a missing or placeholder value is recorded as 0, and the model learns its meaning of missingness.
- Birth place: Same code is 1.0; same city but different district gets a relatively high score (e.g., 0.8); same province/state gets a lower score.
- Occupation: Map occupations to a controlled vocabulary and compute a weighted Jaccard similarity. Online-only alignments carry lower weight, while work-related occupations carry higher weight.
4.3 Step 3: Match Decision and Hard Constraints
For the final decision on two records, it is best to combine “hard-constraint rules + model soft scoring.” Two common industry approaches:
- Feed the field similarities as features into a classification model (such as gradient-boosted trees) that outputs the probability of being the same entity;
- Use rules to set two thresholds, high and low: above the high threshold, auto-merge; below the low threshold, judge as different entities; in between, route to manual review.
Thresholds must be tuned on labeled data. At the same time, hard constraints take priority over the similarity score. Typical cases include:
- The birth date and death date contradict each other;
- Two people’s main active periods do not overlap at all, and their occupational fields differ markedly.
Once such a contradiction appears, you can directly veto the merge, avoiding the “high score but conflicting facts” error.
Illustrative decision code:
def decide(score, hard_conflict, high=0.90, low=0.60):if hard_conflict: # hard constraints firstreturn "different"if score >= high:return "merge"if score <= low:return "different"return "review"
4.4 Step 4: Clustering and Merging
After aggregating the decision results, use a disjoint-set (Union-Find) structure to organize records into clusters, each corresponding to one entity. There is a problem here that is easily overlooked:
Transitivity creates chained errors. A being similar to B and B being similar to C does not mean A and C are the same entity; naive merging can connect two different people into one cluster.
Countermeasures:
- Before merging, check whether the cluster’s “minimum intra-cluster similarity” falls below the threshold; if so, do not merge;
- Use stricter clustering methods such as correlation clustering;
- Keep one “core record” (the most complete and most trusted record) within the cluster; new records can only join with reference to the core record and cannot directly “bridge.”
Illustrative code:
class EntityResolver:def __init__(self, threshold):self.parent = {} # Union-Find parent pointersself.clusters = {} # cluster root -> list of recordsdef add(self, record):rid = record["id"]self.parent[rid] = ridself.clusters[rid] = [record]return riddef try_merge(self, a, b, score, conflict):ra, rb = self.find(a), self.find(b)if ra == rb or score < self.threshold or conflict(ra, rb):return False# The weakest intra-cluster similarity after merging must still meet# the threshold, to prevent chained mergingmerged = self.clusters[ra] + self.clusters[rb]if min_similarity(merged) < self.threshold:return Falseself.parent[rb] = raself.clusters[ra] = mergeddel self.clusters[rb]return True
After merging, the system obtains several entity clusters. Each cluster is assigned a stable entity ID, and the names, aliases, and attributes of the records within the cluster are merged into entity attributes according to the rules in Section 4.5.
4.5 Step 5: Conflict Resolution
When a cluster has different values for the same attribute, you need to decide which one to use:
- Source trust first: manually reviewed data ranks above primary sources, primary sources rank above general media reports, and general media reports rank above user-generated content;
- Granularity first: when both “[country, city]” and “[country, city, district]” exist, use the finer-grained one as the primary value and keep its code;
- Recency first: for attributes that change over time, prefer the latest verified value;
- Keep multiple values: naturally multi-valued attributes such as occupation are not reduced to a single value; instead, merge and deduplicate;
- Retain history: superseded values are not deleted; they are archived together with their source and time.
5. Additional Handling for Chinese and Cross-Lingual Scenarios
Person data often spans multiple languages, and the Chinese context has several special considerations.
The transliteration-chain problem
A foreign name may have multiple Chinese renderings; a Chinese rendering, when transliterated back into Latin letters, may again yield different spellings. Directly comparing two Chinese names, or comparing a Chinese name with a foreign one, is unreliable. A workable approach:
- Attach multiple language forms of a name to the same entity;
- When comparing, first romanize all forms uniformly, then compare at the set level.
Disambiguation features
Chinese names have a very high duplication rate, and the name alone can hardly distinguish them. Auxiliary features are needed: occupation, active period, region, collaborations, representative works, and so on.
Alias overlap is a signal, not a guarantee
- If two different alias sets have an intersection, it usually means they are the same entity or highly related entities;
- If multiple “different entities” share the same alias, that itself is a signal indicating the need for further verification or splitting.
Traditional/Simplified and symbols
Before Chinese comparison, complete Traditional-to-Simplified conversion and handle punctuation differences such as the interpunct “·” and the title marks 《》.
6. Quality Evaluation and Continuous Governance
Evaluation metrics
- Record-level: precision, recall, and F1, computed over human-labeled same/different entity pairs.
- Cluster-level: B-Cubed, CEAF, and similar metrics evaluate overall clustering quality, reflecting two kinds of problems: “should have merged but didn’t” and “shouldn’t have merged but did.”
- Business-level: changes in total entity count, alias hit rate, and the backlog of the manual-review queue.
False merges and missed merges
| Problem | Meaning | Typical cause | Impact |
|---|---|---|---|
| False merge | Different entities grouped into one | Threshold too low, chained transitivity, relying on name alone | Pollutes attributes, relationships, and statistical definitions; hard to undo automatically |
| Missed merge | The same entity split into several | Blocking omissions, missing aliases, threshold too high | Entity fragmentation, hurting retrieval completeness and metric statistics |
The cost of fixing a false merge is usually far higher than that of fixing a missed merge, so thresholds should be conservative, and improving recall should prioritize adding aliases and strong keys.
Iteration mechanisms
- Sampled manual review: Focus on inspecting the decisions in the intermediate score range;
- Bad-case feedback loop: Turn discovered errors into new rules or training samples;
- Change regression: After each adjustment to the blocking strategy, thresholds, or the vocabulary, re-evaluate on a fixed test set;
- Idempotent updates: When new data arrives, deduplicate by “business key + content hash” to avoid repeatedly triggering resolution.
7. Engineering Architecture: Cloud Deployment Essentials
From an engineering perspective, a person-data resolution system can be split into the following stages:
- Collection and ingestion: Data from multiple sources enters a message-queue buffer, smoothing peaks and troughs while ensuring traceability;
- Raw storage: Raw documents and extraction results are stored in object storage as a replayable “data lake” foundation;
- Resolution jobs: Batch or streaming jobs run on a container platform to perform extraction, normalization, and blocking;
- Entity storage: A relational database stores entity attributes and provenance, while a graph database stores relationships between entities such as collaborations and works;
- Retrieval service: Inverted-index-based retrieval supports alias lookup and approximate text recall;
- Observability: Logging services and monitoring/alerting cover metrics such as job failure rate, block-size distribution, merge rate, and review-queue backlog.
These capabilities have corresponding general product categories available on Baidu AI Cloud for selection; refer to each product’s official documentation for specific configuration.
Security and compliance
- Follow the principle of least necessity, collecting only the fields needed to complete the task;
- Apply classification and access control to personal information;
- Use de-identified data in test and development environments.
8. Common Pitfalls Checklist
- Name as ID: Using a name as the primary key; once the name changes or a transliteration difference appears, the same entity gets split.
- Blocking too narrow: Using a single weak key for blocking; slight deviations in aliases or dates cause missed recall.
- Chained merging: Not checking intra-cluster consistency lets errors propagate like a chain.
- Silent overwrite: Overwriting attribute values directly without retaining history, so when a problem appears you cannot locate the source or roll back.
- Vocabulary drift: Controlled vocabularies and place-name coding without version management lead to inconsistent definitions between old and new data.
- Watching only totals: A sudden increase or decrease in entity count does not necessarily indicate improved quality; judge it with sampled review.
9. Conclusion
The difficulty of person-data entity resolution lies not in the model itself, but in the precise definition and traceable handling of “the same person.” A concise biography involves at least the typical problems of coexisting stage names and legal names, inconsistent granularity of temporal and spatial attributes, and multi-valued occupations; when such data appears repeatedly at different granularities and from different sources, the problems multiply.
A practical path breaks into three steps:
- Modeling stage: Separate stable identifiers from business keys, standardize attributes and aliases, and establish a provenance mechanism;
- Algorithm stage: Adopt a combination of “multi-pass blocking + field similarity + hard-constraint decisions + constrained clustering + tiered conflict resolution”;
- Governance stage: Establish metric evaluation, sampled review, and change-regression mechanisms so that entity resolution keeps evolving.
With this foundation solid, upper-layer applications such as person search, relationship analysis, and intelligent Q&A can gain trustworthy data support.
