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.

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.1.1.tar.gz (34.7 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.1.1-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: meddeid_core-0.1.1.tar.gz
  • Upload date:
  • Size: 34.7 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.1.1.tar.gz
Algorithm Hash digest
SHA256 43b90156286e87ec2c00aa1bd1045b8bb1e910470f3c09f5692e3e01ca00cf76
MD5 e1f259a4c8ea3b6ebc82d5a572e7f372
BLAKE2b-256 d9455f5ab2136f1446ba6caa99d2fbaecf459ef304ecb40ccdd9fa8182a72195

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: meddeid_core-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 32.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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 72c82275588e8a9e95892e8db078293845c4878ca96232f73099aea4ed9e601e
MD5 a12c063bff452eef120012cab58a9a49
BLAKE2b-256 a8f4e7676264554051b963107aff3ffc63fc6c26dfc3463bbb6c27f82fe92ff6

See more details on using hashes here.

Provenance

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

0.2.0

2 files

This release

0.1.1 This release

2 files

0.1.0

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