Refresh OpenMed cross-platform model card
Browse files
README.md
CHANGED
|
@@ -1,70 +1,162 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
| 3 |
pipeline_tag: token-classification
|
| 4 |
-
|
| 5 |
tags:
|
| 6 |
- openmed
|
|
|
|
| 7 |
- medical-nlp
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
## OpenMed in Python on CPU
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
```python
|
| 17 |
from openmed import OnnxModel
|
|
|
|
| 18 |
model = OnnxModel.from_pretrained("OpenMed/OpenMed-NER-ProteinDetect-SnowMed-568M-v1-onnx-android")
|
| 19 |
-
entities = model("
|
|
|
|
|
|
|
|
|
|
| 20 |
```
|
| 21 |
|
|
|
|
|
|
|
| 22 |
## OpenMed in Web
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
```typescript
|
| 25 |
import { loadOnnxModel } from "@openmed/openmedkit-web";
|
| 26 |
-
|
| 27 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
```
|
| 29 |
|
| 30 |
## OpenMedKit for Android
|
| 31 |
|
|
|
|
|
|
|
| 32 |
```kotlin
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
```
|
| 36 |
|
| 37 |
-
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
| Languages | en |
|
| 45 |
-
| Tier | Not specified |
|
| 46 |
-
| Parameters | 568M (568,000,000) |
|
| 47 |
-
| Architecture | xlm-roberta |
|
| 48 |
-
| Base model | OpenMed/OpenMed-NER-ProteinDetect-SnowMed-568M |
|
| 49 |
-
| Formats | onnx-android, int8 |
|
| 50 |
-
| License | apache-2.0 |
|
| 51 |
-
| arXiv | [arXiv:2508.01630](https://arxiv.org/abs/2508.01630) |
|
| 52 |
-
| Reproducibility hash | `sha256:52980c11e54355be05351d881b8e8fd8f2ef8f99d2d2ebc0f5ee7cb86e67ee68` |
|
| 53 |
-
| Released | 2026-07-12 |
|
| 54 |
|
| 55 |
-
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
| Not reported | Not reported | Not reported |
|
| 60 |
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
-
|
| 64 |
|
| 65 |
-
##
|
| 66 |
|
| 67 |
-
|
|
| 68 |
|---|---|
|
| 69 |
-
|
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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-ProteinDetect-SnowMed-568M
|
| 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 Protein NER 568M
|
| 22 |
+
|
| 23 |
+
`OpenMed/OpenMed-NER-ProteinDetect-SnowMed-568M-v1-onnx-android`
|
| 24 |
+
|
| 25 |
+
**A 568M XLM-RoBERTa model for extracting protein mentions 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 | Protein named-entity recognition |
|
| 36 |
+
| Language | English |
|
| 37 |
+
| Architecture | XLM-RoBERTa |
|
| 38 |
+
| Parameters | 568M (568,000,000) |
|
| 39 |
+
| Maximum sequence length | 512 tokens |
|
| 40 |
+
| Entity labels | `protein`, `protein_complex`, `protein_enum`, `protein_familiy_or_group`, `protein_variant` |
|
| 41 |
+
| Source model | [`OpenMed/OpenMed-NER-ProteinDetect-SnowMed-568M`](https://huggingface.co/OpenMed/OpenMed-NER-ProteinDetect-SnowMed-568M) |
|
| 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-ProteinDetect-SnowMed-568M-v1-onnx-android")
|
| 54 |
+
entities = model("HER2 expression was elevated in the tumor.")
|
| 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-ProteinDetect-SnowMed-568M-v1-onnx-android";
|
| 72 |
+
const model = await loadOnnxModel(repo);
|
| 73 |
+
const entities = await model("HER2 expression was elevated in the tumor.");
|
| 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("HER2 expression was elevated in the tumor.")
|
| 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 |
+
| `tokenizer.json` | Cross-platform tokenizer |
|
| 130 |
+
| `openmed-onnx.json` | Runtime contract and operator metadata |
|
| 131 |
+
|
| 132 |
+
All graphs use opset 18, dynamic batch and sequence axes, stable tensor names, and source-text offset metadata.
|
| 133 |
+
|
| 134 |
+
## The OpenMed Ecosystem
|
| 135 |
+
|
| 136 |
+
This model is part of **OpenMed**, an Apache-2.0, local-first clinical AI stack:
|
| 137 |
+
|
| 138 |
+
- **1,500+ medical models** for clinical NER, biomedical extraction, and privacy.
|
| 139 |
+
- **PII detection and de-identification** across 55+ identifier types and 17 languages.
|
| 140 |
+
- **Python, MLX, Swift, Android, React Native, Web, REST, and gRPC** runtimes.
|
| 141 |
+
- **Structured and multimodal intake** for OCR, documents, DICOM, FHIR, and HL7.
|
| 142 |
+
- **Offline and air-gapped deployment** with no telemetry by default.
|
| 143 |
+
|
| 144 |
+
## Intended Use and Limitations
|
| 145 |
+
|
| 146 |
+
This model is intended for extracting protein mentions. 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.
|
| 147 |
+
|
| 148 |
+
All examples in this card are synthetic.
|
| 149 |
+
|
| 150 |
+
## Citation
|
| 151 |
+
|
| 152 |
+
```bibtex
|
| 153 |
+
@misc{panahi2025openmedneropensourcedomainadapted,
|
| 154 |
+
title={OpenMed NER: Open-Source, Domain-Adapted State-of-the-Art
|
| 155 |
+
Transformers for Biomedical NER Across 12 Public Datasets},
|
| 156 |
+
author={Maziyar Panahi},
|
| 157 |
+
year={2025},
|
| 158 |
+
eprint={2508.01630},
|
| 159 |
+
archivePrefix={arXiv},
|
| 160 |
+
primaryClass={cs.CL}
|
| 161 |
+
}
|
| 162 |
+
```
|