EHRmonize
Welcome to EHRmonize, a Python package to abstract medical concepts using large language models.
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 |
Metadata
Release files for ehrmonize 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ehrmonize-0.1.2.tar.gz | 6.5 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ehrmonize-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.5 MB
Release files / ehrmonize-0.1.2.tar.gz
| Download URL | ehrmonize-0.1.2.tar.gz |
|---|---|
| Size | 6.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13ca33047db5fe6eb0601a5113b10394874c91ecfeb5df6fbf69afc092860cfd
|
|
BLAKE2b-256 checksum How to use checksums |
565cb04206861914d107e7ee90d2186814a338cd1b7e0e12a4f838176550dfa4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.3
|
Release files / ehrmonize-0.1.2-py3-none-any.whl
| Download URL | ehrmonize-0.1.2-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d4a21287efe43d11aa6a0953f10eec68c10074c9a34277aee61507ca912530b9
|
|
BLAKE2b-256 checksum How to use checksums |
b091dd99bff12218ad5b9e48260023d89db6c0a104b6fc3a536343a40d2535f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.3
|
Security for ehrmonize 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.