OpenMed

0.6.4 · active · verified Mon Apr 13

OpenMed is a Python library that delivers state-of-the-art biomedical and clinical Large Language Models (LLMs), focusing on advanced entity extraction, assertion detection, and medical reasoning. It provides a robust, open-source toolkit for HIPAA-compliant workflows, supporting a simple Python API, a FastAPI-based REST service, and batch processing capabilities. The library is actively developed, with its current version being 0.6.4, and is designed to unify model discovery, advanced extractions, and one-line orchestration for clinical NLP workflows.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use the `analyze_text` function to perform named entity recognition (NER) on clinical text using a specified model. It prints detected entities, their text, and confidence scores.

from openmed import analyze_text

text = "Patient started on imatinib for chronic myeloid leukemia."
result = analyze_text(
    text,
    model_name="disease_detection_superclinical", # Example model
    confidence_threshold=0.55 # Optional: filter entities by confidence
)

for entity in result.entities:
    print(f"{entity.label:<12} {entity.text:<35} {entity.confidence:.2f}")

# Example output:
# DISEASE      chronic myeloid leukemia      0.98
# DRUG         imatinib                    0.95

view raw JSON →