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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43b90156286e87ec2c00aa1bd1045b8bb1e910470f3c09f5692e3e01ca00cf76
|
|
| MD5 |
e1f259a4c8ea3b6ebc82d5a572e7f372
|
|
| BLAKE2b-256 |
d9455f5ab2136f1446ba6caa99d2fbaecf459ef304ecb40ccdd9fa8182a72195
|
Provenance
The following attestation bundles were made for meddeid_core-0.1.1.tar.gz:
Publisher:
publish-python.yml on stighellemans/meddeid-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meddeid_core-0.1.1.tar.gz -
Subject digest:
43b90156286e87ec2c00aa1bd1045b8bb1e910470f3c09f5692e3e01ca00cf76 - Sigstore transparency entry: 2498915895
- Sigstore integration time:
-
Permalink:
stighellemans/meddeid-core@6a84d9285c520ec347749961ff6f6f1235a4f747 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/stighellemans
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@6a84d9285c520ec347749961ff6f6f1235a4f747 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72c82275588e8a9e95892e8db078293845c4878ca96232f73099aea4ed9e601e
|
|
| MD5 |
a12c063bff452eef120012cab58a9a49
|
|
| BLAKE2b-256 |
a8f4e7676264554051b963107aff3ffc63fc6c26dfc3463bbb6c27f82fe92ff6
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meddeid_core-0.1.1-py3-none-any.whl -
Subject digest:
72c82275588e8a9e95892e8db078293845c4878ca96232f73099aea4ed9e601e - Sigstore transparency entry: 2498915908
- Sigstore integration time:
-
Permalink:
stighellemans/meddeid-core@6a84d9285c520ec347749961ff6f6f1235a4f747 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/stighellemans
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@6a84d9285c520ec347749961ff6f6f1235a4f747 -
Trigger Event:
push
-
Statement type: