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.
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=approvedrows 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.mdon 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 | 🟢 Sure | GOLD-PPO | 91% |
Hola, el empleado pasa al plan Oro Plus PPO… | 🟡 Not sure | GOLD-PPO (probably) | 75% |
Gold Plus | 🟡 Not sure | GOLD-PPO or GOLD-HMO? | 63% |
Platinum Max EPO | ⚪ Not in catalog | none | 32% |
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 precision | 100.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]".
| Format | What you get | How |
|---|---|---|
jsonl | Raw result dicts, every field | default (stdout) or --out r.jsonl |
csv | 1 row per input, top-5 flattened, plain-words reason, empty reviewer_decision | --out r.csv |
csv-long | 1 row per (input, rank): pivot-ready | --out r.csv --format csv-long |
xlsx | summary + results (colour per decision) + topk sheets | --out r.xlsx ([xlsx] extra) |
md | Report: 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
| Feature | Status | Docs |
|---|---|---|
R2 retrieval, calibrated decision match / review / nil, NIL detector | on | nil-and-abstain |
Export jsonl / csv / csv-long / xlsx / md | on | outputs |
Unknown terms report on every entmatch match run | on | glossary |
| Client glossary (acronyms, codes, yes/no values), field and client scoped | opt-in | glossary |
| Typed value canon (bool, date, number, money, unit, phone, id) | opt-in | values |
Business field weights and must_match | opt-in | business-weights |
Semantic weights, category filters, agreement, discard_if_differs | opt-in | semantic-rules |
Versioned client knowledge pack (overlays, never-match, rollback), entmatch pack | opt-in | knowledge-pack |
| Exact code / ID channel | opt-in | feature-inventory |
| Eval protocol (prereg, exact McNemar, headroom, seeds, calibration) | dev tool | eval-protocol |
| Learned client reranker (L2) | parked | GRAVEYARD |
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(columnsterm, expansion, type, field, client, direction, lang, status). Field-scoped, onlyapprovedrows act, acronyms are never assumed: every run writesunknown_terms.mdfor the client to answer, thenentmatch 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
| What | Measured |
|---|---|
| One query, median | 229.2 ms |
| Worst usual case (p95) | 292.0 ms |
| Sustained | 5.63 queries/s |
| Machine | 8 CPU cores, no GPU, 3.42 GB RAM |
Fewer than 8 cores not measured. Deploy details: HOW_TO_USE.
Learn more
| HOW_TO_USE | Step-by-step deep dive: install to deploy, client onboarding, unknown-terms loop, knowledge pack, eval protocol |
| REFERENCE | CLI, catalog workflow, output fields, ENTMATCH-R2, troubleshooting, dev setup |
| Examples and skill | Runnable examples, and the match skill |
| Outputs | Every output format, all fields, a worked top-5 example |
| Languages and business rules | Supported languages with evidence; glossary and client rules, measured effects |
| Architecture | R2 + client rules layer after R2, stage order, rule precedence |
| Accuracy and charts | Measured results |
| Site docs | Quickstart pages |
| Troubleshooting | Common problems and fixes |
| Contributing | Dev 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)
| 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)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 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 logRelease 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 logSecurity 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.
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 logA 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.