Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

entmatch

Typed, calibrated, auditable entity matching and comparison library.
Domain-agnostic. Core deps: pydantic v2 + numpy.

python licence mypy deps

Install | Quickstart | CLI

Pre-release (alpha). Links to github.com/CreAI-mx/match point to the source repository, which is private: they open only with access.


What it does

You give entmatch a messy line of text and a catalog of official entries. It returns the entry it thinks you meant, a confidence from 0 to 100%, and one decision: Sure, Not sure or Not in catalog. When it is unsure, it says so and asks a human, instead of guessing.

Messy input goes in; a decision with a confidence comes out.


Business glossary: teach entmatch your company's words

Clients write GFR, TDC, SAT, x, brand names and internal codes. No model can guess them. The business glossary is a file where you register what those terms mean (acronyms, synonyms, brands, codes, value_map yes/no values). Domain terms are expanded before scoring, so the ranker sees both forms.

  • Deterministic: exact term lookup, no model call, no training.
  • Only status=approved rows act. Proposed and rejected rows are ignored. An empty status counts as approved (a human wrote the row).
  • No acronym is assumed. Unknown terms are listed in unknown_terms.md on every run for the client to answer.
  • No glossary = byte-identical output (empty file or only non-approved rows too).

Register it (file formats .csv, .tsv, .yaml/.yml, .json; columns term, expansion, type, field, client, direction, lang, status):

term,expansion,type,field,client,direction,lang,status
GFR,Gerencia de Finanzas Regional,acronym,departamento,,both,es,approved
@bool,,value_map,activo,,,,approved
from entmatch import Catalog
rows = [{"term": "GFR", "expansion": "Gerencia de Finanzas Regional", "type": "acronym",
         "field": "departamento", "status": "approved"}]
cat = Catalog(generator="lexical", glossary=rows)   # or glossary="glossary.csv"

Command line (works on the base install; add --client NAME for client-scoped rows):

entmatch match --preset lexical --catalog refs.jsonl --queries queries.csv --out out/results.csv --glossary glossary.csv

refs.jsonl holds one catalog entry per line ({"id": "o1", "name": "Acme Industries"}); queries.csv needs a query column.

Measured (R2 frozen protocol, English, acronym_collision, n=750, synthetic): top-1 0.129 off -> 0.973 with glossary alone. Warning from the same run: enabling every feature together (all_on) fell to 0.001 (cause unknown). Turn features on one at a time and measure. A later lexical run did not reproduce the drop (all_on 1.000), so the R2 loss is an open item. Synthetic data, not client data.

Full reference (file format, scoping, unknown-terms loop, caveats): docs/skill/references/glossary.md.


Install

pip install entmatch

While only pre-releases exist you can pin one: pip install entmatch==0.3.0rc1.

Extra Adds
entmatch[xlsx] .xlsx input and output
entmatch[lite] xlsx / pandas ingest and a faster lexical matcher, no torch
entmatch[r2] ENTMATCH-R2 model
entmatch[serve] ENTMATCH-R2 plus HTTP API (CPU)

The trained ENTMATCH-R2 model (felipedjrg3/entmatch-r2, 2.4 GB) is not inside the package: with [r2] or [serve] it downloads on first use, then runs offline. CPU only, no GPU. For CPU-only torch, install it first from the PyTorch CPU index.

The source repository also ships a coding-agent skill (docs/skill) with playbooks and a quality gate; it is not part of the package.


How it works

Real output of hero_plans.py, offline basic mode.

What was typed Decision Catalog entry Confidence
INV-2291 | GOLD PLUS PPO | 2026 | $412.00🟢 SureGOLD-PPO91%
Hola, el empleado pasa al plan Oro Plus PPO…🟡 Not sureGOLD-PPO (probably)75%
Gold Plus🟡 Not sureGOLD-PPO or GOLD-HMO?63%
Platinum Max EPO⚪ Not in catalognone32%

Scores of the 4 inputs above against the default thresholds. Source: QUICKSTARTS.md.

