Skip to main content

meddeid-training

Training and export tools for MedDeID sequence-labeling models. Researchers can run one ordinary fit, while release workflows can separate epoch selection from the final full-data fit so a benchmark remains sealed during model selection.

The training and evaluation workflow shows the cross-suite handoffs. This repository and its training protocol remain authoritative for configuration, fitting, refitting, and export.

Installation

python -m pip install 'meddeid-training[train]'

One-time training

For an ordinary research run, fit once using separate train, validation, and test files. Validation chooses the best checkpoint and the test set is evaluated after training:

meddeid-train fit \
  --config configs/release.yaml \
  --data prepared/fit \
  --run runs/fit

Use --epochs N to override the maximum configured epoch count. The resulting checkpoint is runs/fit/checkpoints/best.pt.

Publication protocol

  1. Create a held-out validation subset from the 6,493-document synthetic development corpus.
  2. Select an epoch count using only that validation subset.
  3. Restart from the configured initial model and refit on the complete corpus for the selected number of epochs.
  4. Evaluate once on the independent 300-document synthetic benchmark.
  5. Export a self-contained Safetensors model bundle.
meddeid-train select-epochs \
  --config configs/release.yaml \
  --data prepared/selection \
  --run runs/selection

meddeid-train refit \
  --config configs/release.yaml \
  --selection runs/selection/run.json \
  --data prepared/refit \
  --run runs/refit

meddeid-train export \
  --checkpoint runs/refit/checkpoints/best.pt \
  --run-metadata runs/refit/train_metrics.json \
  --output release/meddeid-dutch-synth

configs/release.yaml initializes both stages from the complete stighellemans/meddeid-dutch-synth bundle, including its encoder and trained classifier heads. To train new heads from a base encoder, set that encoder as model_name and pin its immutable model_revision.

The select-epochs and refit commands deliberately name the two stages of this stricter protocol; they are not required for an ordinary one-time fit. Selection and refit always restart independently from the configured initial model; refit never continues from the selection checkpoint. Dataset manifests, model revisions, ordered labels, run configuration, and output checksums are recorded for reproducibility.

See Release training protocol for input layout, stage invariants, configuration, and export requirements.

Development

pip install -e '.[dev]'
pytest

Licence

AGPL-3.0-only. Datasets and model artifacts are distributed separately under the terms stated with each artifact.

Download files

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

Source Distribution

meddeid_training-0.1.0.tar.gz (45.2 kB view details)

Uploaded Source

Built Distribution

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

meddeid_training-0.1.0-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: meddeid_training-0.1.0.tar.gz
  • Upload date:
  • Size: 45.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for meddeid_training-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4e26e5222c728f92414717a3cded8346f5a656bc90ea7663c1e83dae2d96d265
MD5 bed03cde904ad61054b773447c7501df
BLAKE2b-256 f08bebd1bbcb4d810df3ac326cccf92b823d784252691619c4faecc9c80ba350

See more details on using hashes here.

Provenance

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

Publisher: publish-python.yml on stighellemans/meddeid-training

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

File details

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

File metadata

File hashes

Hashes for meddeid_training-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3909c83fb8d1099e06bbedd7376049fdeb5f308de7834357282f8c1dc365ce54
MD5 48328a53e6986db7b925784023ba0f58
BLAKE2b-256 2645d937f79fc3586f45eddce2a39047cedef9b945c2a621aa98a6b496d4457c

See more details on using hashes here.

Provenance

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

Publisher: publish-python.yml on stighellemans/meddeid-training

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

Release history Release notifications | RSS feed

0.2.0

2 files

0.1.1

2 files

This release

0.1.0 This release

2 files

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