MaziyarPanahi commited on
Commit
b3eeba8
·
verified ·
1 Parent(s): 961c1f3

Refresh OpenMed cross-platform model card

Browse files
Files changed (1) hide show
  1. README.md +127 -34
README.md CHANGED
@@ -1,70 +1,163 @@
1
  ---
 
2
  license: apache-2.0
 
 
3
  pipeline_tag: token-classification
4
- library_name: openmed
5
  tags:
6
  - openmed
 
7
  - medical-nlp
 
 
 
 
8
  ---
9
 
10
- # OpenMed-NER-PathologyDetect-TinyMed-65M-v1-onnx-android
 
 
 
 
 
 
 
 
 
 
 
11
 
12
- This model card is rendered from the OpenMed model manifest. Update `models.jsonl` and rerun the publish step instead of editing this file directly.
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  ## OpenMed in Python on CPU
15
 
 
 
 
 
16
  ```python
17
  from openmed import OnnxModel
 
18
  model = OnnxModel.from_pretrained("OpenMed/OpenMed-NER-PathologyDetect-TinyMed-65M-v1-onnx-android")
19
- entities = model("Patient Alice Nguyen was seen in cardiology.")
 
 
 
20
  ```
21
 
 
 
22
  ## OpenMed in Web
23
 
 
 
 
 
24
  ```typescript
25
  import { loadOnnxModel } from "@openmed/openmedkit-web";
26
- const model = await loadOnnxModel("OpenMed/OpenMed-NER-PathologyDetect-TinyMed-65M-v1-onnx-android");
27
- const entities = await model("Patient Alice Nguyen was seen in cardiology.");
 
 
 
 
 
 
 
 
 
 
 
28
  ```
29
 
30
  ## OpenMedKit for Android
31
 
 
 
32
  ```kotlin
33
- val model = OpenMedKit.fromDirectory(modelDirectory)
34
- val entities = model.analyzeText("Patient Alice Nguyen was seen in cardiology.")
 
 
 
 
 
 
 
 
35
  ```
36
 
37
- ## Manifest Summary
38
 