Default thresholds (threshold.py:32-34): Sure >= 80% (match), Not sure 50-80% (review), Not in catalog < 50% (abstain).


Results on 100 records

Run with the benchmark script in the source repository (not part of the package).

100 synthetic inputs vs a 100-entry catalog (85 in it, 15 not) ENTMATCH-R2 Lexical baseline
Top-1 accuracy (the 85 in catalog)97.6% (83/85)80.0%
Auto-accept precision100.0% (30/30)79.2% (19/24)
Not-in-catalog auto-rejected (of 15)0 (all 15 sent to review)0

Synthetic data, n=100, 70 of 100 went to a human. Source: bench100 results (3 identical runs, CPU).


60-second quickstart

After install. No extra needed.

import entmatch as em

# The catalog: the official list you match against.
catalog = [
    {"id": "o1", "name": "Acme Industries", "aliases": ["ACME Ind."]},
    {"id": "o2", "name": "Borealis Logistics"},
    {"id": "o3", "name": "Cobalt Mining Co"},
]

# Link messy names (one or many) to catalog entries.
found, typo, unknown = em.link(["Acme Industries Inc", "Borealis Logistic", "Zzz Unknown Ltd"], catalog)

# Each result has .chosen_id: the catalog id, or None when nothing fits.
print(found.chosen_id)    # o1   -> matched
print(typo.chosen_id)     # o2   -> matched despite the typo
print(unknown.chosen_id)  # None -> not in the catalog
print(em.explain(found))  # why, in plain words
More examples (rank with history, reconcile documents, run all)

See QUICKSTARTS.md.


Outputs

One result per input. Pick the view: JSONL for code, CSV for a reviewer, XLSX for an owner, Markdown for a PR.

# many inputs from a file -> one row per input, top-5 candidates side by side, empty reviewer column
entmatch match --preset lexical --catalog refs.jsonl --queries queries.csv --out review.csv

Without --preset the CLI uses entmatch-r2, which needs pip install "entmatch[serve]".

FormatWhat you getHow
jsonlRaw result dicts, every fielddefault (stdout) or --out r.jsonl
csv1 row per input, top-5 flattened, plain-words reason, empty reviewer_decision--out r.csv
csv-long1 row per (input, rank): pivot-ready--out r.csv --format csv-long
xlsxsummary + results (colour per decision) + topk sheets--out r.xlsx ([xlsx] extra)
mdReport: counts, thresholds, alerts, top-5 per input--out r.md

All fields, a real input vs the registered catalog with its top-5, and the cost per format: outputs.md.


Architecture

One base model, R2 (preset entmatch-r2), finds the top candidates. A client rules layer after R2 applies each client's knowledge (glossary, typed values, field weights, filters, never-match pairs) without retraining R2. Every client stage is off by default: off = byte-identical output.

Flow: messy input -> glossary expand -> R2 top-K retrieval -> client rules layer (canon, weights, filters, must_match, never_match) -> calibrator and thresholds -> match / review / nil + outputs. Unknown terms go to a reviewer, whose answers feed the knowledge pack used by the glossary and rules.

Full ladder (one diagram per level), stage table, which rule wins when rules conflict, and what is parked: architecture.md.

Features

FeatureStatusDocs
R2 retrieval, calibrated decision match / review / nil, NIL detectoronnil-and-abstain
Export jsonl / csv / csv-long / xlsx / mdonoutputs
Unknown terms report on every entmatch match runonglossary
Client glossary (acronyms, codes, yes/no values), field and client scopedopt-inglossary
Typed value canon (bool, date, number, money, unit, phone, id)opt-invalues
Business field weights and must_matchopt-inbusiness-weights
Semantic weights, category filters, agreement, discard_if_differsopt-insemantic-rules
Versioned client knowledge pack (overlays, never-match, rollback), entmatch packopt-inknowledge-pack
Exact code / ID channelopt-infeature-inventory
Eval protocol (prereg, exact McNemar, headroom, seeds, calibration)dev tooleval-protocol
Learned client reranker (L2)parkedGRAVEYARD

