Skip to main content

Standard Classification Alignment & Local Enrichment - Automate audit and enrichment of industrial classifications

Project description

SCALE: Standard Classification Alignment & Local Enrichment

Automate the audit and enrichment of national classifications (e.g., KBLI) using international standards (e.g., ISIC, NACE), or other national standard classifications.

Features

  • Bidirectional Asymmetric Retrieval: Captures hierarchical "entailment" relationships common in classifications
  • Competitive Selection: Max-score + margin algorithm for controlled mapping while minimizing noise
  • E5-Large-Instruct Model: Optimized for asymmetric retrieval tasks

Installation

pip install scale-align

Quick Start

scale-align \
    --source-dir /path/to/isic5 \
    --target-dir /path/to/nace21 \
    --correspondence correspondence.json \
    --output-dir ./output

Input Format

Classification Files

Text files with sentences separated by newlines:

/path/to/isic5/A.txt
/path/to/isic5/A0111.txt

Correspondence JSON

[["A","A"],["A0111","A01.11"],["A0112","A01.12"]]

Output Format

Each output file {source_code}_{target_code}.txt contains:

[0]:[0,1]:0.87439287
[1,2]:[2]:0.92
[3]:[]:0
[4]:[3]:0.9999999
  • [source_indices]:[target_indices]:score
  • Empty brackets [] indicate no alignment (gap detected)

CLI Options

Option Default Description
--threshold 0.7 Minimum similarity score
--margin 0.05 Margin from champion score
--batch-size 32 Embedding batch size
--device auto Device (cuda/cpu/auto)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scale_align-0.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scale_align-0.1.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file scale_align-0.1.0.tar.gz.

File metadata

  • Download URL: scale_align-0.1.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scale_align-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b0d2a807124ed333f3ac0f1369a9b0a6005e81e55855e73459521f8c803289e4
MD5 81093472e4eb439e907de8056cc1536e
BLAKE2b-256 07b2c9cc726e3e40c0e19189eca28a744ca63e8ad72e55fbd3f56ed454fb1d36

See more details on using hashes here.

Provenance

The following attestation bundles were made for scale_align-0.1.0.tar.gz:

Publisher: publish.yml on mdmahendri/scale-align

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scale_align-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: scale_align-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scale_align-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 72e245d9aea0b82bd7dc1b9f256ef0dbfa6fcdfbe022aebbddf1e9a47c3987a6
MD5 d14ed150692f808d724c9b269911cbf9
BLAKE2b-256 2b084f59b443a79c68ac1cc99629e1323808a04a5e20b9ddafdc69df6eba3de4

See more details on using hashes here.

Provenance

The following attestation bundles were made for scale_align-0.1.0-py3-none-any.whl:

Publisher: publish.yml on mdmahendri/scale-align

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page