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.

Install meddeid-training[plots] together with the training dependencies to guarantee Matplotlib availability. Every run then writes readable loss and task-specific F1 small multiples under RUN/plots/ as both PNG and searchable vector PDF. Plotting remains optional and never makes training fail.

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.

Metadata

Release files for meddeid-training 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for meddeid-training 0.3.0
File Size Uploaded
meddeid_training-0.3.0.tar.gz 52.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for meddeid-training 0.3.0
File Interpreter ABI Platform
meddeid_training-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 101.2 kB

Release files / meddeid_training-0.3.0.tar.gz

Download URL meddeid_training-0.3.0.tar.gz
Size 52.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e95b0a2d888d2bbe73d3e54f62367bb4e31d70bc2a5d20b22ab2dcb3b05d52c8
BLAKE2b-256 checksum
How to use checksums
c293d80b771b274a0d8236c800042dbb19b9a65547351b0c51b7d83c2b79b929
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 8, 2026.

Transparency log

Release files / meddeid_training-0.3.0-py3-none-any.whl

Download URL meddeid_training-0.3.0-py3-none-any.whl
Size 48.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b02bffea6791a58567a06da841b95b60f21355c7196dd20e073fce6146f4cbce
BLAKE2b-256 checksum
How to use checksums
d8a8e50709534e91d0e61ad934b0dd66b2cd00827c90f31fb86a9b51813093d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.1

2 release files

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release 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