Views
No views yet
OpenMed/OpenMed-PII-Dutch-ClinicalE5-Base-109M-v1 for Apple Silicon inference with OpenMed.OpenMed/OpenMed-PII-Dutch-ClinicalE5-Base-109M-v1bert (BertForTokenClassification)nl)config.json, id2label.json, MLX weight files)openmed[mlx] on Apple Silicon Macspip install "openmed[mlx]"1from openmed import extract_pii
2
3text = "<your Dutch clinical note here>"
4result = extract_pii(
5 text,
6 model_name="OpenMed/OpenMed-PII-Dutch-ClinicalE5-Base-109M-v1",
7 lang="nl",
8 use_smart_merging=True,
9)
10
11for entity in result.entities:
12 print(entity.label, entity.text, round(entity.confidence, 4))openmed[mlx] is installed. On other systems it falls back to the Hugging Face / PyTorch backend.1pip install "openmed[mlx]"
2hf download OpenMed/OpenMed-PII-Dutch-ClinicalE5-Base-109M-v1-mlx --local-dir ./OpenMed-PII-Dutch-ClinicalE5-Base-109M-v1-mlxhf auth login or set HF_TOKEN.1from openmed import extract_pii
2from openmed.core import OpenMedConfig
3
4text = "<your Dutch clinical note here>"
5result = extract_pii(
6 text,
7 model_name="./OpenMed-PII-Dutch-ClinicalE5-Base-109M-v1-mlx",
8 config=OpenMedConfig(backend="mlx"),
9 lang="nl",
10 use_smart_merging=True,
11)
12
13print(result.entities)1import OpenMedKit
2
3let modelDirectory = try await OpenMedModelStore.downloadMLXModel(
4 repoID: "OpenMed/OpenMed-PII-Dutch-ClinicalE5-Base-109M-v1-mlx",
5 authToken: "<hugging-face-token-while-private>"
6)
7
8let openmed = try OpenMed(
9 backend: .mlx(modelDirectoryURL: modelDirectory)
10)
11
12let entities = try openmed.extractPII(
13 "<your Dutch clinical note here>"
14).mlmodelc or .mlpackage, use the CoreML backend in OpenMedKit instead.config.jsonid2label.jsonweights.safetensors and/or weights.npz)config.json when needed.OpenMed/OpenMed-PII-Dutch-ClinicalE5-Base-109M-v1