{"id":5351,"library":"openmed","title":"OpenMed","description":"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.","status":"active","version":"0.6.4","language":"en","source_language":"en","source_url":"https://github.com/maziyarpanahi/openmed","tags":["NLP","healthcare","LLM","biomedical","entity-extraction","PII","clinical-nlp"],"install":[{"cmd":"pip install openmed","lang":"bash","label":"Basic Installation"},{"cmd":"pip install \"openmed[hf]\"","lang":"bash","label":"With Hugging Face model support"},{"cmd":"pip install \"openmed[hf,service]\"","lang":"bash","label":"With Hugging Face and REST service support"}],"dependencies":[{"reason":"Required for Hugging Face model integration, used by the '[hf]' extra.","package":"transformers","optional":true},{"reason":"Required for the REST API service, used by the '[service]' extra.","package":"fastapi","optional":true},{"reason":"Required for the REST API service, used by the '[service]' extra.","package":"uvicorn","optional":true}],"imports":[{"symbol":"analyze_text","correct":"from openmed import analyze_text"},{"symbol":"BatchProcessor","correct":"from openmed import BatchProcessor"},{"symbol":"extract_pii","correct":"from openmed import extract_pii"},{"symbol":"deidentify","correct":"from openmed import deidentify"},{"symbol":"OpenMedConfig","correct":"from openmed import OpenMedConfig"}],"quickstart":{"code":"from openmed import analyze_text\n\ntext = \"Patient started on imatinib for chronic myeloid leukemia.\"\nresult = analyze_text(\n    text,\n    model_name=\"disease_detection_superclinical\", # Example model\n    confidence_threshold=0.55 # Optional: filter entities by confidence\n)\n\nfor entity in result.entities:\n    print(f\"{entity.label:<12} {entity.text:<35} {entity.confidence:.2f}\")\n\n# Example output:\n# DISEASE      chronic myeloid leukemia      0.98\n# DRUG         imatinib                    0.95","lang":"python","description":"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."},"warnings":[{"fix":"Allocate sufficient RAM/VRAM. For GPU acceleration, ensure compatible drivers and PyTorch/TensorFlow installations. Specify `model_name` correctly or configure `OPENMED_MODEL_CACHE_DIR` to pre-download models.","message":"OpenMed relies on underlying biomedical models (often from Hugging Face). These models can be large and require significant memory and/or GPU resources for optimal performance, particularly for larger texts or batch processing. Ensure your environment meets the computational demands, and models are available or downloaded.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Carefully review OpenMed's PII documentation. Ensure secure data handling practices, access controls, and auditing are in place at the application and infrastructure level.","message":"While OpenMed provides robust tools for HIPAA-compliant PII detection and de-identification (e.g., smart entity merging), achieving full HIPAA compliance is a broader responsibility that extends beyond the library's capabilities. It requires proper configuration, integration into a secure environment, and adherence to organizational policies.","severity":"gotcha","affected_versions":"All versions supporting PII features (v0.5.0+)"},{"fix":"Always explicitly set the desired `config_profile` when invoking `analyze_text` or related functions in production contexts, or manage it via environment variables (e.g., `OPENMED_PROFILE`).","message":"OpenMed supports different configuration profiles (e.g., 'dev', 'prod', 'test', 'fast') that can alter default behaviors like confidence thresholds or entity grouping. Not explicitly managing these profiles can lead to inconsistent results between development and production environments.","severity":"gotcha","affected_versions":"All versions supporting configuration profiles"},{"fix":"When processing non-English text for PII, pass the appropriate ISO 639-1 language code to the `lang` parameter.","message":"For PII extraction and de-identification in languages other than English, the `lang` parameter (e.g., `lang=\"es\"` for Spanish) must be explicitly provided to the `extract_pii` or `deidentify` functions. Failing to do so may result in incorrect or incomplete PII detection.","severity":"gotcha","affected_versions":"All versions supporting multilingual PII"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}