regulatory-crosswalk
Transparent semantic-similarity scoring, plus a human-adjudication review queue, for mapping one regulatory or standards corpus onto another.
Built for compliance analysts, auditors, and researchers who need to reconcile overlapping requirements across frameworks (e.g., a sector regulator's rule vs. NIST CSF, SP 800-53, or a CIS/CPG-style baseline) and want the reasoning behind every mapping decision to be logged, not just the final table.
Why TF-IDF, not an embedding model?
This package deliberately scores with TF-IDF cosine similarity rather than
a sentence-embedding model. Every score here is reproducible from the two
input CSVs alone — no model weights to pin, no GPU, no network call, and a
score you can hand-verify by eye (shared words are visible in the
shared_terms_hint column). This is a design trade-off, not a claim that
lexical similarity is the best possible scorer: it under-detects genuine
paraphrases (see Limitations below). Treat its output as a triage aid for a
human reviewer, not a finished classification — that's the point of the
adjudication-queue step.
Install
pip install regulatory-crosswalk
Usage
Python API
import pandas as pd
from regulatory_crosswalk import align_corpora, build_review_queue
source = pd.read_csv("my_requirements.csv") # columns: id, text
target = pd.read_csv("their_controls.csv") # columns: id, text
candidates = align_corpora(source, target, target_name="TargetFramework", top_k=3)
queue = build_review_queue(candidates)
queue.to_csv("adjudication_log.csv", index=False)
queue has empty adjudicated_alignment_type, adjudicator,
adjudication_rationale, and adjudication_date columns — a human
reviewer fills these in. The filled-in queue, not the raw candidates
table, is the citable crosswalk result.
CLI
regcrosswalk align source.csv target.csv --target-name CSF2.0 -o candidates.csv
regcrosswalk adjudicate candidates.csv -o adjudication_log.csv
Run regcrosswalk align --help / regcrosswalk adjudicate --help for all
options (custom column names, thresholds, top-k, sample size).
Worked example
This package was extracted from, and is used by, a real crosswalk between
the TSA Pipeline Security Guidelines and NIST CSF 2.0 / SP 800-53 / CISA
CPG v1.0.1 — see the parent repository's code/ directory for the full,
real-data pipeline this library powers.
Limitations
- TF-IDF cosine similarity is lexical, not semantic: two genuinely equivalent statements with no shared vocabulary will score near zero. Expect a non-trivial "No Match" rate driven by phrasing, not by a true absence of overlap — that's exactly the case for keeping a human adjudicator in the loop.
- The default thresholds (Direct ≥0.30, Partial ≥0.18, Related ≥0.08) are heuristic. Calibrate them against your own corpus's score distribution rather than assuming they transfer.
build_review_queue's default priority rule (every Direct/Partial match is "high," a sample of "No Match" rows is spot-checked) is a starting point; pass your ownpriority_fnfor a different policy.
License
MIT. See LICENSE.
Citing
If you use this package in published work, please cite it — see
CITATION.cff in the repository root.
Metadata
Release files for regulatory-crosswalk 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| regulatory_crosswalk-1.0.1.tar.gz | 11.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| regulatory_crosswalk-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.9 kB
Release files / regulatory_crosswalk-1.0.1.tar.gz
| Download URL | regulatory_crosswalk-1.0.1.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c652ef51e6abc6798997f66e43047cae17f58d001b0e1d8266fe7f4768651599
|
|
BLAKE2b-256 checksum How to use checksums |
b5c094dc8f25b551ebd952f31a4e85998f06f0e610f3765cb70cf8815205136b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / regulatory_crosswalk-1.0.1-py3-none-any.whl
| Download URL | regulatory_crosswalk-1.0.1-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3aa312d1318087426b3c3be1e4d1bf699b0e4d341ce13c92a19cd343e9432a20
|
|
BLAKE2b-256 checksum How to use checksums |
7bea856e4e47138eedbd0072bfeff6e69d94f952b1b7fd03523086c38efe9030
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|