Downloads · 30 days
44
10% of all-time downloads
joelmontavon/fhir4px-embeddings-onnx
fhir4px-embeddings-onnx is a machine learning model from joelmontavon. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Pre-converted ONNX versions of embedding models used by fhir4px for Tier 3 categorization.
Downloads · 30 days
44
10% of all-time downloads
All-time downloads
426
Public
Repo size
606 MB
Likes
0
Public
Click a slice to open those files.
.onnx546 MB · 94%
From the Hugging Face model README
Pre-converted ONNX versions of embedding models used by fhir4px for Tier 3 categorization.
pubmedbert-base-embeddings/NeuML/pubmedbert-base-embeddings converted to ONNX format for use with transformers.js.
Files:
onnx/model.onnx — fp32 (416MB)onnx/model_quantized.onnx — int8 dynamic quantization (105MB, production)config.json, tokenizer.json, tokenizer_config.json, vocab.txt, special_tokens_map.jsonWhy this model:
docs/INTEGRATION.md)Usage:
import { pipeline, env } from "@huggingface/transformers";
env.allowRemoteModels = true;
const extractor = await pipeline(
"feature-extraction",
"joelmontavon/fhir4px-embeddings-onnx",
{
dtype: "q8",
subfolder: "pubmedbert-base-embeddings",
}
);
const output = await extractor(texts, { pooling: "mean", normalize: true });
centroids/)Each classification task has a JSON file with precomputed centroids (768-dim, L2-normalized). When the centroid field is present, the runtime classifier skips prototype embedding entirely.
Files:
centroids/observation_category.json — lab / vital / other (34 prototypes)centroids/allergy_type.json — medication / food / environmental / other (32 prototypes)centroids/visit_type.json — inpatient / outpatient / emergency / telehealth / procedure (25 prototypes)Format:
{
"task": "observation_category",
"model": "joelmontavon/fhir4px-embeddings-onnx",
"classes": {
"lab": {
"centroid": [0.0123, -0.0456, ...],
"prototype_texts": ["Hemoglobin A1c", "Glucose", ...]
},
...
}
}
How computed:
onnx/model_quantized.onnx (q8 dtype, matching runtime inference path)Usage in browser runtime:
const response = await fetch(
`https://huggingface.co/${MODEL_REPO}/resolve/main/centroids/observation_category.json`
);
const { classes } = await response.json();
// For each class, use classes[className].centroid directly
// (skip embedding prototype_texts since centroid is precomputed)
Regenerating: run python scripts/embedding_eval/compute_centroids.py after updating prototype texts.