Full status with evidence and numbers per feature: feature-inventory.md.


Supported languages

language status evidence
English measured R2 frozen protocol, 5 seeds, n=750 per cell
Spanish measured same protocol and slices
mixed Spanish/English input unmeasured no mixed-language slice exists
other languages unmeasured no data; base-model coverage not documented here

Measured on synthetic slices, not client data. Known weak spot: Spanish acronyms sit at the floor (top-1 .008-.025) until a glossary is on. Evidence and per-slice numbers: languages.md.

Glossary and business rules

Client knowledge the model cannot know, all opt-in (off = byte-identical output):

  • Glossary: --glossary glossary.csv (columns term, expansion, type, field, client, direction, lang, status). Field-scoped, only approved rows act, acronyms are never assumed: every run writes unknown_terms.md for the client to answer, then entmatch glossary import.
  • Business rules (one YAML, business_weights:): per-field weights, must_match, semantic weights, category filters, agreement, discard_if_differs; never-match pairs live in the client pack.
  • Measured effect per rule, config examples and what is still unmeasured: business-rules.md.

No GPU needed

ENTMATCH-R2 (hosted on Hugging Face: felipedjrg3/entmatch-r2, 2.4 GB) runs on CPU. The first run downloads it once (2.4 GB), then it is cached. Only training needs a GPU, and you do not need to train.

Needs pip install "entmatch[serve]":

CUDA_VISIBLE_DEVICES="" OMP_NUM_THREADS=8 entmatch match --catalog refs.jsonl --query "Oro Plus PPO plan" --preset entmatch-r2 --device cpu --threads 8
WhatMeasured
One query, median229.2 ms
Worst usual case (p95)292.0 ms
Sustained5.63 queries/s
Machine8 CPU cores, no GPU, 3.42 GB RAM

Fewer than 8 cores not measured. Deploy details: HOW_TO_USE.


Learn more

HOW_TO_USEStep-by-step deep dive: install to deploy, client onboarding, unknown-terms loop, knowledge pack, eval protocol
REFERENCECLI, catalog workflow, output fields, ENTMATCH-R2, troubleshooting, dev setup
Examples and skillRunnable examples, and the match skill
OutputsEvery output format, all fields, a worked top-5 example
Languages and business rulesSupported languages with evidence; glossary and client rules, measured effects
ArchitectureR2 + client rules layer after R2, stage order, rule precedence
Accuracy and chartsMeasured results
Site docsQuickstart pages
TroubleshootingCommon problems and fixes
ContributingDev setup. License: Apache-2.0

Metadata

Release files for entmatch 0.3.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for entmatch 0.3.0rc1
File Size Uploaded Provenance Actions
entmatch-0.3.0rc1.tar.gz 277.9 kB With provenance Details for entmatch-0.3.0rc1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for entmatch 0.3.0rc1
File Interpreter ABI Platform Actions
entmatch-0.3.0rc1-py3-none-any.whl Python 3 none any Details for entmatch-0.3.0rc1-py3-none-any.whl

Total release size: 655.3 kB

Release files / entmatch-0.3.0rc1.tar.gz

Download URL entmatch-0.3.0rc1.tar.gz
Size 277.9 kB
Tags Source
SHA-256 checksum
How to use checksums
eb36c64c64da2ed9b058202660ec604bc12c42e19930cdf3060e9c8a46d05bec
BLAKE2b-256 checksum
How to use checksums
f82018f6673c1c5b421e6dd50f1156f60f7e51b5e2921de682293a0df441cc1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / entmatch-0.3.0rc1-py3-none-any.whl

Download URL entmatch-0.3.0rc1-py3-none-any.whl
Size 377.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c89e8d0dbfb25748981f0328c70ecd6fc8101447893662e0dbe0a116f61a6cb2
BLAKE2b-256 checksum
How to use checksums
fdd7b5a91b59b3e4418e162465fd9f71e7333b35178b6011ac14c52c747e5174
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for entmatch 0.3.0rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for entmatch-0.3.0rc1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page