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
  • Multilingual E5-Large-Instruct Model: Instruction-tuned model optimized for asymmetric retrieval tasks

Installation

pip install scale-align

Google Colab

Using in Google Colab? Try our Colab Notebook.

Open In Colab

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.1.tar.gz (14.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.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scale_align-0.1.1.tar.gz
  • Upload date:
  • Size: 14.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.1.tar.gz
Algorithm Hash digest
SHA256 c9968df445ea4c8e2c3f7f1f69a40babc6111b4de122ac75579098e08f19869b
MD5 576fe2b1d295a474614ca30bc7bb36a5
BLAKE2b-256 01d933e5795283dc2310b2a20f343121d70d86dce2ffbcd5876dca376e312591

See more details on using hashes here.

Provenance

The following attestation bundles were made for scale_align-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: scale_align-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f17e7b9619b6dc7ea16bbf4f53baa5583d402bb72abd78de197e71e0145f51ef
MD5 a11064e5c56b0acee0c24a69450f5182
BLAKE2b-256 32ab82f14969a85dfc8b986d54bfe1984b12e895f2ccc08a037d54cf7639e749

See more details on using hashes here.

Provenance

The following attestation bundles were made for scale_align-0.1.1-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