OpenMed/OpenMed-NER-DNADetect-ModernMed-395M-v1-onnx-android
A 395M ModernBERT model for extracting DNA and gene mentions in English clinical and biomedical text.
Runs locally after download on Python CPU, in the browser, and on Android.
OpenMed | Documentation | Model collection | Paper
| Field | Value |
|---|---|
| Task | DNA named-entity recognition |
| Language | English |
| Architecture | ModernBERT |
| Parameters | 395M (395,000,000) |
| Maximum sequence length | 512 tokens |
| Entity labels | DNA, RNA, cell_line, cell_type, protein |
| Source model | OpenMed/OpenMed-NER-DNADetect-ModernMed-395M |
| License | apache-2.0 |
pip install --upgrade "openmed[onnx-runtime]"
from openmed import OnnxModel
model = OnnxModel.from_pretrained("OpenMed/OpenMed-NER-DNADetect-ModernMed-395M-v1-onnx-android")
entities = model("A BRCA1 mutation was detected in the tumor sample.")
for entity in entities:
print(entity.to_dict())
OpenMed selects the CPU-oriented INT8 graph by default and returns labels, confidence scores, exact character offsets, and source text.
npm install openmed @huggingface/transformers onnxruntime-web
import { loadOnnxModel } from "openmed";
const repo = "OpenMed/OpenMed-NER-DNADetect-ModernMed-395M-v1-onnx-android";
const model = await loadOnnxModel(repo);
const entities = await model("A BRCA1 mutation was detected in the tumor sample.");
The default INT8 path runs with WebAssembly. For WebGPU, select the FP16 graph:
const model = await loadOnnxModel(repo, {
variant: "fp16",
device: "webgpu",
});
Add JitPack to the consumer application's settings.gradle.kts:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven {
url = uri("https://jitpack.io")
content { includeGroup("com.github.maziyarpanahi") }
}
}
}
Use the latest OpenMed build from the master branch:
dependencies {
implementation("com.github.maziyarpanahi:openmed:master-SNAPSHOT")
}
After downloading this model repository into an app-controlled directory:
import com.openmed.openmedkit.OpenMedKit
OpenMedKit.fromDirectory(modelDirectory).use { model ->
val entities = model.analyzeText("A BRCA1 mutation was detected in the tumor sample.")
}
Inference and tokenization remain on-device.
| Artifact | Recommended use |
|---|---|
model_int8.onnx |
CPU, WebAssembly, and Android default |
model_fp16.onnx |
WebGPU and compatible accelerated runtimes |
model.onnx |
Full-precision reference |
model.ort |
Custom ONNX Runtime Mobile integration |
tokenizer.json |
Cross-platform tokenizer |
openmed-onnx.json |
Runtime contract and operator metadata |
All graphs use opset 18, dynamic batch and sequence axes, stable tensor names, and source-text offset metadata.
This model is part of OpenMed, an Apache-2.0, local-first clinical AI stack:
This model is intended for extracting DNA and gene 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.
All examples in this card are synthetic.
@misc{panahi2025openmedneropensourcedomainadapted,
title={OpenMed NER: Open-Source, Domain-Adapted State-of-the-Art
Transformers for Biomedical NER Across 12 Public Datasets},
author={Maziyar Panahi},
year={2025},
eprint={2508.01630},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
Have the files? Publish a torrent.
Publish a torrentHave the complete files and permission to share them? Replace the example folder path. The script checks the files, makes a torrent and submits its magnet and checksums. Keep your torrent client seeding. Get your community key from your settings, and read the script before running it.
curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo OpenMed/OpenMed-NER-DNADetect-ModernMed-395M-v1-onnx-android ./model-foldermodel.onnx 1.6 GBmodel_fp16.onnx 793 MBmodel_int8.onnx 552 MBOpenMed/OpenMed-NER-DNADetect-ModernMed-395M