import goldenmatch as gm.
High-level convenience functions
These are the primary entry points for most users.dedupe
dedupe_df
match
match_df
Scoring functions
score_strings
score_pair_df
explain_pair_df
PPRL (Privacy-Preserving Record Linkage)
pprl_link
pprl_auto_config / auto_configure_pprl
run_pprl
PPRLConfig
Other PPRL exports
Evaluation
evaluate
precision, recall, f1, tp, fp, fn.
evaluate_pairs
predicted is a list of (id_a, id_b, score) triples (the shape score_pairs returns); duplicate pairs are de-duped symmetrically.
Evaluate predicted pairs against ground truth pairs directly.
evaluate_clusters
build_clusters) against ground truth.
EvalResult
load_ground_truth_csv
compare_clusters
CompareResult
run_sensitivity
SweepParam
"threshold", "matchkey.<name>.threshold", "blocking.max_block_size".
Configuration
load_config
GoldenMatchConfig
Top-level config model. Key fields:MatchkeyConfig
MatchkeyField
Other config classes
Result classes
DedupeResult
DedupeResult and MatchResult have _repr_html_() for rich Jupyter display.
native (v2.1.0) — native-dispatch telemetry. result.native is a NativeDispatchSummary reporting whether the scoring hot path actually dispatched to the optional Rust kernel (pip install goldenmatch[native]) or fell back to pure Python — ran_native, hot_path_native, and per-component native/fallback counts. It is None when the run did no scoring. When the kernel is importable but the hot path still ran on the fallback, GoldenMatch also logs a WARNING (and each Ray worker self-reports once per process), so a silently slow run is visible instead of only inferable from wall-clock.
MatchResult
Streaming and incremental
match_one
(row_id, score) tuples.
Returns empty list for exact matchkeys (threshold=None). Use
find_exact_matches for exact matching.StreamProcessor
run_stream
Pipeline functions
run_dedupe / run_match
(path, source_name) tuples.
Scorer functions
Cluster functions
Other pipeline functions
LLM scoring
llm_score_pairs
LLMScorerConfig with optional BudgetConfig.
llm_cluster_pairs
config.mode = "cluster".
BudgetTracker
Other LLM exports
Probabilistic matching (Fellegi-Sunter)
train_em
blocking_fields to exclude them from training.
score_probabilistic
Learned blocking
Explainability
explain_pair is an alias for explain_pair_nl.
Domain extraction
Data quality
Lineage and profiling
Auto-configuration
auto_configure_df:
strict— compute postflight signals and emit advisories, but suppress auto-adjustments (threshold nudges, etc.). Use for DQBench / regression / reproducibility runs.allow_remote_assets— permitembedding,record_embedding, and cross-encoder rerank scorers. DefaultFalsedemotes them so auto-config is offline-safe and never triggers a surprise HuggingFace download.
config._preflight_report: PreflightReport (underscore — private-by-convention but stable across v1.5.x).
Controller telemetry (v1.7-v1.12)
auto_configure_df runs the AutoConfigController, which writes (profile, history) to a ContextVar (goldenmatch.core.autoconfig._LAST_CONTROLLER_RUN). Callers can read it post-call:
AgentSession.autoconfigure (v1.7-v1.12)
For agent-style sessions,AgentSession exposes the same surface as a single call:
Verification (v1.5.0)
The preflight + postflight layer validates an auto-generated config against the data it was built for.auto_configure_df runs preflight automatically at the end; the pipeline runs postflight automatically after scoring. Both are also callable directly.
preflight
(df, config):
- Column resolution — every column referenced by blocking/matchkeys exists, or is a pipeline-synthesized
__mk_*, or is a domain-extracted column recoverable by enablingconfig.domain(auto-repaired when a domain profile was stashed during auto-config). - Exact-matchkey cardinality — drops keys with ratio >= 0.99 (near-unique, no pair ever agrees) or < 0.01 (near-constant, produces giant blocks).
- Block-size sanity — samples blocking keys and flags blocks that would stall the scorer.
- Remote-asset demotion —
embedding/record_embedding/ cross-encoder rerank scorers are demoted unlessallow_remote_assets=True. - Weight confidence capping — matchkey fields with profile confidence < 0.5 cap at weight 0.3 (requires
profileskwarg). - Domain auto-repair — when a column like
__title_key__is missing but a domain profile is available, enablesconfig.domainso the pipeline produces the column at runtime.
finding.repaired = True) and records unrepairable issues as severity="error" findings. auto_configure_df raises ConfigValidationError if report.has_errors.
postflight
- Score histogram + bimodality — if the score distribution is clearly bimodal (valley depth ratio < 0.5) and the valley is > 0.05 away from the current threshold, emits a
PostflightAdjustmentnudging the threshold to the valley. Suppressed understrict=True. - Blocking recall estimate — gated at >= 10K rows; returns
"deferred"below that. - Preliminary cluster sizes + oversized-cluster bottleneck pair — p50/p95/p99/max plus a list of oversized clusters with their weakest edge.
- Threshold-band overlap — fraction of pairs within 0.02 of the threshold. Advises
--llm-autowhen > 20% and LLM scorer is off.
Report shapes
PostflightSignals schema
Thesignals dict is a stable TypedDict contract (defined in goldenmatch/core/autoconfig_verify.py):
ScoreHistogram, BlockSizePercentiles, ClusterSizePercentiles, OversizedCluster are all TypedDicts — import them from goldenmatch.core.autoconfig_verify if you want to type-check consumer code.
Where the reports live
config._preflight_report: PreflightReport | None— set byauto_configure_df. Underscore-prefixed, documented as private-by-convention; stable contract.DedupeResult.postflight_report: PostflightReport | None— set by the pipeline after scoring.MatchResult.postflight_report: PostflightReport | None— same for match flows.
Active learning
Diff and rollback
Graph ER
propagation_mode="relational" runs collective ER (Bhattacharya-Getoor): it
blends attribute similarity with neighbor-cluster overlap (Jaccard/Adamic-Adar)
and iterates to a synchronous fixpoint, resolving homonyms that attributes alone
cannot (measured pairwise F1 ~0.66 -> ~0.87 on a relational fixture where the
co-author neighborhood is the only disambiguating signal). "additive" /
"multiplicative" are the simpler flat-boost modes (the default stays additive).
Output
Learning Memory (v1.6.0)
After a pipeline run, every
DedupeResult / MatchResult carries a memory_stats field:
REST API client
urllib only — no extra dependencies.