Instructions to use stanford-med-hdr/tide2-sentry-clinical-ner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stanford-med-hdr/tide2-sentry-clinical-ner with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="stanford-med-hdr/tide2-sentry-clinical-ner")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("stanford-med-hdr/tide2-sentry-clinical-ner") model = AutoModelForTokenClassification.from_pretrained("stanford-med-hdr/tide2-sentry-clinical-ner", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Access the SHIELD tide2-sentry-clinical-ner model
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
This model is released under Stanford Medicine's Research Use Agreement (full text in the LICENSE file): non-commercial research use only, no redistribution, no sharing of the download link, and no attempt to re-identify any individual. Access also requires registering individually on the Redivis page: https://redivis.com/REPLACE_WITH_SENTRY_MODEL_DUA_SLUG . Requests are reviewed and approved manually by a stanford-med-hdr maintainer after your Redivis registration is verified. Hugging Face automatically records your HF username, account email, and request timestamp for gated repositories.
Log in or Sign Up to review the conditions and access this model content.
tide2-sentry-clinical-ner
A DeBERTa-v3-large token-classification model for clinical PHI/PII de-identification of English clinical notes. It is the distilled DeBERTa v3 student released with the SHIELD paper (Posada et al., 2026, arXiv:2605.03301), built for on-premise, enterprise-scale de-identification behind a hospital firewall.
Gated & Research Use Only. Access is gated behind Stanford Medicine's Research Use Agreement and individual registration on Redivis (see License & access). This model is not is not a substitute for human review.
Register and accept the Research Use Agreement on the Redivis page to access the model: https://stanford.redivis.com/datasets/0m5h-7vks05xhs
Model description & intended use
- Architecture:
DebertaV2ForTokenClassification(deberta-v2model type), fine-tuned frommicrosoft/deberta-v3-large(1024 hidden / 24 layers / 128,100 vocab, SentencePiece tokenizer). Max sequence length 512 tokens. - Task: token classification (NER) with a BIO tagging scheme.
- Intended use: first-pass detection of protected health information (PHI/PII) in English clinical free text, as one stage of a de-identification pipeline (e.g. TIDE 2.0 ). The model outputs entity spans; downstream anonymization (surrogate replacement, FPE, date jitter) is handled separately by TIDE 2.0 .
Entity / label set
The model covers the 9 canonical SHIELD PHI categories plus an OTHER
catch-all (10 entity types → 21 BIO labels including O):
AGE, DATE, DOCTOR, HOSPITAL, ID, LOCATION, PATIENT, PHONE, WEB,
OTHER.
Full label list: O, and B-/I- for each of
AGE, DATE, DOCTOR, HOSPITAL, ID, LOCATION, OTHER, PATIENT, PHONE, WEB.
Usage
This is a gated repository. Authenticate first with a Hugging Face token that has been granted access:
pip install transformers sentencepiece torch
hf auth login # or set the HF_TOKEN environment variable
With transformers
from transformers import pipeline
ner = pipeline(
"token-classification",
model="stanford-med-hdr/tide2-sentry-clinical-ner",
aggregation_strategy="simple",
)
text = "Patient John Doe seen by Dr. Smith on 5/3/2021 at Stanford Hospital."
for span in ner(text):
print(span["entity_group"], ":", span["word"])
# Expect PATIENT / DOCTOR / DATE / HOSPITAL spans.
With TIDE 2.0
TIDE 2.0 resolves a transformer model by name and falls back to
snapshot_download(repo_id=...), so you can point its transformer recognizer at
stanford-med-hdr/tide2-sentry-clinical-ner. Because the repo is gated, export a
token with access (HF_TOKEN) before running the pipeline. See the
tide2-core notebook to run it on a google colab instance.
Training data & procedure
This model is a distilled student; it was NOT trained on the SHIELD gold set. Per the paper (§2.3), SHIELD's 1,381 gold-annotated notes are held out entirely as an independent evaluation set. The student was trained via a three-stage teacher→student distillation on a silver-standard corpus of ~13,000 unlabeled STARR-OMOP clinical notes labeled by the teacher model Gemini 2.5 Flash, using token-level cross-entropy over BIO tags. No SHIELD gold-standard annotations were included in the training data.
- Training-data source: STARR-OMOP (Stanford Medicine Research Data Repository,
158B tokens of clinical text). Notes were selected via set-cover diversity sampling across six axes: age, sex, race, ethnicity, note type, and note length.
- Hyperparameters: 10 epochs, learning rate 1e-5, cosine schedule, batch size 15, AdamW (fused), bf16 mixed precision, weight decay 1e-6, seed 42. The deployed checkpoint was selected to maximize recall, the appropriate objective for de-identification safety.
Evaluation
Primary — SHIELD gold benchmark (span-level)
On the SHIELD gold evaluation set (1,381 real STARR-OMOP notes; 10,229 gold PHI spans across 9 categories), span-level with an 80%-overlap match criterion (paper §3.3):
| Metric | Value |
|---|---|
| Micro-averaged precision | 0.89 |
| Micro-averaged recall | 0.88 |
This is the best-performing distilled student in the paper, with the most uniform coverage across all 9 PHI categories. It trails the Gemini 2.5 Flash teacher on macro recall (0.81 vs 0.90). The paper also reports cross-dataset evaluation on i2b2 2014 and AIMI: universal structured PHI (dates, phones, IDs, web) transfers well, while institution-specific entities transfer less well.
Limitations & bias
- English clinical text only. Performance on other languages or non-clinical text is not evaluated.
- 512-token context window. Longer notes must be chunked; span accuracy near chunk boundaries can degrade.
- Not a complete de-identification solution. Use as one stage alongside human review and complementary recognizers; residual PHI is possible.
- Research Use Only.
License & access
This model is distributed under Stanford Medicine's Data Research Use Agreement
(the model DRUA), included in this repository as LICENSE:
non-commercial research use only, no redistribution, no sharing of the download
link, and no re-identification attempts.
Access is gated with manual approval. To obtain access:
- Register and accept the Research Use Agreement on the Redivis page: https://stanford.redivis.com/datasets/0m5h-7vks05xhs
- Request access on this Hugging Face repository and complete the gated form.
- A stanford-med-hdr maintainer grants access after verifying your Redivis registration. Each user must register individually.
References / citation
- Paper: Jose D. Posada, David Love, Somalee Datta, Priya Desai. SHIELD: A Diverse Clinical Note Dataset and Distilled Small Language Models for Enterprise-Scale De-identification. Stanford Medicine, 2026. arXiv:2605.03301. https://arxiv.org/abs/2605.03301
- SHIELD evaluation dataset: https://stanford.redivis.com/datasets/ee4n-6gv2f84et
- TIDE 2.0 Deid Framework: https://github.com/susom/tide2-core
@article{posada2026shield,
title = {SHIELD: A Diverse Clinical Note Dataset and Distilled Small Language
Models for Enterprise-Scale De-identification},
author = {Posada, Jose D. and Love, David and Datta, Somalee and Desai, Priya},
journal = {arXiv preprint arXiv:2605.03301},
year = {2026},
url = {https://arxiv.org/abs/2605.03301}
}
- Downloads last month
- 6
Model tree for stanford-med-hdr/tide2-sentry-clinical-ner
Base model
microsoft/deberta-v3-large