CoolFace
Apppublic

kushagrayadv/clinical-entities

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes
App README

Clinical Entity Extraction (NER)

Detects clinical entities (diagnosis, medical_history, medication, procedure, symptom) in clinical text with a fine-tuned GLiNER model.

API

The Space exposes a JSON endpoint at /extract_entities:

python
from gradio_client import Client

client = Client("https://<user>-<space>.hf.space")  # or Client("<user>/<space>", hf_token=...)
result = client.predict("Pt given gabapentin for neuropathy.", 0.5, api_name="/extract_entities")
# {"text": ..., "entities": [{"start", "end", "text", "label", "score"}, ...]}

Configuration

Set these as Space secrets/variables (Settings → Variables and secrets):

NamePurpose
HF_TOKEN (secret)Required to download the private model repo.
GLINER_ENTITY_MODELOverride the model repo id / path.
GLINER_DEVICEcpu (default) or cuda on GPU hardware.
LFM_PATCHauto (default) / always / never.