Skip to main content

meddeid-core

meddeid-core provides the language-neutral contracts shared by the MedDeID suite: the document schema, 15-label data taxonomy, ordered 14-label model head, record normalization, and character-offset validation.

The suite documentation explains how this contract moves through MedDeID workflows. This repository is the authority for the schema, taxonomy, label order, and offset rules.

Installation

pip install meddeid-core

Install the optional Pydantic models with:

pip install 'meddeid-core[models]'

Python API

from meddeid_core import BERT_ENTITY_LABELS, normalize_record, validate_record

record = normalize_record(record)
validate_record(record)

MedDeID uses half-open [begin, end) offsets measured in Unicode code points. The only canonical top-level span container is spans.

The core package also owns the language-neutral meddeid.age-granularity.v1 JSON contract. load_age_granularity_policy() loads the packaged default, a custom JSON path, or a mapping and returns its validated calendar generalizer and deterministic identity. Language packages remain responsible only for parsing and localized rendering.

Benchmark subannotations are nested under their parent primary span. A non-empty subannotation list must be a complete, contiguous partition of the parent, and all offsets remain absolute document offsets:

{
  "begin": 0,
  "end": 11,
  "text": "Jan Peeters",
  "label": "Name:Patient",
  "category": "Name",
  "subtype": "Patient",
  "subannotations": [
    {"begin": 0, "end": 3, "text": "Jan", "category": "given"},
    {"begin": 3, "end": 4, "text": " ", "category": "formatting"},
    {"begin": 4, "end": 11, "text": "Peeters", "category": "family"}
  ]
}

Normalize canonical JSONL

The normalizer standardizes fields within records that use the canonical document_id, text, and spans containers. For example, it can convert start to begin:

meddeid-normalize-jsonl input.jsonl normalized.jsonl

Other top-level span containers, including annotations, entities, deid_spans, and items, are not part of the MedDeID schema and are rejected.

Taxonomy contract

The Python taxonomy is authoritative. The generated language-neutral contract is committed at contracts/taxonomy.json for JavaScript and non-Python consumers. After an intentional taxonomy change, regenerate it with:

python scripts/export_contracts.py

Language-specific behavior belongs in packages such as meddeid-language-nl; this package has no language rules or model runtime.

Development

pip install -e '.[dev]'
pytest

Licence

AGPL-3.0-only. See NOTICE for attribution information.

Download files

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

Source Distribution

meddeid_core-0.2.0.tar.gz (42.1 kB view details)

Uploaded Source

Built Distribution

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

meddeid_core-0.2.0-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

Details for the file meddeid_core-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for meddeid_core-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1e0eeb530bdba138bbe8f1b16775680a42318aa9fa3b145e5335ff570aaab4fb
MD5 1a5ac4f16e5bf95bff59a48338d031c1
BLAKE2b-256 927a73652a0692c5f5138cd059f3c51ea17e759472237491d452bf0bf7313370

See more details on using hashes here.

Provenance

The following attestation bundles were made for meddeid_core-0.2.0.tar.gz:

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

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_core-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: meddeid_core-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 39.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for meddeid_core-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60e2f8c4771921729f1671d5437e3f1d8093fd223567534b0b27c4322c8f5bdd
MD5 080a35aca0bde68a6085a1b4fcc1b51f
BLAKE2b-256 ff20d27d60ae92f92633f5f4a8b27a72a6ee3589111ae71a3ca083bd8fe344ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for meddeid_core-0.2.0-py3-none-any.whl:

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

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

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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