Token Classification
Transformers
Safetensors
English
modernbert
fill-mask
clinical
medical
biomedical
named-entity-recognition
maccrobat
ettin
Instructions to use CobuildX-AI/cbx-clinical-entity-extractor-68M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CobuildX-AI/cbx-clinical-entity-extractor-68M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="CobuildX-AI/cbx-clinical-entity-extractor-68M")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("CobuildX-AI/cbx-clinical-entity-extractor-68M") model = AutoModelForMaskedLM.from_pretrained("CobuildX-AI/cbx-clinical-entity-extractor-68M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 1,014 Bytes
1bbe0b8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | """Run the model on an invented case report (not from MACCROBAT or any real patient).
python example.py
"""
from cbx_clinical import ClinicalEntityExtractor
TEXT = """A 47-year-old woman presented to the emergency department with a 3-day history of fever and severe right upper quadrant pain.
She had a history of type 2 diabetes mellitus treated with metformin 500 mg twice daily.
Physical examination revealed tenderness in the right upper quadrant, and her temperature was 38.9 °C.
Laboratory tests showed an elevated white blood cell count of 15,200/µL.
Abdominal ultrasound demonstrated a distended gallbladder with a thickened wall and multiple gallstones.
She was diagnosed with acute cholecystitis and started on intravenous ceftriaxone.
Laparoscopic cholecystectomy was performed two days later, and she was discharged home on postoperative day 3."""
if __name__ == "__main__":
ner = ClinicalEntityExtractor(".")
for e in ner.extract(TEXT):
print(f"{e['label']:24s} {e['text']}")
|