Skip to main content

ehrmonize is package to abstract medical concepts using large language models.

Project description

EHRmonize

Welcome to EHRmonize, a Python package to abstract medical concepts using large language models.

arXiv Python 3.9 License: MIT stability-beta Hugging Face PyPI version Documentation Status PR Welcome Badge

Suggested Citation

Matos, J., Gallifant, J., Pei, J., & Wong, A. I. (2024). EHRmonize: A framework for medical concept abstraction from electronic health records using large language models. arXiv. https://arxiv.org/abs/2407.00242

@article{
    matos2024ehrmonize,
      title={EHRmonize: A Framework for Medical Concept Abstraction from Electronic Health Records using Large Language Models}, 
      author={João Matos and Jack Gallifant and Jian Pei and A. Ian Wong},
      year={2024},
      eprint={2407.00242},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2407.00242}, 
}

Documentation

For documentation, please see: https://ehrmonize.readthedocs.io/. We are currently working on a demo that will soon be available on Google Colaboratory.

Motivation

Processing and harmonizing the vast amounts of data captured in complex electronic health records (EHR) is a challenging and costly task that requires clinical expertise. Large language models (LLMs) have shown promise in various healthcare-related tasks. We herein introduce EHRmonize, a framework designed to abstract EHR medical concepts using LLMs.

Rationale

EHRmonize is designed with two main components: a corpus generation and an LLM inference pipeline. The first step entails querying the EHR databases to extract and the text/concepts across various data domains that need categorization. The second step employs LLM few-shot prompting across different tasks. The objective is to leverage the vast medical text exposure of LLMs to convert raw input medication data into useful, predefined classes.

Dataset

Our curated and labeled dataset is accessible on HuggingFace.

Current supported tasks

Type Task
Free-text task_generic_drug
task_generic_route
Multiclass task_multiclass_drug
Binary task_binary_drug
Custom task_custom

Current supported models / engines / APIs

API model_id
OpenAI gpt-4
gpt-4o
gpt-3.5-turbo (discouraged!)
AWS Bedrock anthropic.claude-3-5-sonnet-20240620-v1:0
meta.llama3-70b-instruct-v1:0
mistral.mixtral-8x7b-instruct-v0:1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ehrmonize-0.1.2.tar.gz (6.5 MB view details)

Uploaded Source

Built Distribution

ehrmonize-0.1.2-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file ehrmonize-0.1.2.tar.gz.

File metadata

  • Download URL: ehrmonize-0.1.2.tar.gz
  • Upload date:
  • Size: 6.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for ehrmonize-0.1.2.tar.gz
Algorithm Hash digest
SHA256 13ca33047db5fe6eb0601a5113b10394874c91ecfeb5df6fbf69afc092860cfd
MD5 ccdf3b32a71c77b695f319330c750935
BLAKE2b-256 565cb04206861914d107e7ee90d2186814a338cd1b7e0e12a4f838176550dfa4

See more details on using hashes here.

File details

Details for the file ehrmonize-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ehrmonize-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for ehrmonize-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d4a21287efe43d11aa6a0953f10eec68c10074c9a34277aee61507ca912530b9
MD5 d454150c997dcb249447877702151466
BLAKE2b-256 b091dd99bff12218ad5b9e48260023d89db6c0a104b6fc3a536343a40d2535f8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page