resolve-entities-across-sources
Use when joining records about the same company, person, or paper across datasets. Maps to stable identifiers before comparing or counting.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- resolve-entities-across-sources
- description
- Use when joining records about the same company, person, or paper across datasets. Maps to stable identifiers before comparing or counting.
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md357 B
- 参考文档TRUST.auto.yaml2.1 KB
03 SKILL.md 正文
Resolve Entities Across Sources
The same real-world entity appears as "Apple", "Apple Inc.", "AAPL", and "苹果" across sources. Match on identifiers and controlled keys, not on display names, or your join silently splits and duplicates entities.
Procedure
- Prefer an authoritative identifier over any name string: company → LEI or CIK; paper → DOI; researcher → ORCID; place → ISO 3166 / GeoNames id; person → national id where lawful; product → GTIN.
- Normalise the fallback key: Unicode NFKC, casefold, strip legal suffixes (
Inc,Ltd,GmbH,Co), collapse punctuation, expand common abbreviations (Corp→Corporation). - Build candidate pairs by blocking on a cheap key (first token, country, first author), never all-pairs.
- Score candidates with string similarity, then set a two-threshold policy:
- score ≥ 0.92 → auto-merge
- 0.75 ≤ score < 0.92 → human-queue
- below 0.75 → not the same
from difflib import SequenceMatcher s = SequenceMatcher(None, norm(a), norm(b)).ratio() - Resolve, don't delete. Assign a canonical id and keep every alias; a mapping table (
alias → canonical_id) beats overwriting rows. - Handle one-to-many and many-to-one: an acquired subsidiary and its parent, a paper with two versions, a person with two affiliations.
- Record unresolved entities as their own cluster and report their count — do not force-merge them.
# gather all distinct spellings before matching
cut -d, -f2 entities.csv | sort | uniq -c | sort -rn | head -30
Pitfalls
- Fuzzy-matching on names alone merges distinct people ("J. Smith") and splits variants ("Jon", "Jonathan").
- The same name across languages ("Apple" vs "苹果") needs a cross-lingual link table, not string distance.
- Identifiers can be recycled or reassigned; check the id's validity date when sources span years.
- A shared address or phone is weak evidence — shell companies and families share them.
- Merging then joining loses the ability to audit; always keep the alias map.
Verification
python3 -c "import pandas as pd; print(pd.read_csv('alias_map.csv').canonical_id.nunique(), 'canonical entities')"
Report: "1,204 raw name strings resolved to 817 canonical entities via LEI (93%) + similarity; 41 borderline pairs queued for review; 0 force-merges."
04 同仓库更多 Skills
recipe-performance
Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold/warm/background-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout/paint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.
mexc-spot-websocket
MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.
mexc-spot-rest
MEXC Spot REST workflows for public data, signed account requests, orders, wallet/admin actions, and secure signing without exposing API keys.
mexc-futures-websocket
MEXC Futures WebSocket workflows for public streams, private account/order/position streams, ping/pong, subscriptions, and depth maintenance.
0xklen-version-and-refresh-sanctions-lists
暂无简介
verify-tests-cover-changed-lines
Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.