39
- | Field | Value |
40
- |---|---|
41
- | Repository | `OpenMed/OpenMed-NER-PathologyDetect-TinyMed-65M-v1-onnx-android` |
42
- | Family | NER |
43
- | Task | token-classification |
44
- | Languages | en |
45
- | Tier | Tiny |
46
- | Parameters | 65M (65,000,000) |
47
- | Architecture | distilbert |
48
- | Base model | OpenMed/OpenMed-NER-PathologyDetect-TinyMed-65M |
49
- | Formats | onnx-android, int8, ort-android |
50
- | License | apache-2.0 |
51
- | arXiv | [arXiv:2508.01630](https://arxiv.org/abs/2508.01630) |
52
- | Reproducibility hash | `sha256:2c4c1ab9f259bc95c8c116a658769e4714101607459b231950420826c705d87a` |
53
- | Released | 2026-07-09 |
54
 
55
- ## Benchmark
56
 
57
- | Dataset | Micro F1 | Recall |
58
- |---|---:|---:|
59
- | Not reported | Not reported | Not reported |
60
 
61
- ## Canonical Labels
 
 
 
62
 
63
- `Disease`
64
 
65
- ## Artifact Format
66
 
67
- | Field | Value |
68
  |---|---|
69
- | Runtime artifacts | onnx-android, ort-android |
70
- | Quantization | int8 |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ library_name: openmed
3
  license: apache-2.0
4
+ language:
5
+ - en
6
  pipeline_tag: token-classification
7
+ base_model: OpenMed/OpenMed-NER-PathologyDetect-TinyMed-65M
8
  tags:
9
  - openmed
10
+ - onnx
11
  - medical-nlp
12
+ - medical-ner
13
+ - android
14
+ - webassembly
15
+ - webgpu
16
  ---
17
 
18
+ <div align="center">
19
+ <img src="https://raw.githubusercontent.com/maziyarpanahi/openmed/master/docs/brand/openmed-mascot-lockup.png" alt="OpenMed: on-device clinical AI" width="360">
20
+
21
+ # OpenMed Pathology NER 65M
22
+
23
+ `OpenMed/OpenMed-NER-PathologyDetect-TinyMed-65M-v1-onnx-android`
24
+
25
+ **A 65M DistilBERT model for extracting pathology findings in English clinical and biomedical text.**
26
+ Runs locally after download on Python CPU, in the browser, and on Android.
27
+
28
+ [OpenMed](https://github.com/maziyarpanahi/openmed) | [Documentation](https://openmed.life/docs) | [Model collection](https://huggingface.co/OpenMed) | [Paper](https://arxiv.org/abs/2508.01630)
29
+ </div>
30
 
31
+ ## Model
32
+
33
+ | Field | Value |
34
+ |---|---|
35
+ | Task | Pathology named-entity recognition |
36
+ | Language | English |
37
+ | Architecture | DistilBERT |
38
+ | Parameters | 65M (65,000,000) |
39
+ | Maximum sequence length | 512 tokens |
40
+ | Entity labels | `Disease` |
41
+ | Source model | [`OpenMed/OpenMed-NER-PathologyDetect-TinyMed-65M`](https://huggingface.co/OpenMed/OpenMed-NER-PathologyDetect-TinyMed-65M) |
42
+ | License | apache-2.0 |
43
 
44
  ## OpenMed in Python on CPU
45
 
46
+ ```bash
47
+ pip install "openmed[onnx-runtime]>=1.8.2"
48
+ ```
49
+
50
  ```python
51
  from openmed import OnnxModel
52
+
53
  model = OnnxModel.from_pretrained("OpenMed/OpenMed-NER-PathologyDetect-TinyMed-65M-v1-onnx-android")
54
+ entities = model("Pathology showed invasive ductal carcinoma.")
55
+
56
+ for entity in entities:
57
+ print(entity.to_dict())
58
  ```
59
 
60
+ OpenMed selects the CPU-oriented INT8 graph by default and returns labels, confidence scores, exact character offsets, and source text.
61
+
62
  ## OpenMed in Web
63
 
64
+ ```bash
65
+ npm install @openmed/openmedkit-web @huggingface/transformers onnxruntime-web
66
+ ```
67
+
68
  ```typescript
69
  import { loadOnnxModel } from "@openmed/openmedkit-web";
70
+
71
+ const repo = "OpenMed/OpenMed-NER-PathologyDetect-TinyMed-65M-v1-onnx-android";
72
+ const model = await loadOnnxModel(repo);
73
+ const entities = await model("Pathology showed invasive ductal carcinoma.");
74
+ ```
75
+
76
+ The default INT8 path runs with WebAssembly. For WebGPU, select the FP16 graph:
77
+
78
+ ```typescript
79
+ const model = await loadOnnxModel(repo, {
80
+ variant: "fp16",
81
+ device: "webgpu",
82
+ });
83
  ```
84
 
85
  ## OpenMedKit for Android
86
 
87
+ Add JitPack to the consumer application's `settings.gradle.kts`:
88
+
89
  ```kotlin
90
+ dependencyResolutionManagement {
91
+ repositories {
92
+ google()
93
+ mavenCentral()
94
+ maven {
95
+ url = uri("https://jitpack.io")
96
+ content { includeGroup("com.github.maziyarpanahi") }
97
+ }
98
+ }
99
+ }
100
  ```
101
 
102
+ Use the matching OpenMed GitHub release tag:
103
 
104
+ ```kotlin
105
+ dependencies {
106
+ implementation("com.github.maziyarpanahi:openmed:v1.8.2")
107
+ }
108
+ ```
 
 
 
 
 
 
 
 
 
 
109
 
110
+ After downloading this model repository into an app-controlled directory:
111
 
112
+ ```kotlin
113
+ import com.openmed.openmedkit.OpenMedKit
 
114
 
115
+ OpenMedKit.fromDirectory(modelDirectory).use { model ->
116
+ val entities = model.analyzeText("Pathology showed invasive ductal carcinoma.")
117
+ }
118
+ ```
119
 
120
+ Inference and tokenization remain on-device.
121
 
122
+ ## Included Artifacts
123
 
124
+ | Artifact | Recommended use |
125
  |---|---|
126
+ | `model_int8.onnx` | CPU, WebAssembly, and Android default |
127
+ | `model_fp16.onnx` | WebGPU and compatible accelerated runtimes |
128
+ | `model.onnx` | Full-precision reference |
129
+ | `model.ort` | Custom ONNX Runtime Mobile integration |
130
+ | `tokenizer.json` | Cross-platform tokenizer |
131
+ | `openmed-onnx.json` | Runtime contract and operator metadata |
132
+
133
+ All graphs use opset 18, dynamic batch and sequence axes, stable tensor names, and source-text offset metadata.
134
+
135
+ ## The OpenMed Ecosystem
136
+
137
+ This model is part of **OpenMed**, an Apache-2.0, local-first clinical AI stack:
138
+
139
+ - **1,500+ medical models** for clinical NER, biomedical extraction, and privacy.
140
+ - **PII detection and de-identification** across 55+ identifier types and 17 languages.
141
+ - **Python, MLX, Swift, Android, React Native, Web, REST, and gRPC** runtimes.
142
+ - **Structured and multimodal intake** for OCR, documents, DICOM, FHIR, and HL7.
143
+ - **Offline and air-gapped deployment** with no telemetry by default.
144
+
145
+ ## Intended Use and Limitations
146
+
147
+ This model is intended for extracting pathology findings. It does not diagnose conditions or make clinical decisions. Evaluate recall, thresholds, and span behavior on appropriately governed data before deployment. Local execution supports privacy-preserving workflows but does not by itself guarantee regulatory compliance.
148
+
149
+ All examples in this card are synthetic.
150
+
151
+ ## Citation
152
+
153
+ ```bibtex
154
+ @misc{panahi2025openmedneropensourcedomainadapted,
155
+ title={OpenMed NER: Open-Source, Domain-Adapted State-of-the-Art
156
+ Transformers for Biomedical NER Across 12 Public Datasets},
157
+ author={Maziyar Panahi},
158
+ year={2025},
159
+ eprint={2508.01630},
160
+ archivePrefix={arXiv},
161
+ primaryClass={cs.CL}
162
+ }
163
+ ```